An AI-driven computational framework combining Physiologically-Based Pharmacokinetic (PBPK) modeling and Deep Learning (Recurrent Neural Networks) to predict maximum plasma concentration (
Anxiety disorders represent a primary global health burden, commonly managed via benzodiazepines like Diazepam (DZ). However, prolonged exposure implies high dependence risks. Tailoring dosage is critical but challenging due to inter-individual physiological variability.
This project implements a hybrid machine learning and mechanistic framework:
- ** Mechanistic Simulation (PBPK):** Generated vast pharmacokinetic profiles across multiple ethnicities using PK-Sim® and the ospsuite package in R to simulate Virtual Populations under complex dosing scenarios.
-
Deep Learning Prediction: Designed, trained, and compared two Recurrent Neural Network configurations in Python/PyTorch—a direct Many-to-Many LSTM and a Sequence-to-Sequence (Seq2Seq) Encoder-Decoder—to forecast real-time
$C_{max}$ progression based on individual physiology and dose records.
The repository is organized as follows:
TFG-LSTM-Diazepam-PK/
├── data/
│ ├── raw/
│ └── processed/
├── src/
│ ├── simulation/
│ └── models/ ← LSTM many-to-many & encoder-decoder
├── results/
│ └── figures/
├── report/
├── .gitignore
└── README.md
-
Data Generation (Mechanistic PBPK) Using Open Systems Pharmacology (OSP) tools, virtual populations were exposed to two custom dosing protocols: Protocol 1 (Fixed Variable): 120,000 diverse subjects receiving identical hourly doses over 48h. Protocol 2 (Random Variable): 75,500 European subjects receiving distinct, randomly-spaced oral doses every 8 hours across 72h.
-
Deep Learning Frameworks
Model 1: Direct Many-to-Many LSTM (48x48): Maps 48 hourly input steps (physiological traits + active dose) directly to 48 sequential C max output steps.
Model 2: Seq2Seq Encoder-Decoder LSTM (9x72): Compresses a sparse sequence of 9 dose-events into a latent vector space, which the decoder unfolds into 72 hourly plasma concentration predictions.
Encoder-Decoder (Model 2): Exhibited superior capability to fit training distribution shapes (R^2 >0.70, MSE=0.32), demonstrating robust peak tracking, though limited by overfitting on evaluation subsets.
Direct LSTM (Model 1): Maintained highly stable, low Absolute Error bounds (MAE≈0.03), demonstrating tighter control under low-variability dose conditions.
The study emphasizes the requirement for diverse data distributions to scale deep sequence learning inside precision posology domains.
OSP & R Environment PK-Sim® (v12) RStudio with ospsuite package (v12.2)
Valery Quintal Méndez - Degree in Psychology, Universidad Complutense de Madrid
- This project was developed as a Bachelor's Thesis for the Academic Year 2024-2025.