How to Interpret PSNR and SSIM Benchmark Metrics for Frame Interpolation in RIFE
PSNR and SSIM quantify reconstruction fidelity in RIFE by measuring pixel-wise error and structural similarity, with typical Vimeo-90K scores around 36 dB PSNR and 0.96 SSIM indicating high-quality interpolation.
Frame interpolation generates intermediate frames between existing ones, and evaluating quality requires standardized metrics. The hzwer/eccv2022-rife repository uses PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index) as primary benchmarks across datasets like Vimeo-90K, UCF-101, and ATD-12K. Understanding how to interpret these values helps you compare model checkpoints and diagnose interpolation artifacts.
What PSNR and SSIM Measure for Frame Interpolation
Peak Signal-to-Noise Ratio (PSNR)
PSNR measures the ratio between the maximum possible pixel value (typically 255 for 8-bit images) and the mean squared error (MSE) between the ground truth and interpolated frame. In hzwer/eccv2022-rife, the calculation follows the standard formula:
psnr = 10 * np.log10(255.0 ** 2 / np.mean((gt - pred) ** 2))
For frame interpolation, PSNR values typically range from 20–40 dB. Scores above 30 dB generally indicate good quality, while small improvements of 0.1–0.5 dB can signal perceptible visual gains in challenging motion scenarios.
Structural Similarity Index (SSIM)
SSIM evaluates perceptual similarity by comparing luminance, contrast, and structure between the ground truth and predicted frames. Unlike PSNR, SSIM correlates more closely with human visual perception, making it crucial for assessing edge preservation and texture fidelity in interpolated sequences.
The repository computes SSIM using:
ssim = compare_ssim(gt, pred, multichannel=True, data_range=255)
SSIM values range from 0 to 1, with typical frame interpolation results falling between 0.70–0.95. Scores exceeding 0.90 indicate excellent structural preservation, while gains of 0.01–0.02 often correspond to noticeable reductions in blurring or ghosting artifacts.
How RIFE Computes PSNR and SSIM Benchmarks
The hzwer/eccv2022-rife repository implements standardized evaluation pipelines across multiple datasets. Each benchmark script follows a consistent workflow:
- Load ground truth frames from high-frame-rate sequences
- Generate intermediate frames using
inference_video.pyor direct model inference - Calculate metrics using the PSNR and SSIM formulas shown above
- Average results across all test sequences
You can find the implementation in these key files:
benchmark/Vimeo90K.py– Evaluates on the Vimeo-90K septuplet test setbenchmark/UCF101.py– Tests on the UCF-101 action datasetbenchmark/ATD12K.py– Benchmarks on the large-scale ATD-12K datasetbenchmark/HD_multi_4X.py– Reports PSNR across multiple HD resolutions (544×1280, 720p, 1080p)
The console output follows a standardized format. For Vimeo-90K, UCF-101, and ATD-12K, the scripts print:
Avg PSNR: 36.12 SSIM: 0.962
For HD benchmarks, the output shows resolution-specific values:
PSNR: 35.8(544*1280), 34.2(720p), 32.1(1080p)
Interpreting PSNR and SSIM Results in Practice
When evaluating frame interpolation quality in RIFE, consider both metrics together. PSNR indicates overall reconstruction accuracy, while SSIM reveals structural fidelity. A model improvement that increases PSNR but decreases SSIM may indicate over-smoothing or ringing artifacts that pixel-wise averaging misses but human perception catches.
Use this reference table to interpret benchmark changes:
| Scenario | PSNR Change | SSIM Change | Likely Visual Impact |
|---|---|---|---|
| Minimal improvement | +0.1 dB | +0.001 | Hardly noticeable; likely statistical noise |
| Moderate gain | +0.5 dB | +0.01 | Clear sharpening of edges and reduced blurriness |
| Significant improvement | +1.5 dB | +0.03 | Noticeable reduction in ghosting/artifacts; smoother motion |
| Divergent signals | Any increase | Decrease | Potential over-sharpening or ringing; visual quality may worsen |
In the RIFE repository, typical high-quality results on Vimeo-90K approach 36 dB PSNR and 0.96 SSIM. If your custom training yields significantly lower values (e.g., < 30 dB PSNR or < 0.85 SSIM), investigate data loading, flow estimation accuracy, or alignment issues in the model/RIFE.py implementation.
Running Your Own PSNR and SSIM Evaluations
The repository provides ready-to-use scripts for benchmarking custom models or datasets.
Benchmarking on Vimeo-90K
python benchmark/Vimeo90K.py \
--model ./model_weights/RIFE_HD_v2.pth \
--input_dir /path/to/vimeo90k/low_fps \
--gt_dir /path/to/vimeo90k/high_fps
Programmatic extraction of metrics
Capture PSNR and SSIM values for automated testing:
import subprocess
import re
def run_benchmark(model_path):
out = subprocess.check_output([
"python", "benchmark/UCF101.py",
"--model", model_path,
"--input_dir", "data/ucf_low",
"--gt_dir", "data/ucf_high"
], text=True)
return list(map(float, re.search(
r"Avg PSNR: ([\d.]+) SSIM: ([\d.]+)", out
).groups()))
psnr_a, ssim_a = run_benchmark("model_weights/RIFE_HD.pth")
psnr_b, ssim_b = run_benchmark("model_weights/RIFE_HD_v2.pth")
print(f"RIFE_HD → PSNR: {psnr_a:.2f}, SSIM: {ssim_a:.4f}")
print(f"RIFE_HD_v2 → PSNR: {psnr_b:.2f}, SSIM: {ssim_b:.4f}")
Computing metrics on single frame pairs
For debugging specific interpolation artifacts:
import cv2
import numpy as np
from skimage.metrics import structural_similarity as compare_ssim
gt = cv2.imread("ground_truth.png")
pred = cv2.imread("interpolated.png")
mse = np.mean((gt.astype(np.float32) - pred.astype(np.float32)) ** 2)
psnr = 10 * np.log10(255.0 ** 2 / mse)
ssim, _ = compare_ssim(gt, pred, full=True, multichannel=True, data_range=255)
print(f"PSNR: {psnr:.2f} dB, SSIM: {ssim:.4f}")
Summary
- PSNR measures pixel-wise reconstruction error in decibels; higher values (30+ dB) indicate less distortion, with 0.1–0.5 dB gains often perceptible.
- SSIM evaluates structural fidelity (edges, textures) on a 0–1 scale; values above 0.90 represent excellent quality, and 0.01+ improvements usually correlate with visible sharpness gains.
- The
hzwer/eccv2022-riferepository computes these metrics inbenchmark/Vimeo90K.py,benchmark/UCF101.py, andbenchmark/ATD12K.py, averaging results across all interpolated frames. - Always evaluate both metrics together; divergent signals (PSNR up, SSIM down) may indicate over-smoothing or ringing artifacts that degrade perceptual quality despite lower pixel error.
Frequently Asked Questions
What is a good PSNR value for frame interpolation?
For video frame interpolation using RIFE on standard benchmarks like Vimeo-90K, PSNR values around 35–37 dB indicate high-quality results. Values below 30 dB typically suggest significant motion artifacts or alignment errors, while gains of 0.5 dB or more between model versions usually translate to perceptible visual improvements.
Why does SSIM matter if PSNR is already high?
PSNR only measures pixel-wise intensity differences and can be misleading when artifacts affect structural elements like edges or textures. SSIM specifically evaluates luminance, contrast, and structural correlation, making it more aligned with human perception. A model might achieve high PSNR through aggressive smoothing that actually destroys fine details, which SSIM would reveal as a lower score.
How do I run PSNR and SSIM benchmarks on my own video dataset?
Use the existing benchmark scripts as templates. Create a Python script that loads your ground-truth and input frames, calls inference_video.py to generate intermediates, then computes metrics using the formulas found in benchmark/Vimeo90K.py:
psnr = 10 * np.log10(255.0 ** 2 / np.mean((gt - pred) ** 2))
ssim = compare_ssim(gt, pred, multichannel=True, data_range=255)
Average these values across your test set to obtain final benchmark scores comparable to the official RIFE results.
Can PSNR and SSIM improve while visual quality degrades?
Yes, this occurs when models optimize for pixel-wise accuracy at the expense of perceptual quality. For example, over-sharpening might increase PSNR slightly while introducing ringing artifacts that reduce SSIM. Conversely, excessive smoothing can raise PSNR by reducing noise but lower SSIM by blurring textures. Always verify that both metrics trend upward before concluding that a model iteration represents genuine quality improvement.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →