Knowledge-Guided Graph Self-Supervised Learning for Molecular Property Predictions (ChemRxiv)
Knowledge‑Guided Graph (KGG) is a lightweight, self‑supervised pre‑training framework that injects orbital‑level chemical knowledge into Graph Neural Networks (GNNs) for molecular property prediction.
- Orbital‑aware descriptors – Hybridization‑ and bond‑type vectors embed explicit orbital information for richer chemical context.
- Data‑efficient pre‑training – Self‑supervised on ~250 k ZINC15 molecules (≈10 × less than typical), easing label scarcity and lowering contamination ratio.
- Plug‑and‑play compatibility – Works out of the box with popular GNN backbones (GIN, GCN, GAT, GraphSAGE).
- State‑of‑the‑art accuracy – Consistently surpasses existing methods across diverse molecular property benchmarks, especially with noisy data.
- Chemically interpretable embeddings – t‑SNE and fingerprint analyses show clear, domain‑aligned clustering.
To install and set up the KGG framework, follow these steps.
Creating a Virtual Environment (Optional but Recommended): It's recommended to use a virtual environment to avoid conflicts with other projects or system-wide packages. Use the following commands to create and activate a virtual environment:
# Create and activate a new Conda environment with Python 3.11
conda create -n kgg python=3.11
conda activate kgg
# Install torch and rdkit packages
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
conda install -c conda-forge rdkit
# Install PyTorch Geometric and dependencies
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu118.html
pip install torch_geometric
# Install utility libraries
pip3 install -U scikit-learn
pip install joblib pytest blackconda env create -f environment.yml- Pre-training data:
Data/pretrain_datasets/ - Fine-tuning datasets:
- Classification tasks:
Data/classification/ - Regression tasks:
Data/regression/
- Classification tasks:
- Download pretrained ZINC15 models and pretrained ChEMBL29 models
- After downloading, place the pretrained model files in the following directory:
./pretrained_model_zinc15/or./pretrained_model_chembl29/
To begin pre-training, modify the arguments in pretrain.py as needed for your experiment, then run:
python pretrain.pyTo begin fine-tuning, modify the arguments in finetune.py as needed for your experiment, then run:
python finetune.pyTo begin analyzing, modify the arguments in fgs.py or knn.py or tsne.py as needed for your experiment, then run:
- Comparison with fingerprints
python Docs/scripts/fgs.py- knn model
python Docs/scripts/knn.py- tsne visualization
python Docs/scripts/tsne.pyKGG: Knowledge-Guided Graph Self-Supervised Learning to Enhance Molecular Property Predictions
@article{to2025kgg,
title={KGG: Knowledge-Guided Graph Self-Supervised Learning to Enhance Molecular Property Predictions},
author={To, Van-Thinh and Van-Nguyen, Phuoc-Chung and Truong, Gia-Bao and Phan, Tuyet-Minh and Phan, Tieu-Long and Fagerberg, Rolf and Stadler, Peter and Truong, Tuyen},
year={2025}
}
This project is licensed under MIT License - see the License file for details.
This work has received support from the Korea International Cooperation Agency (KOICA) under the project entitled “Education and Research Capacity Building Project at University of Medicine and Pharmacy at Ho Chi Minh City”, conducted from 2024 to 2025 (Project No. 2021-00020-3).