Source-linked AI summary

SMILESGNN: Interpretable Clinical Toxicity Prediction via SMILES-Graph Cross-Attention Fusion

Quang Minh Nguyen, Thuy Quynh Nguyen, Duc Minh Le, Ho Nhat Minh Nguyen, Thanh Long Dai Doan, Trong Nghia Nguyen

arXiv:2609.28553v1cs.LGcs.AI

TL;DR

Clinical toxicity prediction must contend with class imbalance, scaffold generalization, and the need to interpret predictions at the graph level. SMILESGNN fuses SMILES and graph encoders through cross-attention, retaining a graph branch for attribution analysis. It reports competitive results on ClinTox and Tox21 against strong single-modality and concat-fusion baselines.

  • Problem

    Clinical toxicity prediction is challenging because of class imbalance and scaffold-based generalization, while sequence-only models cannot provide graph-attributed explanations.

    Source: §I · p. 1
  • Method

    SMILESGNN fuses a SMILES Transformer and GATv2 graph encoder through cross-attention, retaining the graph branch for GNNExplainer analysis.

    Source: §I · p. 1, 3) Attention-Based Fusion Module · p. 2, D. Graph Representation Analysis · p. 5
  • Results

    On ClinTox, SMILESGNN achieves F1 0.906 ± 0.039; on Tox21, SMILESGNN-PT‡ achieves mean AUC-ROC 0.750 ± 0.002, matching the reported ChemBERTa-2 and concat-fusion baselines.

    Source: A. Overall Performance · p. 3, C. Tox21 Multi-Task Evaluation · p. 4
  • Takeaways & Limitations

    The framework retains competitive predictive performance while allowing GNNExplainer-based inspection of toxicophore-like substructures.

    Source: §V · p. 5

    The evaluation is limited by small, highly imbalanced ClinTox data, qualitative rather than causal explanations, and a lack of stronger stress tests.

    Source: §V · p. 5

Abstract

from arXiv · show

Drug toxicity prediction is critical for reducing late-stage attrition in drug discovery, yet remains challenging due to severe class imbalance, scaffold-based generalization, and the clinical need for interpretable predictions. Single-modality approaches-SMILES Transformers or graph neural networks capture complementary aspects of molecular structure, while sequence-only models cannot directly provide graph-attributed explanations. We present SMILESGNN, a multimodal architecture that fuses a SMILES Transformer encoder and a GATv2 graph encoder via cross-attention, and SMILESGNN-PT, a variant using a ChemBERTa-2 pretrained backbone. The design retains an explicit graph branch within the predictive pipeline, supporting GNNExplainer-based analysis of substructures associated with toxic predictions. On ClinTox, SMILESGNN achieves AUC-ROC 0.987 and F1 0.906 with only 0.4M parameters, performing competitively with a strong SMILESTransformer and a larger ChemBERTa-2/GATv2 concat-fusion baseline. On Tox21 (12 tasks), SMILESGNN-PT obtains mean AUC-ROC 0.750, comparable to ChemBERTa-2 alone and the same-backbone concat-fusion baseline. Overall, the results suggest that cross-attention is a practical fusion alternative that preserves competitive predictive performance while enabling graph-based interpretability support.

I. INTRODUCTION

Clinical toxicity prediction combines severe class imbalance, scaffold generalization, and multi-scale molecular structure with a need for graph-attributed explanations. SMILESGNN uses cross-attention to fuse sequence and graph representations, addressing gaps in prior multimodal toxicity methods.

I. INTRODUCTION

  • Clinical toxicity prediction must address a 1:11.5 toxic-to-nontoxic ratio, novel-scaffold generalization, and toxicity signals spanning local features and global geometry.Sequence-only models cannot provide graph-attributed explanations, while GNNExplainer requires an explicit graph pathway.Source: §I · p. 1
  • SMILESGNN fuses a SMILES Transformer and GATv2 graph encoder through cross-attention, with focal loss and a ChemBERTa-2 pretrained variant.The dual pathway supports GNNExplainer-based graph attribution; SMILESGNN is reported at AUC-ROC 0.987±0.012 and with 0.4M parameters.Source: §I · pp. 1–2

II. RELATED WORK

  • Prior multimodal approaches include fingerprint-GNN concatenation and gated fusion, but the cited methods do not address extreme clinical-toxicity imbalance, controlled cross-attention comparisons, or graph-aware post-hoc attribution.Molecular fingerprints lose structural detail through fixed-length hashing, while GNNs and SMILES Transformers represent molecular graphs and token sequences, respectively.Source: §II · p. 2

III. METHODOLOGY

The evaluation uses scaffold-based splits to test generalization to novel molecular scaffolds on ClinTox and Tox21. Tox21 additionally spans 12 assays and handles missing labels with masked focal loss.

A. Dataset

  • ClinTox contains 1,480 drug-like molecules with binary clinical toxicity labels and an 11.5:1 class imbalance.The evaluated task is CT TOX.Source: A. Dataset · p. 2
  • ClinTox uses a seed-42 scaffold split with 80/10/10 training, validation, and test proportions to assess generalization to novel scaffolds.The paper notes that structurally similar molecules can have markedly different clinical outcomes.Source: A. Dataset · p. 2
  • Tox21 contains 7,831 molecules across 12 binary assays, with up to 30% missing annotations handled by masked focal loss.Its seed-42 scaffold split yields 6,264/783/784 training/validation/test molecules; reported metrics are mean AUC-ROC and mean PR-AUC across tasks.Source: A. Dataset · p. 2

1) SMILES Sequence Processing:

The architecture processes SMILES sequences and molecular graphs as separate inputs. The SMILES branch uses chemical-unit tokenization and a two-layer Transformer, while the graph input encodes atom and bond features.

1) SMILES Sequence Processing:

  • SMILESGNN tokenizes SMILES into 69 chemical units derived from ClinTox training data, while SMILESGNN-PT uses ChemBERTa-2 WordPiece tokenization.Both variants pad or truncate sequences to 128 tokens.Source: 1) SMILES Sequence Processing · p. 2

2) Molecular Graph Processing:

  • Molecular graph nodes use 25 atom features, and edges use 17 bond features.The listed features include aromaticity and ring membership for atoms, and bond type, conjugation, and stereochemistry for edges.Source: 2) Molecular Graph Processing · p. 2

C. SMILESGNN Architecture

1) SMILES Encoder:

  • The SMILES encoder uses two four-head Transformer layers with 96-dimensional embeddings and masked mean pooling to form the sequence representation.The model uses a vocabulary of 69 and a feedforward dimension of 192.Source: 1) SMILES Encoder · p. 2

2) Graph Encoder:

The graph branch uses GATv2 message passing and pooling to form graph representations. Four-head cross-attention conditions sequence features on graph features before an MLP predicts toxicity.

2) Graph Encoder:

  • Three four-head GATv2 layers process 25-dimensional atom features, and Jumping Knowledge plus mean-max pooling produce a 576-dimensional graph representation.The graph layers use LayerNorm, ReLU, residual connections, and dropout.Source: 2) Graph Encoder · p. 2

3) Attention-Based Fusion Module:

  • Four-head cross-attention uses the SMILES representation as query and projected graph features as key and value, then concatenates attended output with the original sequence representation.The resulting fused representation is 192-dimensional.Source: 3) Attention-Based Fusion Module · p. 2

4) Predictor Head:

  • A four-layer MLP maps the 192-dimensional fused representation to a binary toxicity prediction.Its layer widths are 192→192→96→48→1, with BatchNorm, ReLU, and dropout in each hidden layer.Source: 4) Predictor Head · p. 2

D. SMILESGNN-PT Architecture

SMILESGNN-PT replaces the custom SMILES encoder with a ChemBERTa-2 backbone while retaining the GATv2 graph pathway and cross-attention fusion. Focal loss addresses class imbalance, with a masked version used for incompletely labelled Tox21 assays.

D. SMILESGNN-PT Architecture

  • SMILESGNN-PT uses ChemBERTa-2 with the retained GATv2 graph encoder and 384-dimensional cross-attention fusion, then concatenates the fused representation for prediction.The model has 4.7M total parameters: 3.4M in the backbone and 1.3M in the head.Source: D. SMILESGNN-PT Architecture · p. 2

1) Loss Function:

  • Focal loss addresses severe class imbalance; for Tox21, its masked variant computes loss only on labelled compound-assay pairs.The stated focal-loss parameters are α = 0.25 and γ = 2.0.Source: 1) Loss Function · pp. 2–3

D. SMILESGNN-PT Architecture

  • Fig. 1 shows the SMILES Transformer and GATv2 pathways coupled by cross-attention before the MLP prediction head.The dual pathway retains graph structure for GNNExplainer-based graph interpretability.Source: Figure 1 · p. 3

1) Loss Function:

  • Training uses two-group AdamW for SMILESGNN-PT, batch size 16, and otherwise the same setup as the other models.The general setup uses dropout, batch normalization, a weighted sampler, and early stopping.Source: 1) Loss Function · p. 3

3) Evaluation Metrics:

Models are evaluated on held-out test data using four classification metrics. The ClinTox comparison includes single-modality models and a same-backbone concat-fusion baseline alongside the proposed variants.

3) Evaluation Metrics:

IV. EXPERIMENTS AND RESULTS

  • ClinTox evaluation uses a scaffold split with 1,184 training and 148 test compounds, comparing SMILESGNN and SMILESGNN-PT against eight baselines.The baselines include single-modality models and CB2-GATv2, a concat-fusion comparator.Source: §IV · p. 3
  • SMILESGNN-PT and CB2-GATv2 share the ChemBERTa-2 backbone, allowing comparison of cross-attention with concatenation under identical conditions.Source: §IV · p. 3

A. Overall Performance

On ClinTox, SMILESGNN has higher minority-class F1 than SMILESTransformer and competitive AUC-ROC, while cross-attention is competitive with same-backbone concatenation. Results also vary by dataset and include graph-branch interpretation and encoder-ablation comparisons.

A. Overall Performance

  • F1 0.906 ± 0.039 for SMILESGNN exceeds SMILESTransformer (F1 0.896 ± 0.053) and matches CB2-GATv2 (F1 0.890 ± 0.063) on ClinTox.SMILESGNN's AUC-ROC is 0.987 ± 0.012, competitive with SMILESTransformer; the graph pathway adds GNNExplainer interpretability rather than a large accuracy gain on this small dataset.Source: A. Overall Performance · p. 3, Table I · p. 4
  • AUC-ROC 0.979 ± 0.014 for SMILESGNN-PT is within 0.008 of CB2-GATv2 (0.987 ± 0.018), with overlapping confidence intervals.Source: A. Overall Performance · p. 3, Table I · p. 4
  • The encoder ablation reports GATv2-only F1 0.424±0.162 and SMILESTransformer-only F1 0.896±0.053, while fusion reaches F1 0.906±0.039.The table caption specifies an equal-capacity projection before cross-attention fusion.Source: A. Overall Performance · p. 4, Table II · p. 4
  • +0.030 AUC-ROC for SMILESGNN-PT on Tox21 reverses the ClinTox advantage of SMILESGNN, on a dataset with 6,264 training samples.Source: A. Overall Performance · p. 4
  • Mean AUPRC 0.946 ± 0.028 for SMILESGNN substantially exceeds graph-based single-modality baselines in the reported representative-model curves.Source: A. Overall Performance · p. 4
  • SMILESGNN and SMILESTransformer agree on 142 of 148 test samples; among three disagreements favouring SMILESGNN, it identifies one missed toxic compound and avoids two false positives.Source: A. Overall Performance · p. 4

B. Fusion Mechanism Ablation

Under shared backbone components and training conditions, cross-attention fusion slightly exceeds the SMILESTransformer alone on F1 while retaining a graph branch for GNNExplainer analysis.

B. Fusion Mechanism Ablation

  • Table III reports mean AUC-ROC and PR-AUC across 12 Tox21 tasks on a scaffold split, with values averaged over three seeds.Its caption identifies ‡ as ChemBERTa-2 + cross-attention + GATv2.Source: Table III · p. 4
  • F1 0.906±0.039 for cross-attention fusion is slightly higher than SMILESTransformer alone (F1 0.896±0.053).The passage says the fused model also has lower variance, suggesting complementary structural signals for minority-class identification.Source: B. Fusion Mechanism Ablation · p. 4
  • GATv2 alone has F1 0.424±0.162, while SMILESTransformer alone reaches F1 0.896±0.053 and AUC-ROC 0.995±0.003.These comparisons use the same backbone components and training conditions.Source: B. Fusion Mechanism Ablation · p. 4

C. Tox21 Multi-Task Evaluation

On Tox21, SMILESGNN-PT is comparable to ChemBERTa-2 alone and the same-backbone concatenation baseline. ClinTox examples and curves also illustrate performance differences associated with the graph pathway.

C. Tox21 Multi-Task Evaluation

  • SMILESGNN-PT scores 0.750 ± 0.002 on Tox21, matching ChemBERTa-2 alone (0.752±0.009) and CB2-GATv2† (0.751 ± 0.012).The cited comparison reports overlapping confidence intervals; cross-attention is competitive with concatenation under the same backbone.Source: C. Tox21 Multi-Task Evaluation · pp. 4–5
  • On the ClinTox test set for seed 42, SMILESGNN achieved AUPRC 0.967, outperforming all graph-based baselines and matching the multimodal concat-fusion baseline.Source: Figure 3 · p. 5

D. Graph Representation Analysis

GNNExplainer applies atom and bond masks to the graph pathway of the fused predictor, offering qualitative, model-specific views of substructures associated with toxic classifications. The conclusion emphasizes that these explanations are not causal proof and that evaluation remains limited.

D. Graph Representation Analysis

  • GNNExplainer optimizes per-atom and per-bond soft masks over the GATv2 pathway to identify compact subgraphs associated with toxic classification.The graph branch remains within the fused predictor, making its masks a graph-branch view of the learned decision process.Source: D. Graph Representation Analysis · p. 5
  • Halogenated aromatics show importance concentrated on halogenated phenyl rings and conjugated bridges, while reactive heterocycles peak at triazole and isoxazole rings.The passage relates these patterns to cytochrome P450-mediated activation, metabolic nitrile hydrolysis, and ring-opening electrophilic reactivity.Source: D. Graph Representation Analysis · p. 5
  • For extended scaffolds, importance is more diffuse but localizes at central amide linkers and terminal halogenated rings.Source: D. Graph Representation Analysis · p. 5

V. CONCLUSION

  • The conclusion notes that ClinTox is small and highly imbalanced, explanations are qualitative rather than causal, and stronger stress tests and external clinical validation are lacking.Proposed future work includes perturbation-based ablations, uncertainty calibration, and evaluation on larger toxicity benchmarks and external clinical datasets.Source: §V · p. 5

D. Graph Representation Analysis

  • Across six high-confidence ClinTox toxic predictions, darker red marks higher learned mask importance; the SMILES embeddings are frozen.Fig. 5 organizes atom importance in Row 1 and bond importance in Row 2, across two blocks of three molecules.Source: Figure 5 · p. 6
Loading 2609.28553v1…