Shift-tolerant Perceptual Similarity Metric

Abhijay Ghildyal, Feng Liu

Abstract

Traditional perceptual similarity metrics, such as LPIPS, often rely on a strict "alignment assumption," making them sensitive to minor, human-imperceptible image shifts. This paper investigates the root cause of this sensitivity—aliasing in deep neural networks—and proposes a "shift-tolerant" version of LPIPS. By implementing architectural improvements like anti-aliasing filters (BlurPool) and reduced strides, the authors demonstrate a metric that aligns more closely with human vision, significantly reducing rank-flip rates while maintaining high accuracy on standard benchmarks.

Introduction

In the field of computer vision, measuring the similarity between two images is a fundamental task. While classic metrics like Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM) have long been used, modern deep-learning-based metrics like Learned Perceptual Image Patch Similarity (LPIPS) have become the standard for capturing human-like judgment. However, these metrics share a common flaw: the "alignment assumption."

Humans are remarkably robust to small spatial translations; a one-pixel shift in an image is virtually invisible to the naked eye. In contrast, most computer vision metrics perceive such a shift as a significant change in content. This sensitivity can lead to inconsistent quality rankings in real-world applications like GAN-based restoration or video processing, where perfect alignment is rarely guaranteed. This paper addresses this discrepancy by redesigning neural network architectures to be inherently shift-tolerant.

The Problem: Aliasing and Shift-Variance

The sensitivity of deep neural networks to small shifts stems from aliasing. When layers downsample data—typically through strided convolutions or pooling—they often violate the Nyquist sampling theorem if they do not apply proper low-pass filtering first. This causes the network to lose shift-invariance; the feature embeddings change not just in position, but in value, based on where an object sits relative to the sampling grid. Consequently, a metric like LPIPS may "flip" its judgment (deciding Image A is better than Image B, then reversing that decision after a 1-pixel shift) simply because the internal representations of the images shifted inconsistently.

Methodology: Architectural Hygiene

Rather than relying on data augmentation—which involves training the network on shifted images—the authors advocate for "architectural hygiene." They modify the LPIPS baseline (AlexNet, VGG, or ResNet backbones) using several key strategies:

  • Anti-Aliasing (BlurPool): The authors replace standard max-pooling and strided convolutions with BlurPool. This technique applies a low-pass (Gaussian) filter before downsampling, preventing aliasing artifacts and ensuring that the sub-sampled signal remains a faithful representation of the original.
  • Reducing Stride: Large initial strides (e.g., stride=4 in AlexNet) are identified as major sources of instability. Reducing these strides to 1 or 2 significantly improves the network's ability to handle shifts.
  • Border Handling: To prevent feature embeddings from being anchored to absolute image boundaries, the authors utilize reflection padding and "Full Convolution" (F-Conv) techniques.
  • Strategic Layer Placement: Experiments revealed that placing BlurPool before activation layers (like ReLU) is most effective when using small strides, ensuring that the non-linearity does not re-introduce high-frequency aliases before the signal is stabilized.

Experimental Evaluation

The authors validated their approach using three primary datasets:

  1. MS-COCO User Study: A study involving 30 participants established a human baseline. Results showed that humans consider 1-pixel and 2-pixel shifts to be identical to the original image in 80.7% and 56% of cases, respectively.
  2. BAPPS (Berkeley-Adobe Perceptual Patch Similarity): The authors created a "shifted" version of this standard benchmark to measure the rank-flip rate—the frequency with which a metric changes its preference between two images due to a minor shift.
  3. CLIC (Challenge on Learned Image Compression): This served as an external validation set to test the metric's generalization across different distortion types.

Key Results

The modified "shift-tolerant" LPIPS demonstrated superior performance over the original baseline:

  • Reduced Rank-Flip Rate: On the BAPPS 256x256 dataset, the proposed model achieved a rank-flip rate of only 0.57% for a 1-pixel shift, a massive improvement over the original LPIPS rate of 2.81%.
  • Consistency with Human Judgment: The model maintained or slightly improved its 2-alternative forced choice (2AFC) score (approximately 70.48%), proving that robustness does not come at the cost of perceptual accuracy.
  • Generalization: On the CLIC dataset, the shift-tolerant model recorded only 17 rank flips for a 1-pixel shift, compared to 90 for the original LPIPS.

Conclusion and Future Work

This research highlights that shift-variance in CNNs is not a failure of training data, but a consequence of architectural sampling choices. By incorporating anti-aliasing directly into the network structure, the authors created a metric that is both perceptually accurate and spatially robust.

While the study focused primarily on horizontal shifts and specific backbones, the mathematical principles of anti-aliasing are universal. Future work may extend these fixes to more complex transformations like rotation and scaling. Furthermore, these shift-tolerant metrics hold great promise as loss functions for training generative models, potentially eliminating the jitter and artifacts often seen in GAN-generated video and high-resolution imagery.

Summary updated

BibTeX
@inproceedings{ghildyal2022shift,
  author = {Abhijay Ghildyal and Feng Liu},
  title = {{Shift-tolerant Perceptual Similarity Metric}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19797-0\_6},
}
Figure