Skip to content

About

Hybrid PBPK and deep learning framework using PyTorch LSTMs to predict Diazepam pharmacokinetics across virtual populations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

LSTM Networks for Diazepam Pharmacokinetics Prediction and Dosing Variability Evaluation

An AI-driven computational framework combining Physiologically-Based Pharmacokinetic (PBPK) modeling and Deep Learning (Recurrent Neural Networks) to predict maximum plasma concentration ($C_{max}$) of Diazepam across virtual populations.


Project Overview

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:

  1. ** 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.
  2. 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.

Repository Structure

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

Methodology & Architecture

  1. 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.

  2. 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.


Key Findings

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.

Requirements & Installation

OSP & R Environment PK-Sim® (v12) RStudio with ospsuite package (v12.2)

Python Ecosystem Python 3.8+ PyTorch Scikit-Learn, Pandas, NumPy, Matplotlib

Author

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.

About

Hybrid PBPK and deep learning framework using PyTorch LSTMs to predict Diazepam pharmacokinetics across virtual populations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages