# 键袋

**键袋**（Bag of bonds，BoB）是一种用于机器学习的分子特征化方法，它通过将每个原子对的库仑矩阵相互作用项分拣到称为“袋”的向量中——每个元素对对应一个袋——并将它们拼接起来，从而将分子的三维几何结构转化为固定长度的向量。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup>该方法由卡特娅·汉森及其同事于2015年提出，是库仑矩阵的一种变体，对化学等价原子索引的置换具有不变性。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup><sup> • </sup><sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup>

| 关键事实 | 详情 |
|---|---|
| 类型 | 源自库仑矩阵的全局分子描述符；每个向量元素为核电荷乘积除以核间距，\( Z_{I} Z_{J} / \|\mathbf{R}_{I} - \mathbf{R}_{J}\| \)<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup> |
| 起源 | 由汉森等人于2015年提出，受自然语言处理中“词袋”表示的启发<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup> |
| 键袋 | 条目按元素对和键级（单键、双键、三键）分组，例如C–O、C–H、C–C<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup> |
| 不变性 | 对旋转、平移和原子索引置换具有不变性<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup> |
| 已知缺陷 | 无法区分所谓的同距构型，即产生相同描述符的不同结构<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup> |
| 报告精度 | 使用拉普拉斯核时原子化能误差为1.5 kcal/mol，而使用高斯核时为4.5 kcal/mol<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC4476293/)</sup> |
| 可扩展性 | 作为全局描述符，其性能随原子数增加而下降，且难以应用于周期性体系<sup>[4](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/batt.202000262)</sup> |

## 构建方法

库仑矩阵由马蒂亚斯·鲁普及其同事提出，是一个原子对原子的方阵，其对角线元素为自由原子的近似势能，非对角线元素为原子对的库仑势。<sup>[5](https://www.nature.com/articles/s41467-020-17035-5)</sup>原始库仑矩阵会随输入原子排序的变化而变化，对于核岭回归等核方法而言——这些方法对每个向量元素一视同仁——这种不一致性是个问题。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup>

BoB通过分箱而非对行排序或取特征值来解决排序问题。构建过程分四步：<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup>

1. 将库仑矩阵的非对角线元素分拣到袋中，每种键型一个袋，其中键按所涉及的原子和键级（单键、双键、三键）区分。
2. 在每个袋内，条目按数值从大到小排序，以确保表示的唯一性。
3. 袋向量用零填充，使数据集中每个分子产生等长的袋。
4. 将所有袋向量按指定顺序拼接成最终特征向量。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)</sup><sup> • </sup><sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup>

袋的每个元素计算为 \( Z_{I} Z_{J} / \|\mathbf{R}_{I} - \mathbf{R}_{J}\| \)，其中 \( Z_{I} \) 和 \( Z_{J} \) 为核电荷，\( \mathbf{R}_{I} \)、\( \mathbf{R}_{J} \) 为两个原子的位置。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup>就底层表示而言，BoB使用与库仑矩阵相同的反距离项，但按元素对而非原子对进行排列。<sup>[6](https://www.nature.com/articles/s41524-022-00721-x)</sup>

## 性质与局限

由于袋按固定顺序排序并拼接，该表示对旋转、平移和原子索引置换具有不变性。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup>这种不变性是精确的，但变换过程中会丢失信息：不同的分子几何结构可以映射到相同的描述符，BoB尤其无法区分同距构型。<sup>[1](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)</sup><sup> • </sup><sup>[7](https://digital-chemistry-laboratory.github.io/DigitalChemistryScript/06_physics_based.html)</sup>由于它完全由排序后的二体项组成，因此也缺乏高阶角度信息。<sup>[8](https://www.researchgate.net/publication/326343207_The_fundamentals_of_quantum_machine_learning)</sup>

排序还带来与其他排序表示共有的平滑性代价。几何结构的微小变化可能交换两个条目的顺序，导致描述符出现不连续的跳跃——这是排序矩阵方法普遍存在的一个问题。<sup>[7](https://digital-chemistry-laboratory.github.io/DigitalChemistryScript/06_physics_based.html)</sup>

作为全局描述符，BoB随体系尺寸的扩展性较差。机器学习原子间势的综述指出，全局描述符要么无法在不同尺寸的体系间迁移，要么随原子数增加而性能下降，这使得它们难以应用于具有周期性边界条件的凝聚相体系。<sup>[4](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/batt.202000262)</sup>这促使了局部描述符的发展，如原子中心对称函数（ACSF）和原子位置平滑重叠（SOAP），它们描述的是每个原子周围的环境而非整个分子。<sup>[4](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/batt.202000262)</sup>

## 预测性能

在最初的分子性质基准测试中，核的选择主导了BoB的精度：拉普拉斯核在原子化能上达到1.5 kcal/mol的误差，而更局部化的高斯核在相同数据上达到4.5 kcal/mol。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC4476293/)</sup>比较表示的综述普遍报告BoB在分子性质预测上优于普通库仑矩阵；一篇比较文献称BoB通常表现出对库仑矩阵的改进，另一篇以材料为中心的综述称其为库仑矩阵的变体，在排序问题上具有更好的预测精度。<sup>[5](https://www.nature.com/articles/s41467-020-17035-5)</sup><sup> • </sup><sup>[9](https://www.sciencedirect.com/topics/engineering/material-data)</sup>

2025年一项关于溶剂化自由能预测的分子特征表示比较研究，使用495个回归器和198个神经网络模型，在MNSol数据库上测试了十种向量化方法。BoB的一种变体JustBonds表现出最佳的整体性能，在训练子集中未出现的溶质盲测数据集上均方根偏差低于2 kcal/mol，在Solv@TUM数据库记录上低于1 kcal/mol，接近当代连续介质溶剂化模型。该研究还发现，最重要的袋通常含有杂原子，在溶剂化过程中起关键作用。<sup>[10](https://www.sciencedirect.com/science/article/pii/S1093326324002018)</sup>在另一项对五种基于几何的特征化方法的基准测试中，BoB是ESOL、FreeSolv、BBBP、BACE和ClinTox数据集上与库仑矩阵、ACSF、SOAP和加权视图进行比较的方法之一，各方法的可训练参数数量保持一致，以隔离表示本身的影响。<sup>[11](https://papers.ssrn.com/sol3/Delivery.cfm/94b24a42-e531-4428-a877-1b2a1ed556f5-MECA.pdf?abstractid=7360160&mirid=1)</sup>

## 扩展及在描述符中的地位

袋化思想超越了成对距离。BAML表示（键、角、机器学习）对高阶相互作用进行袋化，将BoB从修饰原子和距离扩展到角度和二面角。<sup>[6](https://www.nature.com/articles/s41524-022-00721-x)</sup><sup> • </sup><sup>[12](https://doi.org/10.1021/ACS.CHEMREV.0C00004)</sup>BoB仍然是机器学习的分子和材料表示综述中的标准基线，与库仑矩阵、SOAP、ACSF、FCHL和MBTR并列，并且在QML软件库中与库仑矩阵一同实现。<sup>[6](https://www.nature.com/articles/s41524-022-00721-x)</sup><sup> • </sup><sup>[13](https://www.qmlcode.org/tutorial.html)</sup>其对排序二体反距离项的使用将其归入全局描述符家族：计算快速、实现简单，但与局部、体序描述符相比，在扩展到更大或周期性体系方面存在局限。<sup>[4](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/batt.202000262)</sup><sup> • </sup><sup>[6](https://www.nature.com/articles/s41524-022-00721-x)</sup>

## References

1. [Raghunathan, Priyakumar et al. (2022). Molecular representations for machine learning applications in chemistry. International Journal of Quantum Chemistry.](https://onlinelibrary.wiley.com/doi/10.1002/qua.26870)
2. [Elton, D. C. et al. (2018). Applying machine learning techniques to predict the properties of energetic materials. Scientific Reports.](https://pmc.ncbi.nlm.nih.gov/articles/PMC5998124/)
3. [Hansen, K. et al. (2015). Machine Learning Predictions of Molecular Properties: Accurate Many-Body Potentials and Nonlocality in Chemical Space. Journal of Physical Chemistry Letters.](https://pmc.ncbi.nlm.nih.gov/articles/PMC4476293/)
4. [Shao, Y. et al. (2021). Modelling Bulk Electrolytes and Electrolyte Interfaces with Atomistic Machine Learning. Batteries & Supercaps.](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/batt.202000262)
5. [Onodera, T. et al. (2020). Representation of molecular structures with persistent homology for machine learning applications in chemistry. Nature Communications.](https://www.nature.com/articles/s41467-020-17035-5)
6. [Glielmo, A. et al. (2022). Representations of molecules and materials for interpolation of quantum-mechanical simulations via machine learning. npj Computational Materials.](https://www.nature.com/articles/s41524-022-00721-x)
7. [Digital Chemistry Laboratory. Physics-Based Simulation and Representations (course notes).](https://digital-chemistry-laboratory.github.io/DigitalChemistryScript/06_physics_based.html)
8. [The fundamentals of quantum machine learning (research note).](https://www.researchgate.net/publication/326343207_The_fundamentals_of_quantum_machine_learning)
9. [Material Data - an overview (ScienceDirect Topics).](https://www.sciencedirect.com/topics/engineering/material-data)
10. [Comparative study of various molecular feature representations for solvation free energy predictions of neutral species. Journal of Molecular Graphics and Modelling, Volume 134, January 2025.](https://www.sciencedirect.com/science/article/pii/S1093326324002018)
11. [Ali, M. S. and Bano, S. (2026). Is One Molecular Representation Enough? A Comparative Study of Geometry-Based Featurization Methods. SSRN preprint.](https://papers.ssrn.com/sol3/Delivery.cfm/94b24a42-e531-4428-a877-1b2a1ed556f5-MECA.pdf?abstractid=7360160&mirid=1)
12. [Big-Data Science in Porous Materials: Materials Genomics and Machine Learning. Chemical Reviews.](https://doi.org/10.1021/ACS.CHEMREV.0C00004)
13. [QML Tutorial — QML 0.4.0 documentation.](https://www.qmlcode.org/tutorial.html)

---
*Initially written Oct 22, 2026*

Topic: 物质世界与数学 › 化学 › 化学原理与方法 › Machine learning in chemistry

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/bag-of-bonds

English original: https://www.edgepedia.org/bag-of-bonds
