Skip to content

Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA051 · Metric

PSNR, SSIM, and LPIPS image fidelity diagnostics

Compare aligned reference and reconstructed images using pixel fidelity, local structure, or learned perceptual features.

Needs a data type CodeSplash doesn't load yet Complete calculation CodeSplash's run and the reference's record

In CodeSplash

Running this needs images, audio, video, graphs or another data type CodeSplash doesn't load yet.

Availability
Needs a data type CodeSplash doesn't load yet
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Compare aligned reference and reconstructed images using pixel fidelity, local structure, or learned perceptual features.

Question / hypotheses

Which aspects of reconstruction agree with a reference, and which perceptual changes remain?

Architecture / computational structure

A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.

Assumptions

Alignment, pixel range, color space, resize operation, and reference validity must be fixed. SSIM windowing and LPIPS checkpoint/normalization are part of the definition.

Formula / computational definition

PSNR=10log⁡10(L2/MSE),LPIPS=∑l1HlWl∑h,w∥wl⊙(f^l(x)−f^l(y))hw∥2.PSNR=10\log_{10}(L^2/MSE),\quad LPIPS=\sum_l\frac1{H_lW_l}\sum_{h,w}\|w_l\odot(\hat f_l(x)-\hat f_l(y))_{hw}\|^2.

Parameters and notation

L is pixel dynamic range; f-hat are normalized feature maps; w_l are learned perceptual calibration weights. SSIM uses local mean, variance, and covariance with stabilizers.

Fitting, fine-tuning, and adaptation

There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.

How to use and calibrate

Report several diagnostics for aligned reconstruction and inspect images. Use appropriate range and exact implementations; evaluate temporal consistency separately for video.

Example application

Assess a neural image codec or super-resolution model.

Interpretation / pitfalls

Watch out

PSNR can favor blur; perceptual metrics can miss task-critical details. None alone measures whether a generated image satisfies a prompt. The code demonstrates PSNR only.

Python and R code examples

Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline. · needs numpy

import numpy as np
x=np.array([0.,.5,1.]); y=np.array([.05,.45,.9]); mse=np.mean((x-y)**2)
print(10*np.log10(1./mse))
R

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

x <- c(0,.5,1); y <- c(.05,.45,.9); mse <- mean((x-y)^2)
print(10*log10(1/mse))

Sources

From the CodeSplash reference, entry EVA051.