# 非负矩阵分解

非负矩阵分解（NMF）将一个非负数据矩阵近似为两个低秩非负矩阵的乘积，从而使每个数据向量都由所学基向量的加性组合重建。它被用于降维、源分离和主题提取。<sup>[1](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html)</sup> 由于因子不能包含负值，表示是纯加性的，这正是NMF学到人脸的部件和文本的语义特征、而主成分分析（PCA）和向量量化学到整体特征的原因。<sup>[2](https://doi.org/10.1038/44565)</sup>

| 关键事实 | 详情 |
|---|---|
| 分解 | 给定一个 n × m 的非负数据矩阵 V，寻找非负的 \( W \)（\( n \times r \)）和 \( H \)（\( r \times m \)），其中 r 小于 n 或 m；V 的每一列 \( v \) 都是 W 的列以 h 为权重的组合。 |
| 为何非负 | 非负性只允许加性组合而不允许减性组合，从而产生基于部件的表示。<sup>[2](https://doi.org/10.1038/44565)</sup> |
| 目标函数 | 欧几里得（Frobenius）、广义Kullback-Leibler和Itakura-Saito损失，由β散度族统一。<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup> |
| 收敛性 | 乘法更新被证明不会增加欧几里得距离或散度，其辅助函数论证类似于EM算法所用的论证，不过一篇已发表的综述对单调性证明提出了异议。 |
| 复杂度 | 精确NMF一般是NP难的。<sup>[4](https://doi.org/10.1137/070709967)</sup> |
| 可辨识性 | 在可分性假设下，NMF可在多项式时间内求解，且解是唯一的。<sup>[5](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)</sup> |
| 规模 | 分布式GPU实现已分解了一个340 TB的稠密矩阵和一个11 EB的稀疏矩阵。<sup>[6](https://link.springer.com/article/10.1007/s11227-023-05587-4)</sup> |

## 工作原理

NMF求解 \( \min_{W \ge 0,\, H \ge 0} D(V, W \cdot H) \)，其中 D 是数据矩阵 \( V \)（\( n \times m \)）与秩为 r 的乘积 \( W \cdot H \) 之间的距离或散度；\( D \) 的选择取决于数据的噪声统计特性，并强烈影响解。<sup>[5](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)</sup> W 的列充当基部件，H 的列充当激活模式，于是一张人脸图像成为眼睛、鼻子和嘴唇之和，一篇文档成为主题的混合。<sup>[2](https://doi.org/10.1038/44565)</sup>

在使用中的大多数目标函数都是β散度族的成员：<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup>

KL散度是泊松数据（如词项-文档计数或光子计数图像）的最大似然损失。<sup>[7](https://arxiv.org/html/2607.13919v1)</sup> Itakura-Saito散度是该族中唯一的尺度不变成员，对音频频谱图很自然。<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup> 这与PCA和独立成分分析（ICA）形成对比，后者的因子取混合符号，其成分既通过加法也通过减法组合。<sup>[8](https://jmlr.org/papers/volume5/hoyer04a/hoyer04a.pdf)</sup>

## 如何实现

经典的求解器是乘法更新。对于欧几里得目标，

\[ H_{a\mu} \leftarrow H_{a\mu} \, \frac{(W^{T}V)_{a\mu}}{(W^{T}WH)_{a\mu}}, \qquad W_{ia} \leftarrow W_{ia} \, \frac{(VH^{T})_{ia}}{(WHH^{T})_{ia}} \]

而对于KL散度，

W 有对称的规则。通过类似于期望最大化算法所用的辅助函数，已证明这两种更新都不会增加各自的目标函数值，且两者都可解读为采用最优缩放的对角重缩放梯度下降。一篇综述警告说，这些更新无法修改零元素，也不保证到达驻点，<sup>[9](https://ar5iv.labs.arxiv.org/html/1401.5226)</sup> 这是对单调性证明的公开发表的异议。

其他族以每次迭代的成本换取速度。交替非负约束最小二乘（ANLS）将每个半步（固定一个因子）作为凸非负最小二乘问题求解；它收敛到驻点，但每次迭代更昂贵且更难实现。<sup>[9](https://ar5iv.labs.arxiv.org/html/1401.5226)</sup> 分层交替最小二乘（HALS）以几乎相同的每次迭代成本比乘法更新收敛快得多。<sup>[9](https://ar5iv.labs.arxiv.org/html/1401.5226)</sup> 具有收敛保证的投影梯度法和精确求解子问题的活跃集法完善了经典图景，而ADMM在合适的惩罚 ρ 下比乘法更新快几个数量级，产生精确稀疏性，尽管没有单调递减保证。<sup>[10](https://dlsun.github.io/papers/nmf_admm.pdf)</sup> 对于KL目标，KL-HALS用损失的二阶泰勒展开替代可分离优函数，并可证明收敛。<sup>[7](https://arxiv.org/html/2607.13919v1)</sup>

初始化很重要，因为问题是非凸的。随机初始化很常见，但复杂的策略大多没有理论保证。<sup>[9](https://ar5iv.labs.arxiv.org/html/1401.5226)</sup> NNDSVD（非负双奇异值分解）是一种确定性的、基于SVD的初始化器，没有随机化，能加速许多算法的早期误差下降，并适合稀疏因子。<sup>[11](https://dl.acm.org/doi/10.1016/j.patcog.2007.09.010)</sup> scikit-learn默认使用坐标下降，提供乘法更新求解器作为替代，支持Frobenius、KL和Itakura-Saito损失，并在秩不超过矩阵维度时默认用NNDSVDa初始化。<sup>[1](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html)</sup>

## 起源

这一思想可追溯到Paatero和Tapper 1994年在《Environmetrics》上发表的论文《Positive matrix factorization: A non-negative factor model with optimal utilization of error estimates of data values》，针对环境数据的因子分析；他们提出了约束交替最小二乘算法。<sup>[12](https://users.ece.utexas.edu/~bevans/courses/ee381k/projects/spring03/tropp/LitSurveyReport.pdf)</sup><sup> • </sup><sup>[13](https://doi.org/10.1002/env.3170050203)</sup> Paatero 1997年在《Chemometrics and Intelligent Laboratory Systems》上发表的论文《Least squares formulation of robust non-negative factor analysis》发展了稳健的PMF2路线。<sup>[12](https://users.ece.utexas.edu/~bevans/courses/ee381k/projects/spring03/tropp/LitSurveyReport.pdf)</sup><sup> • </sup><sup>[14](https://doi.org/10.1016/s0169-7439%2896%2900044-5)</sup> 独立于Paatero，Lee和Seung在一篇1996年关于无监督学习的论文中引入了这一概念，提出凸编码（激活非负且和为1）和锥编码（仅非负），通过交替投影梯度求解，没有收敛证明。<sup>[12](https://users.ece.utexas.edu/~bevans/courses/ee381k/projects/spring03/tropp/LitSurveyReport.pdf)</sup> 他们1999年的《自然》论文《Learning the parts of objects by non-negative matrix factorization》展示了人脸的部件和文本的语义特征，并使NMF这一名称成为标准。<sup>[2](https://doi.org/10.1038/44565)</sup><sup> • </sup><sup>[5](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)</sup> 他们2001年的算法论文提供了该领域广泛使用的乘法更新和收敛分析。

## 变体

稀疏NMF添加惩罚以使因子保持稀疏。Hoyer 2004年的公式通过投影梯度下降算法施加显式稀疏约束，其投影算子直接固定每个因子的稀疏度。<sup>[8](https://jmlr.org/papers/volume5/hoyer04a/hoyer04a.pdf)</sup> 更早的稀疏方向包括非负稀疏编码（Hoyer，2002），以及针对微阵列数据的、通过交替非负约束最小二乘求解的稀疏NMF（Kim和Park，2007）。<sup>[15](https://doi.org/10.48550/arxiv.cs/0202009)</sup><sup> • </sup><sup>[16](https://doi.org/10.1093/bioinformatics/btm134)</sup> 在音频建模中，对激活的 \( l_{1} \) 惩罚通过在乘法更新的分母中加常数 µ 来最小化。<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup>

两个结构性扩展拓宽了数据模型：Semi-NMF接受混合符号数据同时保持一个因子非负，Convex-NMF将每个基向量表示为数据点的凸组合，将因子与聚类中心联系起来。<sup>[17](https://people.eecs.berkeley.edu/~jordan/papers/ding-li-jordan.pdf)</sup> 乘法更新后来通过优函数最小化扩展到完整的β散度族（Févotte和Idier，2010）。<sup>[18](https://doi.org/10.48550/arxiv.1010.1763)</sup> 在深度学习方面，DN3MF（Dutta和De，2024）将NMF的低秩近似转化为深度神经网络。<sup>[19](https://doi.org/10.1007/s10044-024-01335-3)</sup>

## 应用

有文献记载的用途包括提取人脸的部件、识别文档中的主题、提取高光谱图像中的材料和丰度、分离音频源、检测网络中的社区、分析医学图像，以及分解基因表达微阵列。<sup>[5](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)</sup> 在文本挖掘中，NMF应用于 \( m = 30{,}991 \) 篇Grolier百科全书文章，发现了语义特征。<sup>[2](https://doi.org/10.1038/44565)</sup> 通过NMF的谱分解是[音频源分离](https://www.edgepedia.org/zh/audio-source-separation)、增强和转录中的最先进实践。<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup> Itakura-Saito变体是以音乐分析为目标应用开发的。<sup>[20](https://doi.org/10.1162/neco.2008.04-08-771)</sup> 在硬件方面，一种模拟式存内计算实现通过电阻交叉阵列电路上的ANLS子问题求解NMF，其中 \( L_{2} \) 正则化由反馈电导实现，应用于图像压缩和推荐系统。<sup>[21](https://www.nature.com/articles/s41467-026-68609-8)</sup>

## 局限与替代方案

精确NMF是NP难的。<sup>[4](https://doi.org/10.1137/070709967)</sup> 由于代价在W和H上联合非凸，一般只能找到局部极小值；初始化很重要，建议从不同起点运行。<sup>[3](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)</sup> 解至多在W的列和H的行的置换和缩放意义下唯一。<sup>[22](https://onlinelibrary.wiley.com/doi/10.1155/2008/764206)</sup> 在数据严格为正时，存在许多不同的非负分解，因此唯一性需要数据不是严格正的。<sup>[23](https://proceedings.neurips.cc/paper/2003/file/1843e35d41ccf6e63273495ba42df3c1-Paper.pdf)</sup> Donoho和Stodden的可分性条件——每个部件有一个锚数据点——使解唯一并可在多项式时间内计算。<sup>[23](https://proceedings.neurips.cc/paper/2003/file/1843e35d41ccf6e63273495ba42df3c1-Paper.pdf)</sup><sup> • </sup><sup>[24](https://ocw.mit.edu/courses/18-409-algorithmic-aspects-of-machine-learning-spring-2015/dea0e9fe9d7159276dbf66e620efb93d_MIT18_409S15_chapp2.pdf)</sup> NMF与k-means和PLSA相关联，对称或正交变体被用来获得唯一解。<sup>[5](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)</sup> 与PCA和ICA相比，NMF用一个无约束、可高效求解的问题（SVD）换取可解释性，代价是NP难性和局部极小值。<sup>[9](https://ar5iv.labs.arxiv.org/html/1401.5226)</sup>

## References

1. [NMF, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html)
2. [Daniel D. Lee, H. Sebastian Seung (1999). Learning the parts of objects by non-negative matrix factorization. Nature.](https://doi.org/10.1038/44565)
3. [NMF-based audio decomposition chapter (Févotte & Durrieu)](https://inria.hal.science/hal-01631185/file/fevotte_book18.pdf)
4. [Stephen A. Vavasis (2009). On the Complexity of Nonnegative Matrix Factorization. SIAM Journal on Optimization.](https://doi.org/10.1137/070709967)
5. [Nonnegative Matrix Factorization (Gillis, SIAM book, repository reprint)](https://orbi.umons.ac.be/bitstream/20.500.12907/42337/1/NMFbook_SIAM_reprint.pdf)
6. [Distributed out-of-memory NMF on CPU/GPU architectures (Journal of Supercomputing, 2023)](https://link.springer.com/article/10.1007/s11227-023-05587-4)
7. [An Efficient Newton Algorithm for Nonnegative Matrix Factorization with the Kullback-Leibler Divergence (KL-HALS, arXiv)](https://arxiv.org/html/2607.13919v1)
8. [Non-negative Matrix Factorization with Sparseness Constraints (Hoyer, JMLR 2004)](https://jmlr.org/papers/volume5/hoyer04a/hoyer04a.pdf)
9. [The Why and How of Nonnegative Matrix Factorization (Gillis)](https://ar5iv.labs.arxiv.org/html/1401.5226)
10. [Alternating Direction Method of Multipliers for Non-negative Matrix Factorization with the Beta-Divergence](https://dlsun.github.io/papers/nmf_admm.pdf)
11. [SVD based initialization: A head start for nonnegative matrix factorization (Pattern Recognition 41(4), 2008)](https://dl.acm.org/doi/10.1016/j.patcog.2007.09.010)
12. [Non-Negative Matrix Factorization (literature survey report, J. Tropp)](https://users.ece.utexas.edu/~bevans/courses/ee381k/projects/spring03/tropp/LitSurveyReport.pdf)
13. [Pentti Paatero, Unto Tapper (1994). Positive matrix factorization: A non‐negative factor model with optimal utilization of error estimates of data values. Environmetrics.](https://doi.org/10.1002/env.3170050203)
14. [Least squares formulation of robust non-negative factor analysis (Chemometrics and Intelligent Laboratory Systems, 1997)](https://doi.org/10.1016/s0169-7439%2896%2900044-5)
15. [Hoyer, Patrik O. (2002). Non-negative sparse coding. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.cs/0202009)
16. [Hyunsoo Kim, Haesun Park (2007). Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btm134)
17. [Convex and Semi-Nonnegative Matrix Factorizations (Ding, Li, Jordan)](https://people.eecs.berkeley.edu/~jordan/papers/ding-li-jordan.pdf)
18. [Févotte, Cédric, Idier, Jérôme (2010). Algorithms for nonnegative matrix factorization with the beta-divergence. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1010.1763)
19. [Prasun Dutta, Rajat K. De (2024). DN3MF: deep neural network for non-negative matrix factorization towards low rank approximation. Pattern Analysis and Applications.](https://doi.org/10.1007/s10044-024-01335-3)
20. [Cédric Févotte, Nancy Bertin, Jean-Louis Durrieu (2008). Nonnegative Matrix Factorization with the Itakura-Saito Divergence: With Application to Music Analysis. Neural Computation.](https://doi.org/10.1162/neco.2008.04-08-771)
21. [In-memory analog computing for non-negative matrix factorization (Nature Communications)](https://www.nature.com/articles/s41467-026-68609-8)
22. [Theorems on Positive Data: On the Uniqueness of NMF (Laurberg et al., 2008)](https://onlinelibrary.wiley.com/doi/10.1155/2008/764206)
23. [When Does Non-Negative Matrix Factorization Give a Correct Decomposition into Parts? (Donoho & Stodden, NIPS 2003)](https://proceedings.neurips.cc/paper/2003/file/1843e35d41ccf6e63273495ba42df3c1-Paper.pdf)
24. [Algorithmic Aspects of Machine Learning, Chapter 2 (MIT OCW, 2015)](https://ocw.mit.edu/courses/18-409-algorithmic-aspects-of-machine-learning-spring-2015/dea0e9fe9d7159276dbf66e620efb93d_MIT18_409S15_chapp2.pdf)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Supervised, unsupervised, and semi-supervised learning › Dimensionality reduction and manifold learning

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/nonnegative-matrix-factorization

English original: https://www.edgepedia.org/nonnegative-matrix-factorization
