Code repository for undergraduate research project titled:
Incorporating Adaptive Human Behavior into Epidemiological Models using Equation Learning
Austin T. Barton, Jordan Klein, Kevin B. Flores*
* Corresponding author.
Abstract: Mathematical and computational models have both proven to be valuable tools for forecasting and studying epidemics. Covasim is an open-source agent-based model (ABM) developed to simulate the transmission of COVID-19. Human behaviors, such as masking, have been shown to depend on the state of the epidemic and can significantly impact disease spread. While Covasim's base model does not include adaptive elements, we extended it to incorporate adaptive masking behavior to investigate its effect on the system's behavior, complexity, dynamics of certain parameters, and one's ability to obtain an ordinary differential equation (ODE) approximation from it. Using an existing compartmental model, we processed the data generated from this extended ABM through Biologically-Informed Neural Networks (BINNs) and sparse regression methods to obtain an ODE approximation. The extended ABM and equation learning pipeline we developed is open-source to provide a quantitative framework for incorporating adaptive behaviors into other similar computational models.
All code under the folder titled "covasim" is the work of the "Institute for Disease Modeling". We use covasim version 3.1.3 for our implementations. Equation learning and BINNs code has been adapted from [1.] and Xin Li.
Folder that contains all the data and compartmental plots from Covasim generated data.
Folder that contains important figures, schematics, images, etc. for the REU project.
Folder that contains all the trained models, their outputted compartments, loss, evaluation, and learned parameter curves.
- debugging - Folder that contains models for the purpose of debugging and exploring results.
- denoised - Folder that contains trained BINNs models that takes the average compartments over multiple simulations and numerically approximated time derivatives as inputs.
- mask - Folder that contained trained full BINNs models with average masking as an input into the contact rate function.
Folder that acts as a library containing all the models, model wrappers, helper functions, data storage and loading, etc.
- Activations - Folder that contains custom made activation functions.
- SoftPlusReLU.py: File for the custom made SoftPlusReLU activation function.
- Loaders - Folder that contains data loaders and formatters.
- DataFormatter.py: File for loading, formatting, and interacting with saved data.
- Models - Folder containing the neural network models created using PyTorch.
- BuildBINNs.py: File that contains the code for the BINNs models. There are 3 separate models. One being the model created by Xin Li and the others being the models adapted by Austin Barton from Xin Li that bypasses the surface fitting portion of BINNs to focus on learning the parameters.
- BuildMLP.py: File that interacts with PyTorch to create a basic multi-layer perceptron (MLP).
- Utils - Folder containing numerous utility files.
- GetLowestGPU.py
- Gradient.py
- Imports.py
- ModelWrapper.py
- PDESolver.py
- TimeRemaining.py
Folder that contains all the code for training, evaluating, and plotting learned parameter curves.
- data_generation - Folder that contains files related to interacting with Covasim, generating data, and storing it.
- drums_data_gen_multi.py: File that generates data from multiple simulations.
- DRUMS_data_gen.ipynb: Notebook that interacts with data generator files.
- figs - Folder that contains figures and plots relating to the data such as Covasim generated plots and numerically approximated time derivatives.
- drums - DRUMS REU figures.
- xin_figs - Xin Li's figures.
Folder that contains all code for Covasim version 3.1.3 created by the "Institute for Disease Modeling". This is the simulator our code interacts with to generate data.
Contributors: Austin T. Barton, Jordan Klein, Kevin B. Flores, Patrick M. Haughey, Jonathan Greer, Xin Li.
1. Lagergren, J. H., Nardini, J. T., Baker, R. E., Simpson, M. J., & Flores, K. B. (2020). Biologically-informed neural networks guide mechanistic modeling from sparse experimental data. PLOS Computational Biology, 16(12).
2. Kerr, C. C., Stuart, R. M., Mistry, D., Abeysuriya, R. G., Rosenfeld, K., Hart, G. R., Núñez, R. C., Cohen, J. A., Selvaraj, P., Hagedorn, B., George, L., Jastrzębski, M., Izzo, A., Fowler, G., Palmer, A., Delport, D., Scott, N., Kelly, S., Bennette, C. S., … Klein, D. J. (2020). Covasim: An Agent-Based Model of COVID-19 Dynamics and Interventions.
3. Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2018, November 3). Physics-informed Neural Networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics.
4. Nardini, J. T., Baker, R. E., Simpson, M. J., & Flores, K. B. (2021, March 17). Learning differential equation models from stochastic agent-based model ... The Royal Society Publishing.