# 结构相似性

结构相似性（SSIM）指数是一种全参考指标，通过比较局部亮度、对比度和结构来量化图像或视频相对于参考图像的感知质量。它由周旺及其同事于2004年在《[IEEE图像处理汇刊](https://www.edgepedia.org/zh/ieee-transactions-on-image-processing)》上提出，作为均方误差（MSE）和峰值信噪比（PSNR）的感知替代方案，后两者往往与人类判断存在严重分歧。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup><sup> • </sup><sup>[2](https://utw10503.utweb.utexas.edu/publications/2002/zw_icassp2002_whyqa.pdf)</sup> SSIM及其多尺度变体被流媒体和社交媒体行业用于对每年数十亿计的图片和视频编码进行感知控制<sup>[3](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)</sup>，SSIM也被纳入[TensorFlow](https://www.edgepedia.org/zh/tensorflow)等工具包，并用作深度学习损失函数。<sup>[4](https://arxiv.org/html/2006.13846v2)</sup>

| 关键事实 | 值 |
|---|---|
| 分数范围 | 通常为[0, 1]；相同图像为1；在某些输入和参数设置下可为负值；\( \mathrm{MSSIM} \ge 0.99 \) 通常意味着图像无法区分<sup>[4](https://arxiv.org/html/2006.13846v2)</sup><sup> • </sup><sup>[5](https://www.mathworks.com/help//releases/R2021a/images/ref/ssim.html)</sup> |
| 参考窗口 | 11×11圆对称高斯窗，标准差1.5个采样，归一化为单位总和<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> |
| 稳定性常数 | \( C_1 = (K_1 \cdot L)^2 \)，\( C_2 = (K_2 \cdot L)^2 \)，其中 \( K_1 = 0.01 \)，\( K_2 = 0.03 \)；\( L \) 为动态范围（8位灰度时为255）<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> |
| 降采样规则 | 评分前对图像高度或宽度应用 \( F = \max(1, \mathrm{round}(N/256)) \)<sup>[6](https://ece.uwaterloo.ca/~z70wang/research/ssim/)</sup> |
| 验证 | 344张带主观评分的JPEG/JPEG2000图像；LIVE上Spearman相关系数0.9479，TID2008上0.7749<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup><sup> • </sup><sup>[6](https://ece.uwaterloo.ca/~z70wang/research/ssim/)</sup> |
| 工业用途 | 流媒体和社交媒体公司的感知编码控制<sup>[3](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)</sup> |

## 工作原理

SSIM基于一种结构失真哲学：人眼的主要功能是从视野中提取结构信息，而人类视觉系统对此高度适应，因此测量结构的退化程度可以近似感知失真。<sup>[2](https://utw10503.utweb.utexas.edu/publications/2002/zw_icassp2002_whyqa.pdf)</sup> 而MSE等误差敏感框架则不加区分地累积像素差异，不论其出现在何处；2002年的前驱论文表明，MSE几乎相同但感知质量截然不同的图像确实存在。<sup>[2](https://utw10503.utweb.utexas.edu/publications/2002/zw_icassp2002_whyqa.pdf)</sup>

在局部层面，SSIM以三项相乘的方式比较两幅图像：

\[ \mathrm{SSIM}(x,y) = [l(x,y)]^{\alpha} \cdot [c(x,y)]^{\beta} \cdot [s(x,y)]^{\gamma} \]

亮度项为 \( l(x,y) = (2\mu_x\mu_y + C_1)/(\mu_x^2 + \mu_y^2 + C_1) \)，对比度项为 \( c(x,y) = (2\sigma_x\sigma_y + C_2)/(\sigma_x^2 + \sigma_y^2 + C_2) \)，结构项为 \( s(x,y) = (\sigma_{xy} + C_3)/(\sigma_x\sigma_y + C_3) \)，其中 \( \mu_x \) 和 \( \mu_y \) 为局部均值，\( \sigma_x \) 和 \( \sigma_y \) 为局部标准差，\( \sigma_{xy} \) 为局部协方差，\( C_1 = (K_1 L)^2 \)。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> 当 \( \alpha = \beta = \gamma = 1 \) 且 \( C_3 = C_2/2 \) 时，该指数简化为

\[ \mathrm{SSIM}(x,y) = \frac{(2\mu_x\mu_y + C_1)(2\sigma_{xy} + C_2)}{(\mu_x^2 + \mu_y^2 + C_1)(\sigma_x^2 + \sigma_y^2 + C_2)} \]

该式具有对称性，上界为1，且仅当两个信号完全相同时等于1。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> 这些常数在早期的通用图像质量指数中并不存在，是为了避免除以零而添加的。<sup>[7](https://doi.org/10.1109/97.995823)</sup><sup> • </sup><sup>[4](https://arxiv.org/html/2006.13846v2)</sup>

作者的演示集说明了为何仅靠MSE会产生误导：同一幅图像的六个失真版本MSE在142到144之间，而SSIM从0.988降至0.662，追踪到了MSE无法察觉的巨大感知差异。<sup>[6](https://ece.uwaterloo.ca/~z70wang/research/ssim/)</sup>

## 实现方法

参考协议为单尺度。首先，可选地进行降采样：作者的脚本使用 \( F = \max(1, \mathrm{round}(N/256)) \)，其中N为图像高度或宽度的像素数，对局部 \( F \cdot F \) 像素取平均，并以F为因子降采样；512×512的图像降采样因子为2。<sup>[6](https://ece.uwaterloo.ca/~z70wang/research/ssim/)</sup>

其次，在图像上滑动一个11×11圆对称高斯窗，标准差为1.5个采样，归一化为单位总和，在每个位置计算三项局部比较。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> 第三，将局部SSIM值平均为均值SSIM（MSSIM），作为整体质量分数。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup>

不同实现的默认值有所差异。MATLAB的ssim函数使用 \( C_1 = (0.01 \cdot L)^2 \)、\( C_2 = (0.03 \cdot L)^2 \)、\( C_3 = C_2/2 \)，高斯窗默认Radius为1.5，对于uint8数据类型 \( L = 255 \)，而对于[0, 1]范围内的double或single数据 \( L = 1 \)。<sup>[5](https://www.mathworks.com/help//releases/R2021a/images/ref/ssim.html)</sup> scikit-image默认使用7×7均匀窗和样本协方差；要匹配周旺等人2004年的方案，必须设置gaussian_weights=True、sigma=1.5、use_sample_covariance=False，并显式传入data_range。<sup>[8](https://github.com/scikit-image/scikit-image/blob/v0.25.0/skimage/metrics/_structural_similarity.py)</sup>

## 起源

结构失真哲学由周旺和Alan C. Bovik于2002年5月在ICASSP上提出，该论文还实现了一个前驱质量指数，使用滑动8×8窗口，将失真建模为相关性损失、均值失真和方差失真。<sup>[2](https://utw10503.utweb.utexas.edu/publications/2002/zw_icassp2002_whyqa.pdf)</sup> 周旺和A.C. Bovik的配套期刊论文《通用图像质量指数》（《IEEE信号处理快报》，2002年）提出了通用质量指数（UQI）。<sup>[7](https://doi.org/10.1109/97.995823)</sup>

2004年周旺、Bovik、Sheikh和Simoncelli在IEEE TIP上发表的论文推广了该算法，添加了稳定性常数，并在344张经JPEG和JPEG2000压缩的图像上对照主观评分进行了验证，结果优于PSNR、Sarnoff模型和UQI。<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup> 使用参考实现，SSIM在LIVE上的Spearman秩相关系数为0.9479，在TID2008上为0.7749。<sup>[6](https://ece.uwaterloo.ca/~z70wang/research/ssim/)</sup>

## 变体

**多尺度SSIM（MS-SSIM）** 在通过迭代低通滤波和因子为2的降采样获得的五个空间分辨率上应用SSIM；对比度和结构比较在每个尺度上计算，亮度比较仅在最低分辨率尺度上计算，各分数以指数加权组合。在LIVE JPEG/JPEG2000集上，MS-SSIM在每项评估标准上都优于所有对比模型，包括最佳的单尺度SSIM。<sup>[9](https://utw10503.utweb.utexas.edu/publications/2003/zw_asil2003_msssim.pdf)</sup>

**视频SSIM** 将该指数扩展到视频；周旺、Ligang Lu和Alan C. Bovik的论文使用相同的SSIM形式，窗口为8×8滑动窗。<sup>[10](https://doi.org/10.1016/s0923-5965%2803%2900076-6)</sup> **CW-SSIM** 由M.P. Sampat、周旺、S. Gupta、A.C. Bovik和M.K. Markey于2009年在《IEEE图像处理汇刊》上提出，在复小波系数上计算相似度，对小幅度平移和旋转更为容忍。<sup>[11](https://doi.org/10.1109/tip.2009.2025923)</sup> **快速SSIM**，即Ming-Jun Chen和Alan C. Bovik的“快速结构相似性指数算法”，于2010年发表在《实时图像处理杂志》上。<sup>[12](https://doi.org/10.1007/s11554-010-0170-9)</sup> IW-SSIM按信息量对局部分数加权，SSIMplus是该指数的一个命名扩展。<sup>[3](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)</sup><sup> • </sup><sup>[4](https://arxiv.org/html/2006.13846v2)</sup>

Yuriy Reznik在2023年的一项分析中提出了SSIM的对称双带重计算方案，使用sigma为3的[高斯滤波器](https://www.edgepedia.org/zh/gaussian-filter)，在编解码噪声、分辨率变化、模糊和加性噪声下与原始模型匹配，并提出了一个N带扩展，其子带以角度单位定义，与对比敏感度函数对齐，不同于MS-SSIM固定的像素级尺度。<sup>[13](https://doi.org/10.2352/ei.2023.35.8.iqsp-305)</sup> ACSSIM由Sos S. Agaian、Artyom M. Grigoryan和Hrach Ayunts提出，是一种自适应对比度加权结构相似性度量，将局部结构相似性与基于无参考图像特征的对比度加权相结合；在TID2013和KADID-10k上的实验表明，在低计算开销下，其与主观判断的相关性优于基线PSNR和SSIM。<sup>[14](https://doi.org/10.3390/info17070632)</sup>

## 应用

除质量评分外，SSIM还被用作图像去噪、恢复、均衡器设计、对比度增强、水印、图像近似、量化和编码以及视频压缩中的率失真优化等优化问题的目标函数。<sup>[15](https://doi.org/10.1109/tip.2011.2173206)</sup> 面向视频编码的SSIM驱动率失真优化由王世奇、Abdul Rehman、周旺、马思伟和高文于2011年发表<sup>[16](https://doi.org/10.1109/tcsvt.2011.2168269)</sup>，SSIM用于优化的精确梯度由Alireza Nasiri Avanaki于2009年推导。<sup>[17](https://doi.org/10.1007/s10043-009-0119-z)</sup> 如今SSIM是一种深度学习损失，随TensorFlow发布<sup>[4](https://arxiv.org/html/2006.13846v2)</sup>，SSIM和MS-SSIM每年在流媒体和社交媒体中对数十亿计的图片和视频编码进行感知控制。<sup>[3](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)</sup>

## 局限性与替代方案

**SSIM不是一种度量。** 三角不等式不成立，MSE的凸性等理想性质可能失效；Brunet、Vrscay和周旺构造了归一化和广义化的变体，它们是有效的距离度量。<sup>[15](https://doi.org/10.1109/tip.2011.2173206)</sup>

**已知的失效模式。** 视频扩展对具有大幅全局运动的序列报告了显著异常值，其作者未能找到将运动信息自然纳入SSIM的方法。<sup>[10](https://doi.org/10.1016/s0923-5965%2803%2900076-6)</sup> 输入色彩空间从未被定义，参考MATLAB脚本假设图像为sRGB编码而不做变换；在某些参数下，SSIM可能输出未定义或非直观的结果，例如对于低亮度或规律变化的像素分布。<sup>[4](https://arxiv.org/html/2006.13846v2)</sup> MS-SSIM及类似度量仅为灰度设计，将其分别应用于RGB通道无法考虑色相和饱和度。<sup>[18](https://pmc.ncbi.nlm.nih.gov/articles/PMC7817470/)</sup> 2025年一项涉及33种度量的心理物理学研究发现，SSIM过度强调高空间频率的差异，与对比敏感度函数相悖，而MS-SSIM通过带通响应解决了这一问题。<sup>[19](https://arxiv.org/html/2503.16264v1)</sup> 公开实现在效率和行为上也存在差异，使得SSIM成为一把“可弯曲的尺子”，混合使用不同实现时结果不可靠；标称复杂度为 \( O(MNk^2) \)。<sup>[3](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)</sup>

**参数敏感性存在争议。** 原始论文报告性能对K1和K2的变化相当不敏感<sup>[1](https://doi.org/10.1109/tip.2003.819861)</sup>，但一项数据驱动的优化研究援引Silvestre-Blanes（2011）的研究，认为其证明了相反的结论，因此对两个常数进行联合优化。<sup>[20](https://research.unl.pt/ws/portalfiles/portal/34733214/Structura_Similarity_Index_SSIM_Revisited.pdf)</sup>

**与PSNR的关系。** 该分数并非独立于PSNR：在零稳定性常数下，对于相似亮度和[0.2, 0.8]范围内的SSIM值，SSIM近似线性等价于PSNR。<sup>[4](https://arxiv.org/html/2006.13846v2)</sup> Reznik通过低通和高通图像频带的SNR值推导了SSIM与MSE/PSNR之间的联系，并表明非锐化掩模等预滤波可以通过平衡频带间的误差来提升编码视频的SSIM分数，这是基于分数的比较中需要注意的一个问题。<sup>[13](https://doi.org/10.2352/ei.2023.35.8.iqsp-305)</sup>

**与替代方案的比较。** 在大型主观评分数据库上，SSIM、MS-SSIM、IW-SSIM、VIF、VSNR、MAD和FSIM在与主观质量的相关性方面显著且一致地优于MSE和PSNR。<sup>[15](https://doi.org/10.1109/tip.2011.2173206)</sup><sup> • </sup><sup>[21](https://doi.org/10.1109/tip.2011.2109730)</sup> 作为去噪、去模糊、超分辨率和压缩的优化目标，学习模型LPIPS和DISTS在17个全参考模型中提供了最佳的整体性能，但计算成本更高、可解释性更低；MS-SSIM等结构相似性方法在优化过程中也容易产生模糊伪影，且不满足单射性准则。<sup>[18](https://pmc.ncbi.nlm.nih.gov/articles/PMC7817470/)</sup> 2025年的心理物理学研究补充了一个细微差别：SSIM在捕捉感知质量方面可以说优于PSNR，但除对比度掩蔽外，PSNR-Y在所有测试中与视觉系统更为一致。<sup>[19](https://arxiv.org/html/2503.16264v1)</sup> 尚无已发表的SSIM与2023年后深度学习损失的正面基准比较，因此在所引文献中这些比较仍无定论。

## References

1. [Zhou Wang and colleagues (2004). Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2003.819861)
2. [Why Is Image Quality Assessment So Difficult? (ICASSP 2002 conference precursor)](https://utw10503.utweb.utexas.edu/publications/2002/zw_icassp2002_whyqa.pdf)
3. [A Hitchhiker's Guide to Structural Similarity (IEEE Access, 2021)](https://www.live.ece.utexas.edu/publications/2021/Hitchiker_SSIM_Access.pdf)
4. [Understanding SSIM (Andersson et al., arXiv, critical analysis for graphics/rendering)](https://arxiv.org/html/2006.13846v2)
5. [ssim, Structural similarity (SSIM) index (MathWorks Image Processing Toolbox documentation)](https://www.mathworks.com/help//releases/R2021a/images/ref/ssim.html)
6. [The SSIM Index for Image Quality Assessment (Zhou Wang's official project page with reference implementation)](https://ece.uwaterloo.ca/~z70wang/research/ssim/)
7. [Zhou Wang, A.C. Bovik (2002). A universal image quality index. IEEE Signal Processing Letters.](https://doi.org/10.1109/97.995823)
8. [scikit-image structural_similarity reference implementation (v0.25.0)](https://github.com/scikit-image/scikit-image/blob/v0.25.0/skimage/metrics/_structural_similarity.py)
9. [Multi-scale structural similarity for image quality assessment (Wang, Simoncelli, Bovik, Asilomar 2003)](https://utw10503.utweb.utexas.edu/publications/2003/zw_asil2003_msssim.pdf)
10. [Video quality assessment based on structural distortion measurement (Signal Processing Image Communication, 2003)](https://doi.org/10.1016/s0923-5965%2803%2900076-6)
11. [M.P. Sampat and colleagues (2009). Complex Wavelet Structural Similarity: A New Image Similarity Index. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2009.2025923)
12. [Ming-Jun Chen, Alan C. Bovik (2010). Fast structural similarity index algorithm. Journal of Real-Time Image Processing.](https://doi.org/10.1007/s11554-010-0170-9)
13. [Yuriy Reznik (2023). Another look at SSIM image quality metric. Electronic Imaging.](https://doi.org/10.2352/ei.2023.35.8.iqsp-305)
14. [Sos S. Agaian, Artyom M. Grigoryan, Hrach Ayunts (2026). A Survey and Tutorial on Image Quality Assessment with a Contrast-Weighted Structural Similarity Framework. Information.](https://doi.org/10.3390/info17070632)
15. [D. Brunet, E. R. Vrscay, Zhou Wang (2011). On the Mathematical Properties of the Structural Similarity Index. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2011.2173206)
16. [Shiqi Wang and colleagues (2011). SSIM-Motivated Rate-Distortion Optimization for Video Coding. IEEE Transactions on Circuits and Systems for Video Technology.](https://doi.org/10.1109/tcsvt.2011.2168269)
17. [Alireza Nasiri Avanaki (2009). Exact global histogram specification optimized for structural similarity. Optical Review.](https://doi.org/10.1007/s10043-009-0119-z)
18. [Comparison of Full-Reference Image Quality Models for Optimization of Image Processing Systems](https://pmc.ncbi.nlm.nih.gov/articles/PMC7817470/)
19. [Do image and video quality metrics model low-level human vision? (2025)](https://arxiv.org/html/2503.16264v1)
20. [Structural Similarity Index (SSIM) Revisited: a Data-Driven approach](https://research.unl.pt/ws/portalfiles/portal/34733214/Structura_Similarity_Index_SSIM_Revisited.pdf)
21. [Lin Zhang and colleagues (2011). FSIM: A Feature Similarity Index for Image Quality Assessment. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2011.2109730)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › 语言与视觉人工智能 › 计算机视觉 › 视觉方法与几何 › 低层图像分析

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/structural-similarity

English original: https://www.edgepedia.org/structural-similarity
