Applying bio-inspired evolutionary algorithms to optimize insulin intervention plans using progressively richer glucose–insulin simulation models.
This project investigates how genetic algorithms and other bio-inspired search techniques can be used to plan optimal insulin dosing strategies for glucose control. It progresses from simple rule-based simulations through Bergman-inspired physiological ODE models, combining them with evolutionary optimization to achieve tight glucose regulation.
The research is implemented in a single, self-contained Jupyter notebook: Insulin_Optimization.ipynb.
Three virtual patient avatars are used across experiments to represent diverse physiological profiles:
| Avatar | Profile |
|---|---|
| Emily | Avatars/Emily.png |
| Lisa | Avatars/Lisa.png |
| Sam | Avatars/Sam.png |
The notebook is structured as a progressive workflow across four main sections:
scipy.integrate.solve_ivpAll models are evaluated on a standardized, trajectory-level metric set after resampling to a common 1-minute grid, enabling fair cross-model comparison:
| Metric | Description |
|---|---|
MAE to target |
Mean absolute error to target glucose of 100 mg/dL |
Time in range |
% of time in the safe range 70–180 mg/dL |
Below 70 (min) |
Minutes spent in hypoglycemia |
Above 180 (min) |
Minutes spent in hyperglycemia |
| Experiment | MAE to 100 | Time in 70–180 | Below 70 (min) | Above 180 (min) | Interpretation |
|---|---|---|---|---|---|
| Hybrid ODE + GA | 0.46 | 100.00% | 0 | 0 | ✅ Best overall |
| Improved Mini Bergman | 7.47 | 96.37% | 217 | 1 | Good control, hypo-risk episodes |
| Mini Bergman (interval) | 9.14 | 100.00% | 0 | 0 | Stable, less precise than hybrid |
| Grid Search (discrete) | 25.76 | 100.00% | 0 | 0 | Simple baseline, not competitive |
| GA Discrete | 45.39 | 52.28% | 115 | 0 | Weak physiological plausibility |
↓ Lower MAE is better · ↑ Higher time-in-range is better
| Package | Purpose |
|---|---|
numpy |
Numerical simulation and array operations |
pandas |
Results aggregation and metrics tables |
matplotlib |
Glucose trajectory and convergence plots |
scipy |
ODE integration (solve_ivp) |
deap |
Evolutionary algorithm framework |
All dependencies are installed inline via %pip install cells in the notebook — no separate setup step required.
Requirements: Python 3.10+, Jupyter Notebook or VS Code with notebook support.
# Clone the repository
git clone https://github.com/AMVamsi/Bio-Inspired-Optimization.git
cd Bio-Inspired-Optimization
# Open the notebook
jupyter notebook Insulin_Optimization.ipynb
Run all cells top-to-bottom in a fresh kernel. The final section — Final Results Summary (Standardized Metrics) — contains the cross-model comparison tables.
Bio-Inspired-Optimization/
├── Insulin_Optimization.ipynb # Main research notebook
├── Avatars/ # Virtual patient avatar images
│ ├── Emily.png
│ ├── Lisa.png
│ └── Sam.png
├── Presentation.pdf # Project presentation slides
└── README.md # This file
This project is research software developed for academic exploration of bio-inspired optimization techniques applied to glucose-insulin dynamics. It does not constitute medical advice and is not intended for clinical use.
This project is licensed under the MIT License.
Made with ❤️ for computational biology research