Robots Atlas>ROBOTS ATLAS
Evaluation

SSIM

2004ActivePublished: 2 September 2026Updated: 2 September 2026Published
Key innovation
Replaced pixel-wise error measurement (MSE/PSNR) with a measure of structural information degradation that correlates far better with human visual perception.
Category
Evaluation
Abstraction level
Primitive
Operation level
Evaluation (runtime)Training
Use cases
Assessing image and video compression qualityEvaluating super-resolution and denoisingEvaluating image and video generative modelsLoss function for training image-restoration networksCodec benchmarking

How it works

For two image signals x and y within a local window, SSIM combines three comparisons: luminance l(x,y) based on the means μx, μy; contrast c(x,y) based on the standard deviations σx, σy; and structure s(x,y) based on the covariance σxy. In compact form: SSIM(x,y) = (2μxμy + C1)(2σxy + C2) / ((μx² + μy² + C1)(σx² + σy² + C2)), where the stabilizing constants C1 = (K1·L)² and C2 = (K2·L)² depend on the dynamic range L (255 for an 8-bit image) and small constants K1 = 0.01 and K2 = 0.03. The window slides across the whole image and the final score is the mean of the local SSIM values (MSSIM).

Problem solved

Traditional error-based metrics (MSE, PSNR) correlate poorly with human-perceived image quality — two images with identical MSE can differ drastically in visual quality. SSIM addresses this by measuring structural similarity instead of absolute pixel-intensity difference.

Components

Luminance comparisonCompares brightness based on mean intensities μx, μy.

Component measuring luminance agreement; l(x,y) = (2μxμy + C1) / (μx² + μy² + C1).

Contrast comparisonCompares contrast based on standard deviations σx, σy.

Component measuring contrast agreement; c(x,y) = (2σxσy + C2) / (σx² + σy² + C2).

Structure comparisonCompares structure based on covariance σxy (correlation after normalization).

Component measuring structural correlation; s(x,y) = (σxy + C3) / (σxσy + C3), where typically C3 = C2/2.

Sliding Gaussian windowLocalizes statistics computation; standard 11×11 Gaussian-weighted window (sigma 1.5).

Window slid pixel by pixel where μ, σ and σxy are computed; aggregating local SSIM yields MSSIM.

Implementation

Implementation pitfalls
Incorrect dynamic range (data_range)High

Passing the wrong L (e.g. 255 for data normalized to [0,1]) yields wrong C1/C2 constants and invalid scores.

Fix:Always set data_range to match the actual pixel range.
Skipping the Gaussian window / global computationMedium

Computing SSIM globally instead of in a sliding window changes results and deviates from the paper definition.

Fix:Use a local (11×11 Gaussian) window and average local values (MSSIM).
Inconsistent color-channel handlingMedium

Averaging SSIM over RGB channels without luminance conversion produces results not comparable across implementations.

Fix:Fix and document the color handling (luminance vs per-channel).
Treating high SSIM as a quality guaranteeMedium

SSIM does not capture all distortion types (e.g. geometric shifts); a high score does not always mean good perceptual quality.

Fix:Combine SSIM with other metrics (MS-SSIM, LPIPS) and visual inspection.

Evolution

Original paper · 2004 · IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600–612 · Zhou Wang
Image Quality Assessment: From Error Visibility to Structural Similarity
Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, Eero P. Simoncelli
2003
MS-SSIM (multiscale SSIM)
Inflection point

Wang, Simoncelli and Bovik introduce a multiscale version of SSIM at the Asilomar conference.

2004
SSIM defined (IEEE TIP)
Inflection point

Paper defining SSIM in IEEE Transactions on Image Processing.

2011
IW-SSIM (Information Content Weighted SSIM)

Wang and Li propose information-content weighting of SSIM, improving correlation with human judgments.

2017
SSIM/MS-SSIM as a differentiable loss

Zhao et al. demonstrate using (MS-)SSIM as a loss function for training image-restoration networks.

Hyperparameters (configurable axes)

Dynamic range (L)Critical

Range of pixel values; drives constants C1, C2. Must match the data (e.g. 255 for 8-bit, 1.0 for normalized).

255
1.0
Window sizeHigh

Size of the local window; standard 11×11.

11×11
7×7
Gaussian sigmaMedium

Standard deviation of the Gaussian window weighting.

1.5
Stabilization constants K1, K2Medium

Small constants preventing division by zero; C1=(K1·L)², C2=(K2·L)².

K1=0.01, K2=0.03
Exponents α, β, γLow

Weights of luminance, contrast and structure components; default α=β=γ=1.

1, 1, 1

Computational complexity

Time complexity: O(N). Space complexity: O(N).

Execution paradigm

Primary mode
Dense

Computation performed densely over all pixels; no conditional routing.

Activation pattern
All paths active

Parallelism

Parallelism level
Fully parallel

Per-window statistics and SSIM values are independent, enabling full parallelism (e.g. on GPU).

Scope
Inference

Hardware requirements

Primary

Simple convolution/statistics operation, efficient on both CPU and GPU.

Good fit

As a differentiable loss in network training it benefits from GPU acceleration.