Abstract
Designing a network to learn a molecule structure given its physical/chemical properties is a hard problem, but is useful for drug discovery tasks. In this paper, we incorporate higher-order relational learning of Factor Graphs with strong approximation power of Neural Networks to create a molecule-structure learning network that has strong generalization power and can enforce higher-order relationship and valence constraints. We further propose methods to tackle problems such as the efficient design of factor nodes, conditional parameter sharing among factors, and symmetry problems in molecule structure prediction. Our experiment evaluation shows that the factor learning is effective and outperforms related methods.
Introduction
Identifying the structure of a molecule, known as structure elucidation, is a cornerstone of modern chemistry and drug discovery. Mass spectrometry (MS) is the primary tool for this task, breaking molecules into fragments to measure their mass-to-charge ratios. However, reconstructing a complex molecular structure from these fragments is an inverse problem with an astronomical search space. While standard Deep Learning models like Graph Neural Networks (GNNs) excel at local pattern recognition, they often fail to enforce "hard" chemical rules, such as valence constraints (e.g., a Carbon atom must form exactly four bonds). This research introduces the Molecule Factor Graph Network (MFGN) to bridge the gap between probabilistic logic and deep learning.
Methodology
The MFGN architecture utilizes a Factor Graph to represent the complex dependencies within a molecular structure. Unlike standard neural networks, this approach allows for the explicit embedding of chemical constraints.
Specialized Factor Types
The model employs three distinct factor types to manage information flow and constraints:
- Type C (MSP-Atom): Connects mass spectrum peak nodes to atom nodes, allowing the model to associate specific spectral evidence with potential molecular fragments.
- Type B (Edge-Atom): Manages the fundamental relationship between potential bonds (edges) and the atoms they connect.
- Type A (Valence Factor): Acts as a chemical "enforcer." By utilizing a dynamic programming algorithm inspired by error-correcting codes, this factor ensures that the sum of bonds around any given atom strictly adheres to its chemical valence.
Neuralized Belief Propagation and Symmetry
The authors adapted "Low Rank Belief Propagation" to allow the factor graph to be trained end-to-end. To address the isomorphism problem—where the same molecule can be represented by multiple adjacency matrices—the model employs SMILES canonical ordering to ensure consistent structure representation during training.
Experimental Results
The model was evaluated using the NIST database, specifically focusing on a dataset of approximately 1,800 ester molecules (containing C, H, and O atoms). The MFGN was compared against several baselines, including Message Passing Neural Networks (MMPNN) and Molecule Attention Structure Elucidation (MASE).
As shown in the performance data, the FGMN-Medium variant achieved a test accuracy of 91.4%, significantly outperforming the best Transformer-based baseline (MASE) by 2.6%. Ablation studies confirmed that the Valence Factor (Type A) was critical; its removal led to a sharp increase in chemically "illegal" structures. Furthermore, the model demonstrated high resilience to synthetic noise, with the inference algorithm effectively correcting errors to reconstruct original structures.
Conclusion and Future Work
The Factor Graph Molecule Network demonstrates that embedding hard chemical constraints directly into a neural architecture significantly improves structure elucidation accuracy. While currently limited to esters, future work aims to expand the model to include Nitrogen, Sulfur, and Halogens. Additionally, the authors suggest that integrating Reinforcement Learning could help build molecules edge-by-edge, potentially resolving remaining challenges related to structural symmetry.
Summary updated