Student: Hassan Almosa (Alia0024) Course: COMP3742 Artificial Intelligence Assessment: Artefact 2 - Hybrid AI System for Drug Discovery Video Demo: [https://youtu.be/MhPdEaUov6Q] Repository: [https://github.com/gammaploid/Moleculetron/] Date: 2025-11-29
Molecultron is a hybrid AI system combining machine learning (MLP neural network) with symbolic reasoning (Prolog knowledge base) for TAAR1 drug discovery candidate assessment.
[INFERENCE PIPELINE]
SMILES Input --> RDKit Feature Extraction --> Load MLP Model --> pIC50 Prediction
| |
v v
Molecular Properties Activity Classification
(MW, LogP, TPSA, HBD, etc.) |
| |
v |
Prolog KB Query <--------------------------------------+
|
v
Rule Evaluation:
- Veber (oral bioavailability)
- CNS MPO (brain penetration)
- TAAR1 Pharmacophore (mechanism)
- Pfizer 3/75 (safety)
|
v
Final Recommendation + Explanations
| File | Description |
|---|---|
hybrid_inference.py |
Main hybrid system (MLP + Prolog integration) |
train_models.py |
Training script for baseline ML models |
taar1_kb.pl |
Prolog knowledge base |
requirements.txt |
Python dependencies |
test_hybrid_system.py |
Comprehensive test suite |
- Python >= 3.9
- SWI-Prolog (for pyswip)
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Verify RDKit
python -c "from rdkit import Chem; print('RDKit OK')"
# Verify PySwip (requires SWI-Prolog installed)
python -c "from pyswip import Prolog; print('PySwip OK')"- macOS:
brew install swi-prolog - Ubuntu:
sudo apt install swi-prolog - Windows: Download from https://www.swi-prolog.org/download/stable
from hybrid_inference import HybridInferenceSystem
# Initialize system
system = HybridInferenceSystem()
# Evaluate a compound
result = system.predict("NCCc1ccccc1") # Phenethylamine
# Get recommendation
print(f"pIC50: {result.pchembl_predicted}")
print(f"Tier: {result.recommendation_tier}")
print(f"Explanation: {result.natural_language_explanation}")python test_hybrid_system.pypython train_models.pyThe KB implements four literature-backed rule sets:
- Veber Rules (Veber 2002): Oral bioavailability
- CNS MPO (Wager 2010): Brain penetration score (0-5)
- TAAR1 Pharmacophore (Bunzow 2001): Basic nitrogen + aromatic ring
- Pfizer 3/75 (Hughes 2008): Safety filter
| Model | Test R2 | Split | Notes |
|---|---|---|---|
| XGBoost | 0.292 | Scaffold | Best overall |
| SVR | 0.227 | Scaffold | Best CV |
| MLP | 0.643 | Random | Inflated by split |
- Bunzow et al. (2001). Mol. Pharmacol., 60(6), 1181-1188.
- Wager et al. (2010). ACS Chem. Neurosci., 1(6), 435-449.
- Veber et al. (2002). J. Med. Chem., 45(12), 2615-2623.
- Hughes et al. (2008). Bioorg. Med. Chem. Lett., 18(17), 4872-4875.