Molecular hypergraph neural networks

Junwu Chen, Philippe Schwaller

TL;DR

Conventional Graph Neural Networks (GNNs) struggle to model molecules accurately because they only capture pairwise atom connections, missing complex multi-atom structures like conjugated systems. This paper introduces Molecular Hypergraph Neural Networks (MHNN), which use multi-node "hyperedges" to explicitly represent delocalized electron systems. MHNN achieves state-of-the-art results in predicting the optoelectronic properties of organic semiconductors using only 2D topological data, even outperforming models that rely on expensive 3D geometric coordinates.

What Problem Does This Paper Address?

In computational chemistry, molecules are traditionally represented as graphs where atoms are nodes and chemical bonds are edges. While this works well for simple, localized covalent bonds, it fails to capture the reality of quantum chemistry: delocalized electrons.

Many advanced materials, such as organic semiconductors used in solar cells and OLEDs, rely on conjugated systems—alternating single and multiple bonds where electrons are shared across many atoms simultaneously. Standard GNNs can only pass messages between pairs of directly bonded atoms, failing to capture these critical, long-range electronic environments.

Diborane and porphyrin structures showing high-order connections

As shown above in Figure 1, structures like the three-center two-electron bond in diborane (a) or the large delocalized $\pi$-system in porphyrin (b) cannot be adequately represented by simple pairwise edges. This paper tackles the challenge of representing these irregular, high-order connections without resorting to computationally expensive 3D quantum mechanics simulations.

Methods

The authors propose Molecular Hypergraph Neural Networks (MHNN). Instead of a standard graph, they represent a molecule as a hypergraph, where a single "hyperedge" can encompass an arbitrary number of atoms (nodes).

To make this computationally tractable and flexible enough to handle conjugated systems of any size, the authors implement a clever three-step workflow:

  1. Hypergraph Construction: Standard pairwise bonds are treated as 2-order hyperedges, while conjugated structures are grouped into higher-order hyperedges (e.g., a 6-order hyperedge for a benzene ring).
  2. Bipartite Transformation: The hypergraph is converted into an equivalent bipartite graph. In this architecture, atoms form one set of nodes, and the hyperedges themselves become a second set of nodes.
  3. Two-Step Message Passing:
  4. Step 1 (Vertex to Hyperedge): Atoms pass information to the hyperedges they belong to, updating the hyperedge's state.
  5. Step 2 (Hyperedge to Vertex): Hyperedges pass aggregated contextual information back to the individual atoms.
Hypergraph construction, bipartite conversion, and message passing workflow

This message-passing loop (detailed in Figure 2) allows the network to seamlessly scale and extrapolate to unseen molecular structures of any size or order.

Datasets

The model was evaluated across three major benchmarks:

  • OPV (Organic Photovoltaic) Dataset: 90,823 unique molecules and polymers. Used to evaluate 8 different optoelectronic regression tasks (such as HOMO/LUMO energy levels and bandgaps).
  • OCELOTv1: 25,251 organic $\pi$-conjugated molecules evaluated across 15 distinct molecular and reaction properties.
  • PCQM4Mv2: A massive, large-scale benchmark containing over 3.7 million graphs, used to test the model's scalability and capacity for big-data learning.

Key Insights and Ideas

  • 2D Topology Can Outperform 3D Geometry: Remarkably, MHNN outperformed SchNet—a popular GNN that utilizes explicit, DFT-optimized 3D atomic coordinates—on 7 out of 8 tasks in the OPV dataset. This proves that explicitly defining the chemical context (conjugation) in 2D can be more valuable than relying on raw 3D spatial distances.
  • Exceptional Data Efficiency: When trained on limited data (e.g., only 1,000 samples), MHNN significantly outperformed standard GNNs that had been heavily pretrained using self-supervised learning. By hardcoding the concept of delocalization into the graph structure, the model requires far fewer examples to learn the underlying physics.
  • Parameter Efficiency: Because the bipartite representation simplifies message passing, MHNN achieves superior accuracy with significantly fewer parameters than complex attention-based models.

Key Results

  • OPV Dataset: MHNN achieved a Mean Absolute Error (MAE) of 28.6 meV on the HOMO-LUMO gap ($\Delta\epsilon$), beating SchNet (32.7 meV) and standard MPNN (36.9 meV).
  • OCELOTv1 Dataset: MHNN achieved the best performance across all 15 tasks, outperforming baseline models even when those baselines were augmented with hand-crafted expert molecular descriptors (MPNN+MolDes).
  • PCQM4Mv2 Dataset: MHNN achieved a validation MAE of 0.1125 eV, outperforming GAT and GCN models while using only 2.1 million parameters (compared to GAT's 6.7 million).

Limitations and Future Work

The primary limitation acknowledged by the authors is that the definition of the hyperedges relies on predefined human domain knowledge (i.e., explicitly telling the model what constitutes a conjugated system based on chemical rules). The network does not dynamically "discover" new types of higher-order interactions on its own.

Future work includes extending this framework to automatically learn hyperedge structures from raw data and applying MHNN to other complex chemical domains, such as organometallic complexes or pharmacophore modeling for drug discovery.

Summary updated

BibTeX
@article{chen2024molecular,
  author = {Junwu Chen and Philippe Schwaller},
  title = {{Molecular hypergraph neural networks}},
  journal = {The Journal of Chemical Physics},
  year = {2024},
  doi = {10.1063/5.0193557},
}
Figure