DLGNet: Hyperedge Classification through Directed Line Graphs for Chemical Reactions

Stefano Fiorini, Giulia M. Bovolenta, Stefano Coniglio, Michele Ciavotta, Pietro Morerio, Michele Parrinello, Alessio Del BueSubmission to ICLR 2025 · Rejected

TL;DR

The authors introduce DLGNet, a spectral graph neural network designed to classify chemical reactions by modeling them as directed hyperedges. By converting directed hypergraphs into Directed Line Graphs (DLG) governed by a novel complex-valued, Hermitian Laplacian matrix, DLGNet performs spectral convolutions directly on reaction-level features to significantly outperform existing methods.

What Problem Does This Paper Address?

Chemical reactions frequently involve multiple reactants and multiple products, where reactants transform into products along a strictly directed pathway. Standard graphs fail to capture the multi-entity (polyadic) nature of these reactions, while undirected hypergraphs lose the critical distinction between reactants and products.

Although directed hypergraphs can theoretically model multi-molecule directed transformations, current machine learning approaches for them rely on spatial heuristics or node-level message passing. This paper tackles the task of reaction type classification by reframing hyperedge classification as a node classification problem on a directed line graph, allowing neural networks to convolve directly over reaction entities.

Methods

  • Directed Line Graph (DLG): For a directed hypergraph $\vec{H}$, its directed line graph $\text{DLG}(\vec{H})$ turns each hyperedge (reaction) into a node. Two reaction-nodes are connected if they share molecules.
  • Complex Incidence Matrix: Direction is captured via a complex-valued incidence matrix $\vec{B}$, where an entry is $1$ if a molecule is in the head (reactant set) and $-i$ if it is in the tail (product set).
  • Directed Line Graph Laplacian ($\vec{L}_N$): Built from $\vec{B}$, $\vec{L}_N$ is a Hermitian matrix with a symmetric real part and a skew-symmetric imaginary part. The imaginary components capture the net directional flow between overlapping reactions. The authors prove that $\vec{L}_N$ is positive semidefinite and bounded ($\lambda_{\max} \le 1$), enabling well-defined spectral graph filtering.
  • DLGNet Architecture:
  • Node features (Morgan Fingerprints) are projected to the line graph via $X = \vec{B}^* X'$.
  • Features pass through localized spectral convolutional layers: $$Z(X) = \phi(I X \Theta_0 + \vec{L}_N X \Theta_1)$$ using a complex ReLU activation function and skip connections.

  • The resulting complex representations are unwound by concatenating real and imaginary parts before being classified by dense layers.

Datasets

The authors evaluated DLGNet on three benchmark datasets:

  1. Dataset-1 (USPTO): A cleaned subset of 50,000 single-product, atom-mapped reactions across 10 classes from US patent data.
  2. Dataset-2 (Multi-source): A newly curated dataset of 5,300 reactions spanning 3 major reaction classes, featuring diverse reaction conditions (catalysts and solvents).
  3. Dataset-3 (Compete E2/$S_N2$): A specialized dataset of 649 multi-product reactions (double-product nucleophilic substitutions and triple-product eliminations) derived from von Rudorff et al. (2020).

Key Insights and Ideas

  • Spectral Convolutions on Hyperedges: Standard hypergraph neural networks convolve node features and aggregate them to edges. Converting the hypergraph to its line graph allows spectral convolutions to operate directly in hyperedge space.
  • Complex Arithmetic for Asymmetry: Using imaginary units ($i$ and $-i$) encodes directed relationships without losing the algebraic benefits of Hermitian symmetry, guaranteeing real eigenvalues and a well-defined Fourier transform.
  • Directionality is Essential: Undirected models fail dramatically on reaction classification (achieving under 10% F1 on USPTO), demonstrating that modeling reactant-to-product flow is fundamental for chemistry tasks.

Key Results

DLGNet consistently outperformed 13 baseline methods (both undirected and directed hypergraph models):

  • Quantitative Gains: Achieved an average relative percentage difference (RPD) improvement of 3.27% over the second-best model (DHRL).
  • Dataset-1: 60.55% F1-score (vs. DHRL’s 58.15% and undirected models’ $<10\%$).
  • Dataset-2: 83.67% F1-score (vs. DHRL’s 79.36%, a 5.28% RPD gain).
  • Dataset-3: 99.75% F1-score (vs. DHRL’s 99.27%).
  • Ablation Studies: Removing directionality dropped performance on Dataset-1 from 60.55% down to 52.07%, confirming the necessity of the complex directed Laplacian.
  • Qualitative Analysis: Error analysis revealed that misclassifications primarily occur between reactions sharing substantial molecular scaffold geometry and identical substituent transformations (e.g., distinguishing specific heterocyclic ring formations from arylations).

Limitations and Future Work

  • Computational Complexity: DLGNet incurs an $O(\ell m^2 \bar{c})$ complexity where $m$ is the number of hyperedges, which scales quadratically with the number of reactions in a dense line graph.
  • Scaffold Confusion: The model struggles to differentiate reaction classes that share identical backbone subgraphs and undergo similar local atomic changes.
  • Future Directions: The authors aim to scale the architecture and extend the directed line graph framework beyond classification to multi-step retrosynthetic pathway planning and automated reaction discovery.

Summary updated

Abstract

Graphs and hypergraphs provide powerful abstractions for modeling interactions among a set of entities of interest and have been attracting a growing interest in the literature thanks to many successful applications in several fields. In particular, they are rapidly expanding in domains such as chemistry and biology, especially in the areas of drug discovery and molecule generation. One of the areas witnessing the fasted growth is the chemical reactions field, where chemical reactions can be naturally encoded as directed hyperedges of a hypergraph. In this paper, we address the chemical reaction classification problem by introducing the notation of a Directed Line Graph (DGL) associated with a given directed hypergraph. On top of it, we build the Directed Line Graph Network (DLGNet), the first spectral-based Graph Neural Network (GNN) expressly designed to operate on a hypergraph via its DLG transformation. The foundation of DLGNet is a novel Hermitian matrix, the Directed Line Graph Laplacian $\mathbb{\vec L}_N$, which compactly encodes the directionality of the interactions taking place within the directed hyperedges of the hypergraph thanks to the DLG representation. $\mathbb{\vec L}_N$ enjoys many desirable properties, including admitting an eigenvalue decomposition and being positive semidefinite, which make it well-suited for its adoption within a spectral-based GNN. Through extensive experiments on chemical reaction datasets, we show that DGLNet significantly outperforms the existing approaches, achieving on a collection of real-world datasets an average relative-percentage-difference improvement of 3.27\%, with a maximum improvement of 5.28\%.
BibTeX
@misc{fiorini2024dlgnet,
  author = {Stefano Fiorini and Giulia M. Bovolenta and Stefano Coniglio and Michele Ciavotta and Pietro Morerio and Michele Parrinello and Alessio Del Bue},
  title = {{DLGNet: Hyperedge Classification through Directed Line Graphs for Chemical Reactions}},
  year = {2024},
  eprint = {2410.06969},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.06969},
}

Loading related content...

Figure