Fragment-Level Graph Encoding for Interpretable Molecular Property Prediction
Organizations: School of Pharmacy, University of Eastern Finland, Kuopio, Finland
Abstract
Graph neural networks (GNNs) are among the standard tools for molecular property prediction, but the atom-level explanations of their predictions are hard for medicinal chemists to act on. We propose a change of input representation rather than a new model: molecules are encoded as fragment-level graphs from BRICS decomposition, where each node is a synthetically meaningful fragment whose features are the element-wise sum of its atoms' features. Because only the representation changes, any message-passing GNN and any post-hoc attribution method produces explanations at the resolution of functional groups instead of single atoms. Across four architectures, four prediction tasks, and two explainers under scaffold splits, fragment-level encoding matches atom-level test accuracy on roughly five-fold smaller graphs. Integrated-Gradients attributions recover known pharmacophores above chance on two enzyme targets, namely BACE at 1.5 times the chance rate, and PTR1 at 3.2 times. A like-for-like comparison against an aggregated atom-level baseline shows that post-hoc aggregation is not a stable substitute: its BACE hit rate range both exceeds and falls below the fragment model's hit rate depending on two arbitrary aggregation choices, whereas fragment-level training yields a single convention-free attribution at no predictive cost. The code is available at: https://github.com/4D-Lab/frame
Figures & tables
| Dataset | Task | Scaf. | Label | |
|---|---|---|---|---|
| BACE (cls) | cls | 1512 | 649 | 690/1512 pos (46%) |
| BACE (reg) | reg | 1512 | 649 | 2.54–10.52 ( =6.52) |
| BBBP | cls | 1965 | 1020 | 1495/1965 pos (76%) |
| PTR1 | reg | 250 | 119 | 3.19–10.00 ( =5.61) |
| BACE (cls) | BBBP | |||
|---|---|---|---|---|
| Backbone | MCC a | MCC f | MCC a | MCC f |
| AttentiveFP | 0.530 | 0.565 | 0.291 | 0.186 |
| GATv2 | 0.439 | 0.552 | 0.140 | 0.176 |
| GIN | 0.385 | 0.476 | 0.163 | 0.183 |
| PNA | 0.453 | 0.587 | 0.175 | 0.151 |
| BACE (reg) | PTR1 | |||
|---|---|---|---|---|
| Backbone | CCC a | CCC f | CCC a | CCC f |
| AttentiveFP | 0.846 | 0.861 | 0.267 | 0.439 |
| GATv2 | 0.818 | 0.814 | 0.261 | 0.229 |
| GIN | 0.797 | 0.800 | 0.298 | 0.379 |
| PNA | 0.858 | 0.845 | 0.300 | 0.377 |
| Data | Approach | Hit | Hit | Hit | Gini | Gini | ||
|---|---|---|---|---|---|---|---|---|
| BACE | Atom-level | 148 | 0.405 | 0.465 | 0.345 | 0.478 | 0.122 | -0.029 |
| Aggregated | 148 | 0.399 | 0.457 | 0.514 | 0.532 | 0.403 | 0.053 | |
| Native frag. | 148 | 0.277 | 0.318 | 0.480 | 0.518 | 0.282 | 0.330 | |
| reachable ceiling | 0.872 | |||||||
| BBBP | Atom-level | 166 | 0.723 | — | 0.741 | 0.258 | 0.075 | 0.155 |
| Aggregated | 166 | 0.711 | — | 0.723 | 0.455 | 0.434 | 0.812 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Range / choices |
|---|---|
| hidden channels | [32, 256] |
| layers | [2, 4] |
| dropout | [0.2, 0.6] |
| pooling | {mean, add, max} |
| learning rate | [0.0001, 0.005] (log) |
| weight decay | [1e-06, 0.001] (log) |
| Experiment | Enc. | Best configuration |
|---|---|---|
| BACE (cls)/AttentiveFP | A | h234, L4, d0.23, lr2.8e-03, timesteps2 |
| BACE (cls)/AttentiveFP | F | h95, L3, d0.26, lr3.1e-03, timesteps3 |
| BACE (cls)/GAT | A | h213, L3, d0.24, lr3.7e-03, add, heads2, v1 |
| BACE (cls)/GAT | F | h149, L4, d0.28, lr4.9e-03, mean, heads4, v1 |
| BACE (cls)/GIN | A | h126, L2, d0.55, lr2.3e-03, mean |
| BACE (cls)/GIN | F | h170, L3, d0.48, lr2.7e-03, max |
| Dataset | Model / Enc. | acc | acc_bal | f1 | prec | rec | mcc | avg_prec | roc_auc |
|---|---|---|---|---|---|---|---|---|---|
| BACE (cls) | AttentiveFP/A | 0.777 | 0.781 | 0.666 | 0.590 | 0.790 | 0.530 | 0.747 | 0.867 |
| AttentiveFP/F | 0.815 | 0.794 | 0.688 | 0.642 | 0.750 | 0.565 | 0.760 | 0.864 | |
| GAT/A | 0.726 | 0.737 | 0.605 | 0.515 | 0.761 | 0.439 | 0.651 | 0.817 | |
| GAT/F | 0.816 | 0.784 | 0.678 | 0.647 | 0.715 | 0.552 | 0.745 | 0.854 | |
| GIN/A | 0.662 | 0.712 | 0.575 | 0.450 | 0.820 | 0.385 | 0.615 | 0.816 | |
| GIN/F | 0.737 | 0.756 | 0.633 | 0.536 | 0.800 | 0.476 | 0.632 | 0.805 |
| Dataset | Model / Enc. | r2 | rmse | mae | rto_r2 | ccc | roy_c | roy_c_inv | delta |
|---|---|---|---|---|---|---|---|---|---|
| BACE (reg) | AttentiveFP/A | 0.686 | 0.750 | 0.579 | 0.720 | 0.846 | 0.579 | 0.601 | 0.032 |
| AttentiveFP/F | 0.730 | 0.673 | 0.499 | 0.743 | 0.861 | 0.655 | 0.659 | 0.026 | |
| GAT/A | 0.620 | 0.827 | 0.611 | 0.671 | 0.818 | 0.483 | 0.547 | 0.010 | |
| GAT/F | 0.606 | 0.810 | 0.619 | 0.646 | 0.814 | 0.496 | 0.571 | 0.010 | |
| GIN/A | 0.551 | 0.898 | 0.687 | 0.621 | 0.797 | 0.410 | 0.515 | 0.021 | |
| GIN/F | 0.558 | 0.848 | 0.640 | 0.603 | 0.800 | 0.451 | 0.552 | 0.058 |
| Aggregation | BACE (cls) | PTR1 |
|---|---|---|
| Signed, sum (SME default) | 0.399 | 0.783 |
| Signed, size-normalised | 0.223 | 0.696 |
| Absolute, sum | 0.426 | 0.783 |
| Absolute, size-normalised | 0.257 | 0.739 |
| Native fragment model | 0.277 | 0.783 |
| Dataset | Train | Val | Test | Scaf. | Singl. | BRICS excl. | Avg. atom/frag. nodes |
|---|---|---|---|---|---|---|---|
| BACE (cls) | 1210 | 151 | 151 | 649 | 452 | 5 (0.3%) | 34.1/7.2 |
| BACE (reg) | 1210 | 151 | 151 | 649 | 452 | 5 (0.3%) | 34.1/7.2 |
| BBBP | 1572 | 196 | 197 | 1020 | 776 | 254 (12.9%) | 24.0/4.5 |
| PTR1 | 200 | 25 | 25 | 119 | 82 | 11 (4.4%) | 23.3/4.4 |
| Source | Year | Reported | Curated |
|---|---|---|---|
| Khalaf et al. [ 19 ] | 2014 | 71 | 46 |
| Linciano et al. [ 29 ] | 2019 | 35 | 35 |
| Pöhner et al. [ 37 ] | 2022 | 34 | 34 |
| Borsari et al. [ 4 ] | 2016 | 42 | 29 |
| Spinks et al. [ 47 ] | 2011 | 26 | 22 |
| Santucci et al. [ 42 ] | 2021 | 14 | 14 |
Molecular Property Prediction
Molecular property prediction estimates chemical, physical, and biological properties from molecular structure and context.
See all 202 papers