ChemLogic is a neurosymbolic framework that integrates relational logic syntax with graph neural networks (GNNs) to model chemical knowledge. It is designed for interpretable molecular property prediction, combining symbolic reasoning with differentiable learning. ChemLogic was entirely built on the PyNeuraLogic framework.
ChemLogic enables binary classification for molecular property prediction tasks on chemistry datasets, such as mutagenicity and toxicity prediction. It supports explainable AI by encoding functional groups and molecular subgraph patterns into logical rules, which are then integrated into GNN architectures. The weights of these rules provide interpretable insights into the model's reasoning process.
- Supports well-known GNN architectures from the literature.
- Encodes chemical knowledge using relational logic syntax.
- Integrates functional groups and molecular subgraph patterns into a learnable knowledge base.
- Enables explainable and interpretable predictions.
- Designed for binary classification tasks with future support for regression and more.
ChemLogic is available via PyPI. You can install it using:
pip install ChemLogicThe project consists off of 3 main modules:
datasets- contain the datasets encoded in relational manner. Includes data fromTUDandTDCdatasets, as well as a converter from custom SMILES datasets.models- contains the GNN architectures.knowledge_base- contains the functional groups and subgraph patters.
Basic example of training a GNN on the MUTAG dataset can be found in notebooks/run_example.
ChemLogic requires Python 3.11 and Java >=1.8. For visualization graphviz is required.
All dependencies are listed in pyproject.toml.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines on how to get started.
This project is licensed under the MIT License.