# 学习向量量化

学习向量量化（LVQ）是一种有监督的、基于原型的分类算法，它学习一组带标签的码本向量，并为每个新输入赋予最近原型的标签。由于分类仅需在一组固定（通常较小）的原型中进行最近邻搜索，决策计算非常快速，且原型以分段线性曲面逼近近最优的贝叶斯决策边界。<sup>[1](https://doi.org/10.1109/5.58325)</sup><sup> • </sup><sup>[2](https://doi.org/10.1109/ijcnn.1990.137622)</sup> 该方法源自科霍宁的自组织映射，当该映射用作模式分类器时，LVQ 被设计为其有监督微调阶段。<sup>[1](https://doi.org/10.1109/5.58325)</sup>

| 关键事实 | 内容 |
|---|---|
| 模型输出 | 用户选定数量的带标签码本（原型）向量；分类是在它们所定义的沃罗诺伊单元上胜者为王<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup><sup> • </sup><sup>[4](https://jmlr.org/papers/volume22/21-0029/21-0029.pdf)</sup> |
| 核心更新 | 当标签匹配时最近原型向输入移动，不匹配时远离，按学习率缩放<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup> |
| 推荐训练 | 以 OLVQ1 为主算法；渐近精度在学习步数达到码本向量总数的约 30 至 50 倍后达到<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup> |
| 停止规则 | 在学习步数达到码本向量数量的约 50 至 200 倍后停止，以避免过度学习<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup> |
| 分类成本 | 取决于固定数量的原型，不同于 SVM 的成本取决于训练集大小<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> |
| 文献规模 | 截至 2013 年 11 月，标题或摘要中含“Learning Vector Quantization”或“LVQ”的期刊论文有 665 篇<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> |

## 工作原理

LVQ 模型用输入空间中的一个或多个原型向量表示每个类别。新样本通过计算其与所有原型的距离并赋予最近者（最佳匹配单元）的标签来分类。<sup>[4](https://jmlr.org/papers/volume22/21-0029/21-0029.pdf)</sup> 训练调整原型位置，使这些最近原型决策能够重现训练标签；原型将空间划分为沃罗诺伊区域，其边界构成分类器。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup>

基本 LVQ1 规则将最近原型（此处记为 \( m_{c} \)）沿所呈现输入 \( x(t) \) 的方向按学习率 \( \alpha(t) \) 移动：<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>

\[ m_{c}(t+1) = m_{c}(t) + \alpha(t)\,[x(t) - m_{c}(t)] \quad \text{若标签一致，} \]
\[ m_{c}(t+1) = m_{c}(t) - \alpha(t)\,[x(t) - m_{c}(t)] \quad \text{若标签不同。} \]

经典启发式变体共享这种吸引-排斥形式 \( \mu_{j} \leftarrow \mu_{j} \pm \alpha_{t}(x_{t} - \mu_{j}) \)，当原型标签与样本一致时符号为正，否则为负；而基于代价函数和概率的变体（如 GLVQ 和 RSLVQ）则从目标梯度或软分配中推导更新。<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2002/file/bbaa9d6a1445eac881750bea6053f564-Paper.pdf)</sup> 其动机是统计性的：当类条件数据密度为高斯混合时，LVQ 可视为[贝叶斯分类器](https://www.edgepedia.org/zh/bayes-classifier)的近似，原型代表混合成分。<sup>[7](https://doi.org/10.1017/s1743921316012928)</sup> 理论分析支持这一点：在两原型高斯混合模型中，LVQ1 表现出接近最优的泛化性能，且其简单规则对所有先验类分布选择都能产生近最优泛化误差。<sup>[8](https://jmlr.org/papers/volume8/biehl07a/biehl07a.pdf)</sup><sup> • </sup><sup>[9](https://www.esann.org/sites/default/files/proceedings/legacy/es2005-82.pdf)</sup> 一个需要注意的解释性问题：LVQ1 不能解释为随机梯度下降，因为胜者为王调制在类边界处不连续变化，这与基于代价函数的 GLVQ 不同。<sup>[10](https://www.cs.rug.nl/~biehl/Preprints/2013-Cetraro-distances.pdf)</sup>

## 实施方法

方法创始人的 LVQ_PAK 文档中给出的实用训练流程如下。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>

1. 选择每类的码本向量数量并初始化其位置（例如随机、类均值处或通过聚类方法）。<sup>[11](https://dergipark.org.tr/en/pub/ejosat/article/1222296)</sup>
2. 运行优化学习率的 LVQ1（OLVQ1），文档推荐其为主学习算法；其渐近识别精度在学习步数约为码本向量总数 30 至 50 倍后达到。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>
3. 可选地以低学习率继续 LVQ1、LVQ2.1 或 LVQ3 作为微调阶段；LVQ2.1 和 LVQ3 变体使用窗口参数，将更新限制在类边界附近的样本上。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>
4. 在学习步数达到码本向量总数的约 50 至 200 倍后停止；继续学习时，随着模型过度学习，精度会缓慢下降。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>

原型数量是真正的设计选择，而非可最大化的自由参数。间隔分析表明 [VC 维](https://www.edgepedia.org/zh/vc-dimension)随原型数量增长，因此使用过多原型可能导致性能不佳，且存在非平凡最优值。<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2002/file/bbaa9d6a1445eac881750bea6053f564-Paper.pdf)</sup> 经验上，在心脏病、皮马糖尿病和乳腺癌基准上每类一个原型为最优，而声纳数据集需要 3 个原型，精度提高 10%。<sup>[12](https://is.umk.pl/~duch/pubs/10-Weighted-LVQ.pdf)</sup> 输入特征的[归一化](https://www.edgepedia.org/zh/normalization)也很重要；比较研究在不同初始化方案下评估了 z-score 和线性缩放下的 LVQ 变体。<sup>[11](https://dergipark.org.tr/en/pub/ejosat/article/1222296)</sup>

## 起源

谱系始于自组织映射，由特沃·科霍宁于 1982 年在《生物控制论》上提出，作为形成拓扑正确特征映射的一维或二维单元阵列。<sup>[13](https://doi.org/10.1007/bf00337288)</sup> 在其 1990 年《IEEE 会刊》关于自组织映射的论述中，科霍宁指出 LVQ 策略和学习算法由他本人提出并称为学习向量量化，作为 SOM 用作模式分类器时的有监督微调方法。<sup>[1](https://doi.org/10.1109/5.58325)</sup> 科霍宁 1990 年的论文《学习向量量化的改进版本》随后提出了 LVQ2.1 并讨论了实际应用问题，这些算法通过类码本向量的最优放置来逼近贝叶斯决策边界。<sup>[2](https://doi.org/10.1109/ijcnn.1990.137622)</sup> 综述将后续改进 LVQ2.1、LVQ3 和 OLVQ 归功于科霍宁（1990），旨在提高收敛速度或更好地逼近贝叶斯边界。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup>

## 变体

经典系列实现赫布式启发式更新：<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup>

- **LVQ2.1** 更新最近的两个原型，一个正确类原型向输入移动，一个错误类原型远离输入，但仅当输入落在类边界附近的窗口内时。以距离比形式，当两个原型中恰好一个带有样本标签且 \( 1/s \le \lVert x_{t} - \mu_{i} \rVert\, /\, \lVert x_{t} - \mu_{j} \rVert \le s \) 时触发更新，其中 \( s \) 为窗口大小。<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2002/file/bbaa9d6a1445eac881750bea6053f564-Paper.pdf)</sup>
- **LVQ3** 在输入和两个原型共享同一类时，为 \( k \in \{i,j\} \) 添加稳定项 \( m_{k}(t+1) = m_{k}(t) + \epsilon\,\alpha(t)\,[x(t) - m_{k}(t)] \)；实验发现适用的 \( \epsilon \) 值在 0.1 到 0.5 之间，窗口越窄最优值越小。这纠正了 LVQ2 的收敛问题，即原型位置在持续学习过程中不断漂移。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup><sup> • </sup><sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup>
- **OLVQ1** 修改 LVQ1 的学习率调度以实现快速收敛，是推荐的主算法。<sup>[5](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)</sup>

基于代价函数的变体用显式目标替代启发式。**GLVQ**（广义 LVQ）由佐藤敦和山田圭二于 1995 年在 NeurIPS 会议论文集中提出；它定义了一个代价函数，学习规则由最速下降法导出。<sup>[14](https://proceedings.neurips.cc/paper_files/paper/1995/file/9c3b1830513cc3b8fc4b76635d32e692-Paper.pdf)</sup> **RSLVQ**（稳健软 LVQ）在每类[高斯混合模型](https://www.edgepedia.org/zh/gaussian-mixture-model)下通过梯度上升最大化统计目标。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> **GMLVQ** 及其局部化版本 **LGMLVQ** 由佩特拉·施奈德、米夏埃尔·比尔和芭芭拉·哈默于 2009 年在《神经计算》上提出；它们在训练过程中调整完整的相关性矩阵，即学习到的度量。<sup>[15](https://doi.org/10.1162/neco.2009.11-08-908)</sup> 在每类一个原型的基准中，GMLVQ 和 GRLVQ 等相关性学习变体比固定欧几里得度量的方法取得了更好的性能。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> 开源 Python 包 sklvq 围绕共享的 GLVQ 目标实现了 GLVQ、GMLVQ、LGMLVQ 和 NaNLVQ，激活、判别和距离函数均可替换。<sup>[4](https://jmlr.org/papers/volume22/21-0029/21-0029.pdf)</sup>

## 应用

科霍宁最初提出的 LVQ 应用于医学图像和数据分析，包括蛋白质组学、卫星光谱数据分类、技术过程中的故障检测和语言识别。<sup>[16](https://www.sciencedirect.com/science/article/abs/pii/S0925231205003218)</sup> [语音识别](https://www.edgepedia.org/zh/speech-recognition)是早期的展示案例：在独立测试数据上，LVQ 变体优于参数贝叶斯和 kNN 参考方法。<sup>[17](http://graphics.stanford.edu/courses/cs233-21-spring/ReferencedPapers/SOM.pdf)</sup> 在使用 LBP 特征的[面部表情识别](https://www.edgepedia.org/zh/facial-expression-recognition)中，RSLVQ 达到 92.2 ± 2.0% 的准确率，而线性核 SVM 为 90.9 ± 5.6%。<sup>[18](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol09081/DagSemProc.09081.4/DagSemProc.09081.4.pdf)</sup> 另一个实际吸引力在于部署：固定数量的原型使 LVQ 模型具有预定的复杂度，这对资源受限的工业系统（如智能传感器系统和高级驾驶辅助系统）很有吸引力。<sup>[19](https://yadda.icm.edu.pl/baztech/element/bwmeta1.element.baztech-bde5618e-42ff-4698-b734-634ad3a97f83/c/villman_Can_learning_vector.pdf)</sup>

## 局限与替代方案

启发式规则带有已知的失效模式。原始 LVQ 规则表现出对初始化的敏感性、收敛缓慢和不稳定性；LVQ1 需要良好的网络初始状态，对重叠数据集敏感，且其中一些神经元永远学不到训练模式。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> LVQ2.1 的无窗口极限 LVQ+/- 在先验权重不等的类别上发散：较弱类的原型被较强类反复排斥，尽管早停可缓解发散。<sup>[20](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol07131/DagSemProc.07131.5/DagSemProc.07131.5.pdf)</sup><sup> • </sup><sup>[8](https://jmlr.org/papers/volume8/biehl07a/biehl07a.pdf)</sup> 一种混合策略——运行 LVQ1 至其渐近配置，然后切换到带早停的 LVQ+/-——只能改善或匹配 LVQ1 的性能。<sup>[20](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol07131/DagSemProc.07131.5/DagSemProc.07131.5.pdf)</sup>

已发表的比较对 LVQ2.1 本身存在分歧。科霍宁 1990 年的论文报告其在学习稳定性上优于其他算法，<sup>[2](https://doi.org/10.1109/ijcnn.1990.137622)</sup> 而后来的基准发现其性能劣于所有其他测试算法，将其归因于缺乏关联泛函和对原型初始化的高敏感性；在面部表情识别中它达到 83.2% 但存在稳定性问题。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup><sup> • </sup><sup>[18](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol09081/DagSemProc.09081.4/DagSemProc.09081.4.pdf)</sup>

与替代方案相比，LVQ 的特点是速度和可解释性，而非单纯的准确率。原型是其类别的典型向量，不同于支持向量是极端值，且 LVQ 的分类成本取决于固定原型数量而 SVM 成本取决于训练集大小。<sup>[3](https://ar5iv.labs.arxiv.org/html/1509.07093)</sup> 原型分类器的基于间隔的[泛化界](https://www.edgepedia.org/zh/generalization-bound)与维度无关，与 SVM 界相当。<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2002/file/bbaa9d6a1445eac881750bea6053f564-Paper.pdf)</sup> 在一项涵盖 UCI、前列腺癌和光谱数据的度量比较研究中，最佳结果来自回归模型 RPDML 和带缩放欧几里得度量的相关性学习分类器 SRNG，表明即使对简单向量数据，问题自适应度量也优于普通欧几里得度量。<sup>[21](https://www.sciencedirect.com/science/article/abs/pii/S0893608005002248)</sup> 原型生成混合方法也存在：HYB 方法用 SVM 选择初始原型，然后运行 LVQ3 优化阶段。<sup>[22](https://sci2s.ugr.es/sites/default/files/files/TematicWebSites/pr/PG-TechReport.pdf)</sup> 在正则化方面，GLVQ 被视为原始 LVQ 最强大的基于代价函数的实现，<sup>[23](https://reference-global.com/article/10.1515/jaiscr-2017-0005)</sup> 而矩阵相关性学习提供了内在正则化器：相关性矩阵在训练中趋于变得奇异且秩很低，限制了距离复杂度并防止过拟合。<sup>[10](https://www.cs.rug.nl/~biehl/Preprints/2013-Cetraro-distances.pdf)</sup>

## References

1. [T. Kohonen (1990). The self-organizing map. Proceedings of the IEEE.](https://doi.org/10.1109/5.58325)
2. [Improved versions of learning vector quantization (Kohonen, 1990)](https://doi.org/10.1109/ijcnn.1990.137622)
3. [A Review of Learning Vector Quantization Classifiers (Nova & Estévez)](https://ar5iv.labs.arxiv.org/html/1509.07093)
4. [sklvq: Scikit Learning Vector Quantization (JMLR 2021, software paper)](https://jmlr.org/papers/volume22/21-0029/21-0029.pdf)
5. [LVQ_PAK documentation (Kohonen et al., Helsinki University of Technology)](http://cis.legacy.ics.tkk.fi/research/lvq_pak/lvq_doc.txt)
6. [Margin Analysis of the LVQ Algorithm (Crammer, Gilad-Bachrach, Navot, Tishby, NeurIPS 2002)](https://proceedings.neurips.cc/paper_files/paper/2002/file/bbaa9d6a1445eac881750bea6053f564-Paper.pdf)
7. [Prototype-based Models for the Supervised Learning of Classification Schemes (Biehl et al.)](https://doi.org/10.1017/s1743921316012928)
8. [Dynamics and Generalization Ability of LVQ Algorithms (Biehl, Ghosh, Hammer, JMLR 2007)](https://jmlr.org/papers/volume8/biehl07a/biehl07a.pdf)
9. [The dynamics of Learning Vector Quantization (ESANN 2005)](https://www.esann.org/sites/default/files/proceedings/legacy/es2005-82.pdf)
10. [Learning Vector Quantization: distances lecture notes (Biehl, 2013 Cetraro)](https://www.cs.rug.nl/~biehl/Preprints/2013-Cetraro-distances.pdf)
11. [Examining Variants of Learning Vector Quantizations According to Normalization and Initialization of Vector Positions (EJOSAT, 2022)](https://dergipark.org.tr/en/pub/ejosat/article/1222296)
12. [Improving accuracy of LVQ algorithm by instance weighting](https://is.umk.pl/~duch/pubs/10-Weighted-LVQ.pdf)
13. [Teuvo Kohonen (1982). Self-organized formation of topologically correct feature maps. Biological Cybernetics.](https://doi.org/10.1007/bf00337288)
14. [Generalized Learning Vector Quantization (NeurIPS 1995)](https://proceedings.neurips.cc/paper_files/paper/1995/file/9c3b1830513cc3b8fc4b76635d32e692-Paper.pdf)
15. [Petra Schneider, Michael Biehl, Barbara Hammer (2009). Adaptive Relevance Matrices in Learning Vector Quantization. Neural Computation.](https://doi.org/10.1162/neco.2009.11-08-908)
16. [Learning vector quantization: The dynamics of winner-takes-all algorithms (Neurocomputing)](https://www.sciencedirect.com/science/article/abs/pii/S0925231205003218)
17. [The self-organizing map (Kohonen)](http://graphics.stanford.edu/courses/cs233-21-spring/ReferencedPapers/SOM.pdf)
18. [Analysis of Robust Soft Learning Vector Quantization and an application to Facial Expression Recognition (Dagstuhl)](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol09081/DagSemProc.09081.4/DagSemProc.09081.4.pdf)
19. [Can learning vector quantization be an alternative to SVM and deep learning?, Recent trends and advanced variants of LVQ for classification learning (Villmann et al.)](https://yadda.icm.edu.pl/baztech/element/bwmeta1.element.baztech-bde5618e-42ff-4698-b734-634ad3a97f83/c/villman_Can_learning_vector.pdf)
20. [Learning Vector Quantization: generalization ability and dynamics of competing prototypes (Dagstuhl 2007)](https://drops.dagstuhl.de/storage/16dagstuhl-seminar-proceedings/dsp-vol07131/DagSemProc.07131.5/DagSemProc.07131.5.pdf)
21. [Comparison of relevance learning vector quantization with other metric adaptive classification methods (Hammer, Strickert, Villmann, Neural Networks 2005)](https://www.sciencedirect.com/science/article/abs/pii/S0893608005002248)
22. [Prototype Generation for Nearest Neighbor Classification: Survey of Methods (Univ. of Granada)](https://sci2s.ugr.es/sites/default/files/files/TematicWebSites/pr/PG-TechReport.pdf)
23. [Can Learning Vector Quantization be an Alternative to SVM... (review)](https://reference-global.com/article/10.1515/jaiscr-2017-0005)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/learning-vector-quantization

English original: https://www.edgepedia.org/learning-vector-quantization
