Is It Shift or Shape? Distribution-Free Local Feature Comparison for Judging Generative Image Restoration

Image-quality metrics tell us whether a restored or super-resolved image looks right to a person, and they break down on the outputs of generative models. On the PIPAL benchmark, PSNR and SSIM become anti-correlated with human judgment on images produced by generative adversarial networks (GANs). A standard deep metric, LPIPS-Alex, reaches a Spearman correlation of only 0.4862 on those images, rising to 0.5135 when its pooling is made shift-tolerant (PIPAL). Two explanations compete. The first says these metrics compare features location by location, so a sharp texture displaced by two pixels counts as two errors. The second says that the metrics that do compare statistics, such as Fréchet-style distances, fit a Gaussian (a mean and a covariance) to deep features, while real feature distributions are skewed and multi-modal (Using Skew to Assess the Quality of GAN-generated Image Features). Nobody has tested which explanation accounts for the remaining gap. The file states this directly: it is unknown whether the failure comes from spatial misalignment or from the Gaussian assumption.

We propose one metric that addresses both explanations and an experimental design that can tell them apart. Around each location in a deep feature map, take the set of feature vectors inside a small window, in both the reference and the test image. Compare the two sets with energy distance, a distribution-free distance between samples that is zero only when the distributions are identical. A shifted texture leaves the window's set of features almost unchanged, so the comparison tolerates small displacements. A texture with the right average but the wrong spread, skew, or modes still changes the set, so those errors are still caught. The window radius controls shift tolerance, and the distance family controls how much of the distribution's shape is compared. Varying both separately shows how much of PIPAL's remaining gap each cause explains.

Core Claim

Two existing fixes each handle one cause. Space Warping Difference (SWD) in Image Quality Assessment for Perceptual Image Restoration searches a fixed radius ($d=3$) for the single best-matching feature and takes a point difference. It tolerates shifts but compares only one vector at a time, so it ignores the statistics of the texture. The Skew Inception Distance pools the whole image into global moments up to third order. It sees distributional shape but discards all spatial structure, it is only a pseudometric, and it was never validated on human-rated quality data. Our claim is that the right unit of comparison for generative restoration is the local distribution of features. We further claim that a distribution-free comparison of that local set will beat both a hard local search and a local Gaussian (two-moment) comparison on PIPAL's GAN distortions, using the same backbone and the same training data. If the local Gaussian matches the distribution-free version, then the Gaussian assumption is not the bottleneck. That would be a useful negative result, and the design is built to detect it.

The Metric

Let $\phi_l(x)$ be the feature map of image $x$ at layer $l$ of a frozen, anti-aliased backbone. Following PIPAL's finding, we use the AlexNet or VGG trunk with BlurPool. For a location $p$, let $A_p$ be the set of unit-normalized feature vectors of the reference in the $(2r+1)\times(2r+1)$ window centered at $p$, and let $B_p$ be the corresponding set for the test image. The local energy distance is

$$ E_l(p) = \frac{2}{|A_p||B_p|}\sum_{a\in A_p,\,b\in B_p}\|a-b\| \;-\; \frac{1}{|A_p|^2}\sum_{a,a'\in A_p}\|a-a'\| \;-\; \frac{1}{|B_p|^2}\sum_{b,b'\in B_p}\|b-b'\|, $$

and the image-level score is $D(x,y)=\sum_l w_l \,\mathrm{mean}_p\, E_l(p)$. Here the $w_l$ are non-negative per-layer weights. They are learned on BAPPS two-alternative forced-choice judgments, which is the same supervision SWDN used, or set uniform for a training-free variant. With $r=3$ a window holds 49 vectors, so each location needs a $49\times49$ distance computation. That costs far less than a coskewness tensor and runs as a batched GPU operation.

Energy distance is a true metric on distributions, which avoids SID's pseudometric weakness. It needs no parametric family. This borrows the role energy-distance kernels play in Nonparametric Distribution Regression Re-calibration, which compares predicted and empirical distributions without assuming an error shape. We reuse only the distance, not their recalibration procedure. Setting $r=0$ recovers a normalized pointwise feature distance close to LPIPS. That gives a built-in check that the method reduces to the familiar baseline when the window is removed.

Research Program

The work has three parts. The first is building the metric and its controlled variants, all sharing one backbone, one set of layers, and one training protocol. The variants differ only in how the reference window and test window are compared. The pointwise variant compares only the center vectors. The search variant takes the minimum over the window of the pointwise distance, a reimplementation of SWD. The local-Gaussian variant computes a Fréchet distance between diagonal Gaussians fitted to each window; it must be diagonal because 49 samples cannot support a full covariance in hundreds of dimensions. The local three-moment variant adds per-channel skewness to the diagonal Gaussian, a spatially local version of SID's idea that avoids the full tensor. The fifth variant is the full energy distance. Each variant is evaluated over a sweep of window radii from 0 to 5. This two-way grid, comparison type by radius, is the main object of study.

The second part is a decomposition experiment on PIPAL's GAN outputs. We register each distorted image to its reference with dense optical flow restricted to small displacements, then rescore the registered images with the pointwise metric. If pointwise correlation on registered images rises to the level of the energy-distance metric on unregistered images, the gap is mostly about shift. If registration helps but the energy-distance metric still wins on registered images, the remainder is about distributional shape. This answers Gap 1's open question with a measurement rather than an argument.

The third part is a set of controlled synthetic probes on reference images. One probe applies pure small warps, which human observers rate as nearly invisible. A second resynthesizes textures that keep the per-window mean and variance of features but change their skew or modality. A third adds noise below the detection threshold, as in SID's own experiment. A metric that responds correctly should be nearly flat for the first and third probes and should respond to the second. These probes show which mechanism each variant actually captures.

Baselines

The naive reference points are PSNR and pixel MSE. On generative distortions, the file reports that these anti-correlate with human judgment (PIPAL). We also include PAMSE, which is MSE computed after Gaussian low-pass filtering (Perceptual Fidelity Aware Mean Squared Error). PAMSE raises Spearman correlation on TID2008 from 0.7718 to 0.9162 at 2.6 times the cost of MSE. It is the strongest cheap classical competitor and shows how far smoothing alone gets on GAN outputs. These are run as published, with no tuning.

The strongest reported number on the target question is LPIPS-Alex with BlurPool. It reaches a Spearman correlation of 0.5135 on PIPAL's GAN distortions, up from 0.4862 without anti-aliasing, as reported in PIPAL. It is the strongest competitor because it shares our backbone and anti-aliasing. Any gain we show over it therefore comes from the comparison rule, not from a better network. We rerun it in our pipeline, confirm we reproduce numbers close to those two values, and train its layer weights on BAPPS under the same budget as ours.

SWDN (Image Quality Assessment for Perceptual Image Restoration) is the most direct competitor in mechanism. The file reports that it outperforms LPIPS and PieAPP on PIPAL GAN distortions, but no reported result was found on Lacuna for SWDN's absolute PIPAL correlation. We therefore reimplement it as the search variant above, using its published radius $d=3$, the same backbone and BAPPS training, and a hyperparameter search of equal size. We report the published code's numbers alongside if they are available.

IEM (Learning a distance measure from the information-estimation geometry of data) is the strongest unsupervised, density-based metric. The file says it is competitive with LPIPS and DISTS on TID2013 and LIVE but gives no number. No reported result was found on Lacuna for IEM on PIPAL. We evaluate it with its released denoiser as an external reference point, without matching its compute.

The key ablation is the local-Gaussian variant at the same radius. It isolates the distribution-free ingredient from the windowing ingredient. "Beating the baseline" means two things on PIPAL's GAN subset: exceeding the rerun BlurPool-LPIPS-Alex and SWD-style search by a margin whose 95% bootstrap interval excludes zero, and exceeding the local-Gaussian variant at matched radius by the same standard. The bootstrap is resampled over reference images. We also require no loss larger than 0.01 in Spearman correlation on TID2013 and LIVE.

Why not just…?

Why not just use SWDN or BlurPool, which already fix shift? This is the real threat. If small displacements explain nearly all of the gap, the search variant will match the energy distance. The registration experiment will then show pointwise correlation recovering after alignment. The BlurPool gain reported in PIPAL is modest, from 0.4862 to 0.5135, which leaves room for another cause, but it does not show that one exists. Our grid compares search and distribution comparison at the same radius, so this question is settled directly. If they tie, we report that shift is the whole story and the cheaper search wins.

Why not just add higher moments, as SID does? The local three-moment variant is exactly this alternative, applied locally and per channel so it can run at all; full coskewness tensors are infeasible even globally without compressing the features with PCA, a compression SID reports costs up to 10% ImageNet accuracy. SID also remains a pseudometric, and its perceptual evidence rests on noise sweeps rather than human-rated datasets. If three moments capture what energy distance captures, the texture-resynthesis probe and the PIPAL results will show it, and we would recommend the simpler variant.

Why not just train on PIPAL labels, or retrieve neighbors instead of regressing? Regression-free Blind Image Quality Assessment reports a 21.1% Spearman gain over the next-best model on PIPAL algorithmic distortions. However, it is a no-reference method that retrieves human scores from a database built on the same kinds of distortions, so it answers a different question. It does not explain why full-reference comparisons fail, and its accuracy depends on how well the database covers new content. We keep PIPAL held out from training for all metrics. As a secondary result, we also fine-tune every variant's layer weights on a reference-disjoint PIPAL split, so supervised adaptation is compared at equal footing.

Why not just smooth the images first (PAMSE)? Smoothing models how human sensitivity varies with spatial frequency, but it still compares fixed coordinates, so a displaced sharp edge stays penalized. The pure-warp probe and PAMSE's PIPAL GAN score will show this directly. We expect it to fall below the deep baselines there despite its strength on TID2008.

Proposed Experiments

Primary evaluation uses the labeled portion of PIPAL, split by reference image and reported separately for traditional, deep-restoration, and GAN distortion groups. The metrics are Spearman and Kendall correlation with the Elo scores, with bootstrap intervals over references. Generalization checks use TID2013, LIVE, and CSIQ for traditional distortions and TQD for textures. TQD is where IEM's squared variant was reported strongest, and a local-distribution metric should be competitive there. Runtime per 512×512 image pair is reported against LPIPS and IEM.

Two results decide the outcome. First, at matched radius on PIPAL's GAN subset, does energy distance beat both the search variant and the local-Gaussian variant beyond the bootstrap interval? Second, after optical-flow registration, does the energy-distance advantage persist? A yes to both supports the claim that GAN-restoration metrics fail on distributional shape as well as on shift. Yes to the first and no to the second means windowing is the active ingredient and distribution-free comparison is just a good form of shift tolerance. No to the first means the Gaussian assumption is not the bottleneck for this task, and the gap must lie elsewhere, for example in semantic implausibility of the kind AGIDefect-4K annotates. Each outcome identifies which line of work to pursue next.