scieee AI-readable full text Open interactive document viewer

Chebifier 2: An Ensemble for Chemistry

Flügel, Simon

Abstract

Presentation given at the Ontologies4Chem Workshop 2025. Abstract: Chemical classification is a complex task without a one-size-fits-all solution. Rule-based approaches are explainable and reliable, but require expert knowledge. Deep Learning methods are easier to scale, but depend on the presence of sufficient data and are black boxes to the user. Chebifier 2 is an ensemble approach that combines deep learning, rule-based and LLM-based approaches to leverage their individual strengths, covering a total of more than 1,700 ChEBI classes.

Full text

Chebifier 2: An Ensemble for Chemistry Simon Flügel (Osnabrück University) Based on: Simon Flügel, Martin Glauer, Janna Hastings, Till Mossakowski, Christopher J. Mungall, Charlotte Tumescheit and Fabian Neuhaus: Chebifier 2: An Ensemble for Chemistry (SEMANTiCS, 2025) Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 2 Ontological Classification tripeptide zwitterion dipeptide zwitterion peptide zwitterion dipolar compound chemical entity organic molecular entity nitrogen ylide ylide ? ??? Asp-Lys zwitterion (CHEBI:229953) Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 3 Chebifier 2 ELECTRA [1]: Transformer model GNN: Graph neural network ChemLog [2]: Logic-based model CCPs [3]: Chemical Classifier Programs (Generative AI-based) [1] Glauer, M., et al.: Chebifier: automating semantic classification in ChEBI to accelerate data-driven discovery. Digital Discovery 3(5), 896–907 (2024) [2] S. Flügel, M. Glauer, T. Mossakowski, F. Neuhaus, ChemLog: Making MSOL viable for ontological classification and learning, in: 5th International Joint Conference on Learning and Reasoning (accepted), preprint available on arXiv, 2025. URL: http://arxiv.org/abs/2507.13987. [3] C. J. Mungall, A. Malik, D. R. Korn, J. T. Reese, N. M. O’Boyle, J. Hastings, Chemical classification program synthesis using generative artificial intelligence, arXiv preprint arXiv:2505.18470 (2025) Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 4 Datasets for Deep Learning Extract label classes and molecules (=SMILES-annotated classes) from ChEBI Label classes are selected via threshold (min. 50 / 100 molecules) Optional: Filter for 3-STAR Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 5 ELECTRA 🤖 Deep Learning model (Transformer-based) Trained on SMILES strings –pretraining: PubChem –fine-tuning: ChEBI 61-10-10-10-10-53-735-10-7-54-19-8-52-761-8-10-10-7-54-19-867-8-10-7-54-19-8-67 Tokenise SMILES string Put SMILES into transformer Predict ontology class membership [NH3+]CCCC[C@H] (NC(=O)[C@@H] ([NH3+])CC(=O) [O-])C(=O)[O-] Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 6 Graph Neural Networks (GNNs) 🕸 2 architectures: Residual Gated Graph Convolutional Networks [1] and Graph Attention Networks [2] Graph representation of molecules + calculated properties Atom properties: Type, #bonds, charge, aromaticity, hybridisation, #Hs Bond properties: Type, inRing, aromaticity Global properties: RDKIt2DNormalized Calculate properties Initialise GNN Predict ontology class membership [NH3+]CCCC[C@H] (NC(=O)[C@@H] ([NH3+])CC(=O) [O-])C(=O)[O-] [1] X. Bresson, T. Laurent: Residual gated graph convnets, 2018. arxiv. URL: http://arxiv.org/abs/1711.07553 [2] Velickovic, Petar, et al.: Graph attention networks, 2019. ICLR 2018 Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 7 Augmented GNNs 🕸 3-layer architecture: atoms, functional groups, global node Figure from: Aditya Ganesh Khedekar: Integrating Chemical Knowledge into Graph Neural Networks, 2025. Master’s Thesis. Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 8 ChemLog 🧩 Rule-based classification with monadic second-order logic Covers 169 classes related to peptides or of the type “x molecular entity” / “organo-x compound” 128 classes are unique to ChemLog Classify with logical rules organooxygen Compound ⇔∃a,b:C ( a ) ∧O ( b ) ∧Bond ( a,b ) [NH3+]CCCC[C@H] (NC(=O)[C@@H] ([NH3+])CC(=O) [O-])C(=O)[O-] Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 9 Chemical Classifier Programs (CCPs) 📟 Given textual descriptions of ChEBI classes, use Large Language Models to generate Python scripts for classification Refine in an iterative process with samples from ChEBI Returns natural language explanations 338 classes covered (66 unique to CCPs) Generate programs [NH3+]CCCC[C@H](NC(=O) [C@@H]([NH3+])CC(=O) [O-])C(=O)[O-] amino-acid zwitterion: “The zwitterionic form of an amino acid having a negatively charged carboxyl group and a positively charged amino group.” def is_amino_acid_zwitterion(smiles: str): mol = Chem.MolFromSmiles(smiles) … return False, “Missing negatively charged carboxyl group” Classify with programs Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 16 Evaluation – Deep Learning 20 models (5 architectures x 4 datasets) Model selection strategies: Top-N, Reduce, Add Selected models (Reduce @ 4): GAT-aug (ChEBI50) RGGCN-aug (CHEBI50-3-STAR) GAT (ChEBI50) ELECTRA (ChEBI50-3-STAR) Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 17 Evaluation – Inconsistency Resolution Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 18 Evaluation – Adding ChemLog + C3Ps Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 19 Mismatches between ChEBI and ChemLog Example: methanol (CO, CHEBI:17790) is not classified as an organooxygen compound (CHEBI:36963, “containing at least one carbon-oxygen bond“) in ChEBI Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 20 https://myshare.uni-osnabrueck.de/f/b26e8848a4ae4acf9c28/ Live Demo C:\Users\sifluegel\Videos\Screen Recordings Chebifier 2: An Ensemble for Chemistry / Flügel et al. / 21 Conclusion No model is perfect and chemical classes are diverse Chebifier 2 combines logic + deep learning + generative AI Classand sample-specific weighting Total classes covered: 1,742 Explanations available for logic and generative AI models –Weak explanations available for transformers Accessible as a Python library or via web frontend chebifier.hastingslab.org github.com/ChEB-AI/python-chebifier Extra Slides