--- language: en tags: - graph-neural-network - molecular-property-prediction - quantum-chemistry - cheminformatics - pytorch - SMILES - attention-mechanism - GNN license: mit library_name: pytorch datasets: - QuantumChem/QuantumChem_200k metrics: - mae - r2 --- # MSGAT: Multi-Scale Graph Attention Network A lightweight graph neural network (**242K parameters**) for predicting 10 quantum-chemical properties from molecular SMILES strings. ## Model Details - **Architecture**: Edge-aware multi-head attention + MPNN + cross-scale fusion - **Parameters**: 242,407 - **Hidden dim**: 64, 4 attention heads, 3 layers - **Node features**: 58-dim (atomic number, degree, charge, Hs, hybridization, aromaticity) - **Bond features**: 12-dim (bond type, conjugation, ring, stereo) - **Training data**: [QuantumChem/QuantumChem_200k](https://huggingface.co/datasets/QuantumChem/QuantumChem_200k) ## Properties Predicted | Property | Unit | MAE | R² | |---|---|---|---| | Sigma at 780 nm | GM | 10.10 | 0.953 | | Max sigma | GM | 10.19 | 0.957 | | ISC energy | eV | 0.0055 | 0.933 | | Toxicity score | — | 0.017 | 0.924 | | SA score | — | 0.0069 | 0.967 | | Boiling point | °C | 5.77 | 0.984 | | logP | — | 0.057 | 0.993 | | Aromaticity | — | 0.0077 | 0.998 | | Solubility | ug/ml | 71,953 | 0.053 | | Molecular weight | g/mol | 1.61 | 0.806 | Mean R² across 9/10 properties (excl. solubility): **0.946** ## Usage ```python import torch import torch.nn as nn # Load the model model_state = torch.load("msgat_model.pt", weights_index=None) norm_stats = torch.load("norm_stats.pt") # Reconstruct model architecture (see model.py in the repo) from model import create_model # clone https://github.com/devansh0703/MSGAT model = create_model() model.load_state_dict(model_state) model.eval() # mean/std for inverse transform (shape: [10]) mean = norm_stats["mean"] std = norm_stats["std"] ``` ### Inverse normalization The model outputs z-score normalized predictions. To get raw values: ```python # solubility uses log1p before normalization — must invert with expm1 raw = preds * std + mean sol_idx = 8 # solubility index in active props raw[:, sol_idx] = torch.expm1(raw[:, sol_idx]) ``` ## Files | File | Description | |---|---| | `msgat_model.pt` | Trained model state dict (242K params) | | `norm_stats.pt` | Z-score normalization stats (mean, std) for the 10 active properties | ## Training ```bash git clone https://github.com/devansh0703/MSGAT cd MSGAT pip install torch rdkit-pypi datasets pandas tqdm matplotlib python train.py # train/val split python train_final.py # full data retrain ``` ## Citation ```bibtex @article{raulo2025msgat, title={MSGAT: Multi-Scale Graph Attention Network for Efficient Molecular Property Prediction}, author={Raulo, Devansh}, year={2025} } ``` ## Acknowledgements Dataset: [QuantumChem/QuantumChem_200k](https://huggingface.co/datasets/QuantumChem/QuantumChem_200k) by Zeng et al.