Skip to main content
Elsevier - PMC COVID-19 Collection logoLink to Elsevier - PMC COVID-19 Collection
. 2022 Aug 13;14:100409. doi: 10.1016/j.simpa.2022.100409

ModInterv: An automated online software for modeling epidemicsInline graphic

Arthur A Brum a, Gerson C Duarte-Filho b, Raydonal Ospina c,, Francisco AG Almeida b, Antônio MS Macêdo a, Giovani L Vasconcelos d
PMCID: PMC9375249  PMID: 35990010

Abstract

The COVID-19 pandemic has proven the importance of mathematical tools to understand the evolution of epidemic outbreaks and provide reliable information to the general public and health authorities. In this perspective, we have developed ModInterv, an online software that applies growth models to monitor the evolution of the COVID-19 epidemic in locations chosen by the user among countries worldwide or states and cities in the USA or Brazil. This paper describes the software capabilities and its use both in recent research works and by technical committees assisting government authorities. Possible applications to other epidemics are also briefly discussed.

Keywords: Growth models, COVID-19, Epidemic curve, Curve fitting


Code metadata

Current code version v1.0
Permanent link to code/repository used for this code version https://github.com/SoftwareImpacts/SIMPAC-2022-142
Permanent link to Reproducible Capsule https://codeocean.com/capsule/1964502/tree/v1
Legal Code License MIT License
Code versioning system used none
Software code languages, tools, and services used Python
Compilation requirements, operating environments & dependencies
If available Link to developer documentation/manual
Support email for questions arthur.brum@ufpe.br

1. Introduction

The ongoing COVID-19 pandemic is a public health emergency with severe impacts on the lives of people everywhere around the globe. Sadly, the disease has thus far claimed the lives of over 6 million people, a figure that ranks the COVID-19 pandemic among the deadliest in history. Public health authorities play a major role in the fight against COVID-19, making decisions concerning the use of masks, stay-at-home mandates, school closures, among other non-pharmacological interventions. Obtaining reliable information is paramount to guide decision makers in choosing the best course of action to slow down (and eventually stop) the spread of the disease. In this context, mathematical models and data processing softwares are indispensable tools in the fight against epidemics.

Deterministic growth models are phenomenological approaches [1] governed by a single differential equation that often admit analytical solution. Their power lies in the fact that they are capable of capturing the basic features of epidemic dynamics, without the need to describe the underlying epidemiological mechanisms. One growth model that has proven quite effective in describing the complex features of COVID-19 epidemic curves is a generalized logistic model known as the beta logistic model (BLM) [2]. An extension of the BLM with time dependent parameters has also been shown to be able to efficiently model epidemics with multiple waves of infections [3].

In this paper, we present the main features of the software ModInterv which enables the user to monitor the dynamical stages of COVID-19 epidemic curves for both infection cases and deaths by implementing the multiwave BLM growth model mentioned above. More specifically, after the user chooses a type of data (cases or deaths) and a desired location (country or state/city in the USA or Brazil), the software automatically (i.e., without human assistance) performs a model fitting to the empirical data, extracts relevant information about the epidemic dynamics from the theoretical curve, and makes short-term predictions about the disease’s likely progression. The software is written in the Python programming language and made available in an HTML page currently accessed via the address http://fisica.ufpr.br/modinterv. The COVID-19 data used by ModInterv are fetched from public data repositories. Once the data is properly fetched, a plot of the empirical data is displayed and the user then has the option to perform a curve fitting, in which case the result of the best fit is shown superimposed with the empirical data. The software also allows the user to perform additional analysis on the basis of the fitted model.

We note in passing that there are several other softwares developed for application to the COVID-19 pandemic in the most diverse forms. One very common type of software is the dashboard, which is a visual display of a given dataset with the possibility to change between charts, graphs or the data themselves, as is the case of the World Health Organization Coronavirus Dashboard [4] and the Johns Hopkins University Dashboard [5]. Other softwares center their attention to forecasting the evolution of the pandemic, such as the Forecast Hub [6] and the Covidsim from Imperial College London [7], while others focus on the diagnosis of COVID-19 [8], [9] and the numerical fitting of multi-wave epidemic models [10]. The app ModInterv described here differs substantially from the aforementioned softwares in that it is a web-based application that enables the user to monitor the evolution of the COVID-19 pandemic in countries around the world as well as for states and cities in Brazil and the US, through the use of mathematical growth models, from which it can determine the current epidemic stage in the chosen location. The app can also make short-term predictions on the evolution of the epidemic curve for a given location based on the numerical fit of the growth model.

2. Software

ModInterv is a software that runs within IPython Notebook [11], an interactive computational environment that combines code execution, rich text, and plots. The code is divided into two similar major cells: one performs analyses of COVID-19 data for countries, while the second does the same for states and cities in the USA and Brazil. In each of these cells there are functions that perform specific tasks, such as fetching the data for the chosen location, plotting the empirical data, performing curve fits, and exporting the results onto figure files with different formats. To ensure its functionality, the code was tested and debugged before it was made available online.

The software workflow and its dependencies with the main Python modules used are shown in Fig. 1. IPywidgets (also known as Jupyter Widgets) [12] is a framework that provides interactive controls for Jupyter Notebooks through the use of GUI elements, the so-called widgets, which are tools displayed as part of the output of the code that allow the user to provide inputs to the software. The main widgets used by the ModInterv software are as follows: dropdown menus, to allow the user to select the type of epidemic data (cases or deaths) to be analyzed and the desired location (countries or states and cities in the USA and Brazil); checkboxes, to select which outputs of the fit the user wants to see; and sliders, to select the final date used in the fits and the time range for a short term prediction of the epidemic curve. Once the user chooses a place and type of data, the respective empirical data are fetched from a specific data repository and imported into the software as a Pandas DataFrame [13]. Empirical data for countries as well for states and counties in the USA are fetched from the database by the Johns Hopkins University [14], whereas data for Brazilian states and cities are fetched from the GitHub database maintained by Wesley Cota [15]. After the data has been imported, the corresponding time series is then transformed into a NumPy array [16] and plotted using the Matplotlib [17], a standard graphics module in Python. If the user chooses to perform the curve fit (by clicking on the appropriate button), the non-linear least square minimization problem is dealt with via the Levenberg–Marquardt algorithm implemented in Python by the LMFIT package [18]. From the best-fit curve, the software then determines the epidemic’s previous and current stages in the chosen location by computing certain characteristic dynamical points (zeros of the second to the fourth derivatives) [19] using the SciPy package [20]. While the software’s front-end is built using the IPython and IPywidgets frameworks, its back-end is provided by a binder [21] server, which builds a Docker image from an IPython notebook into an interactive executable that can be converted to an HTML file, thus rendering the software accessible for online use.

Fig. 1.

Fig. 1

Schematic representation of the ModInterv software and its dependencies with the main Python’s libraries and modules.

3. Impact overview

The ModInterv was developed by the MODINTERV-COVID19 Research Network, a research group formed by the present authors at the beginning of the COVID-19 pandemics. The software is licensed under a MIT license. The main purpose of the software is to offer an online tool for monitoring the epidemic evolution in countries around the world as well as in states and cities in Brazil and the USA, by means of reliable mathematical analyses (rather than mere visual inspection of epidemic curves). The software implements in a automated fashion phenomenological growth models to describe the empirical data and extract relevant information about the dynamics of the epidemic in the chosen location, thus contributing to a more precise assessment of the current epidemic situation in that location and its future evolution.

Since its inception, the software has been employed by members of our research network to study the COVID-19 dynamics in countries worldwide [2], [3] as well as in states and cities in Brazil [22], [23]. The software has also been used as a complementary tool of analysis by the Scientific Committee to Combat Coronavirus (C4NE in its Portuguese acronym) of the Consórcio Nordeste, a Brazilian interstate consortium formed by the Northeastern state governments [24] with the purpose of promoting sustainable development in the region and enabling the implementation of joint public policies. Over the past two years, the C4NE has published several technical bulletins about the COVID-19 situation in the Brazilian Northeastern [25] in which the ModInterv software was used (together with other methods) to analyze the epidemic evolution in the region. Extensive use of the ModInterv was made by the COVID-19 data analysis team of the Prefecture of Teresina, capital of the Brazilian state Piauí, to monitor the epidemic there. Perhaps more importantly, they have taken the model’s predictions into account in their decision making process (e.g., as to when to relax control measures), particularly during the first wave of the epidemic [26].

4. Software limitations and future improvements

Notwithstanding its proven successes, as mentioned in the preceding section, the ModInterv software can be further improved to remove some of its minor limitations. The main points that can be improved concern the wave detection algorithm and the numerical fitting procedure, as briefly discussed below.

Regarding wave detection, the main difficulty lies in finding which of the (many) local maxima and minima detected by the Python’s native signal processing module are actually local maxima and minima of the epidemic curve, rather than random fluctuations. In the current version of ModInterv we have implemented a filter based on the relative amplitudes of nearby maxima/minima to reject those that are likely due to fluctuations [19]. We are currently investigating the possibility of using a more selective algorithm recently introduced in the literature for detecting relevant maxima and minima [27]. Another difficulty stems from the often large number of parameters that need to be determined from the chosen empirical data (there are 7N2 free parameters for an epidemic curve with N waves). To avoid over-fitting, we have implemented a multi-step procedure in which we begin by fitting the first wave and then successively include data for each subsequent wave, whereby each next partial fit uses the fitted parameters from the previous step as initial guesses [19], until the entire dataset is included. This multi-step routine may, on occasion, render the numerical fit rather time consuming, especially for curves with four or more waves. It remains an open question to find more efficient optimization algorithms to speed up the best-fit routine without incurring in excessive over-fitting.

The software impact can be further augmented by extending its applications to other epidemics, such as monkeypox, measles, dengue, zika, etc. Indeed, the software behind the ModInterv app can be readily applied to any infectious disease outbreak, so long as the data are available in public repositories.

5. Conclusions

ModInterv is an online software written in Python which enables the user to monitor COVID-19 epidemic curves around the world. The software fits empirical epidemiological data with a multiwave generalized logistic model in a fully automated manner (i.e., without human assistance), thus making a sophisticated mathematical analyses accessible to any user. In this sense, the ModInterv is a unique informatics tool for monitoring the epidemic evolution and as such it should be of interest to researchers and health authorities as well as to the general public. The ModInterv has been employed by our COVID-19 Research Network in several published research papers (http://fisica.ufpr.br/redecovid19). It has also been used by technical committees (assisting government authorities) as an auxiliary tool to analyze the evolution of the epidemic in Northeastern Brazil.

CRediT authorship contribution statement

Arthur A. Brum: Conceptualization, Methodology, Software, Validation, Investigation, Data curation, Writing – original draft, Writing – review and editing, Supervision. Gerson C. Duarte-Filho: Conceptualization, Methodology, Software, Validation, Investigation, Data curation, Writing – original draft, Writing – review and editing. Raydonal Ospina: Conceptualization, Methodology, Software, Validation, Investigation, Data curation, Writing – original draft, Writing – review and editing, Supervision. Francisco A.G. Almeida: Conceptualization, Methodology, Validation, Investigation, Writing – review and editing. Antônio M.S. Macêdo: Conceptualization, Methodology, Validation, Investigation, Writing – review and editing. Giovani L. Vasconcelos: Conceptualization, Methodology, Software, Validation, Investigation, Data curation, riting – original draft, Writing – review and editing, Supervision.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

This work was supported in part by the following Brazilian agencies: Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq), under Grants No. 312985/2020-7 (GLV), No. 312612/2019-2 (AMSM), No. 305305/2019-0 (RO) and No. 167348/2018-3 (AAB), and Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) . GLV also acknowledges partial funding from UFPR through the COVID-19/PROIND-2020 Research Program. All authors have read and agreed to the published version of the manuscript.

Footnotes

The code (and data) in this article has been certified as Reproducible by Code Ocean: (https://codeocean.com/). More information on the Reproducibility Badge Initiative is available at https://www.elsevier.com/physical-sciences-and-engineering/computer-science/journals.

References

  • 1.Chowell G., Sattenspiel L., Bansal S., Viboud C. Mathematical models to characterize early epidemic growth: A review. Phys. Life Rev. 2016;18:66–97. doi: 10.1016/j.plrev.2016.07.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Vasconcelos G.L., Macêdo A.M.S., Duarte-Filho G.C., Brum A.A., Ospina R., Almeida F.A.G. Power law behaviour in the saturation regime of fatality curves of the COVID-19 pandemic. Sci. Rep. 2021;11(1):4619. doi: 10.1038/s41598-021-84165-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Vasconcelos G.L., Brum A.A., Almeida F.A.G., Macêdo A.M.S., Duarte-Filho G.C., Ospina R. Standard and anomalous waves of COVID-19: A multiple-wave growth model for epidemics. Braz. J. Phys. 2021;51(6):1867–1883. doi: 10.1007/s13538-021-00996-3. [DOI] [Google Scholar]
  • 4.World Health Organisation G.L. 2020. WHO COVID-19 dashboard. Available online: Available online:. (Last accessed on 02 August 2022) [Google Scholar]
  • 5.Dong E., Du H., Gardner L. An interactive web-based dashboard to track COVID-19 in real time. Lancet Infect. Dis. 2020;20(5):533–534. doi: 10.1016/S1473-3099(20)30120-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Cramer E.Y., Huang Y., Wang Y., Ray E.L., Cornell M., Bracher J., Brennen A., Castro Rivadeneira A.J., Gerding A., House K., Jayawardena D., Kanji A.H., Khandelwal A., Le K., Niemi J., Stark A., Shah A., Wattanachit N., Zorn M.W., Reich N.G., Consortium U.C.-.F.H. 2021. The United States COVID-19 forecast hub dataset. MedRxiv, URL https://www.medrxiv.org/content/10.1101/2021.11.04.21265886v1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.MRC Centre for Global Infectious Disease Analysis, Imperial College London E.Y. 2020. COVID-19 scenario analysis tool. www.covidsim.org, (Last accessed on 2 August 2022) [Google Scholar]
  • 8.Tavakolian A., Hajati F., Rezaee A., Fasakhodi A.O., Uddin S. Source code for optimized parallel inception: A fast COVID-19 screening software. Softw. Impacts. 2022;13 doi: 10.1016/j.simpa.2022.100337. URL https://www.sciencedirect.com/science/article/pii/S2665963822000616. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Hasani S., Nasiri H. COV-ADSX: An automated detection system using X-ray images, deep learning, and XGBoost for COVID-19. Softw. Impacts. 2022;11 doi: 10.1016/j.simpa.2021.100210. URL https://www.sciencedirect.com/science/article/pii/S2665963821000932. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Cunha A., da Conceição Batista F., de Lima Gianfelice P.R., Oyarzabal R.S., Grzybowski J.M.V., Macau E.E. epidWaves: A code for fitting multi-wave epidemic models. Softw. Impacts. 2022 doi: 10.1016/j.simpa.2022.100391. URL https://www.sciencedirect.com/science/article/pii/S2665963822000884. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Pérez F., Granger B.E. IPython: A system for interactive scientific computing. Comput. Sci. Eng. 2007;9(3):21–29. doi: 10.1109/MCSE.2007.53. URL https://ipython.org. [DOI] [Google Scholar]
  • 12.Community J.W. 2015. Ipywidgets, a GitHub repository. Retrieved from https://github.com/jupyter-widgets/ipywidgets. [Google Scholar]
  • 13.Reback J., McKinney W., Van Den Bossche J., Augspurger T., Cloud P., Klein A., Hawkins S., Roeschke M., Tratner J., She C., et al. 2020. Pandas-dev/pandas: Pandas 1.0. 5. Zenodo. [Google Scholar]
  • 14.JHU J. 2020. Coronavirus COVID-19 global cases by the center for systems science and engineering (CSSE) at Johns Hopkins university (JHU) https://coronavirus.jhu.edu/map.html. (Accessed 29 March 2020) [Google Scholar]
  • 15.Cota W. 2020. Monitoring the number of COVID-19 cases and deaths in Brazil at municipal and federative units level. SciELO Preprint, https://covid19br.wcota.me/ [Google Scholar]
  • 16.Harris C.R., Millman K.J., van der Walt S.J., Gommers R., Virtanen P., Cournapeau D., Wieser E., Taylor J., Berg S., Smith N.J., Kern R., Picus M., Hoyer S., van Kerkwijk M.H., Brett M., Haldane A., del Río J.F., Wiebe M., Peterson P., Gérard-Marchant P., Sheppard K., Reddy T., Weckesser W., Abbasi H., Gohlke C., Oliphant T.E. Array programming with NumPy. Nature. 2020;585(7825):357–362. doi: 10.1038/s41586-020-2649-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Hunter J.D. Matplotlib: A 2D graphics environment. Comput. Sci. Eng. 2007;9(3):90–95. doi: 10.1109/MCSE.2007.55. [DOI] [Google Scholar]
  • 18.Newville M., Stensitzki T., Allen D.B., Ingargiola A. 2014. LMFIT: Non-linear least-square minimization and curve-fitting for python. Zenodo. [DOI] [Google Scholar]
  • 19.Brum A.A., Vasconcelos G.L., Duarte-Filho G.C., Ospina R., Almeida F.A.G., Macêdo A.M.S. 2022. ModInterv COVID-19: An online platform to monitor the evolution of epidemic curves. MedRxiv, URL https://www.medrxiv.org/content/early/2022/06/14/2022.01.31.22270192. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Virtanen P., Gommers R., Oliphant T.E., Haberland M., Reddy T., Cournapeau D., Burovski E., Peterson P., Weckesser W., Bright J., van der Walt S.J., Brett M., Wilson J., Millman K.J., Mayorov N., Nelson A.R.J., Jones E., Kern R., Larson E., Carey C.J., Polat İ., Feng Y., Moore E.W., VanderPlas J., Laxalde D., Perktold J., Cimrman R., Henriksen I., Quintero E.A., Harris C.R., Archibald A.M., Ribeiro A.H., Pedregosa F., van Mulbregt P., SciPy 1.0 Contributors SciPy 1.0: Fundamental algorithms for scientific computing in python. Nature Methods. 2020;17:261–272. doi: 10.1038/s41592-019-0686-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Project Jupyter P., Bussonnier M., Forde J., Freeman J., Granger B., Head T., Holdgraf C., Kelley K., Nalvarte G., Osheroff A., Pacer M., Panda Y., Perez F., Ragan-Kelley B., Willing C. In: Proceedings of the 17th Python in Science Conference. Akici F., Lippa D., Niederhut D., Pacer M., editors. 2018. Binder 2.0 - Reproducible, interactive, sharable environments for science at scale; pp. 113–120. [DOI] [Google Scholar]
  • 22.Vasconcelos G.L., Duarte-Filho G.C., Brum A.A., Ospina R., Almeida F.A.G., Macêdo A. 2020. Analysis of COVID-19 epidemic curves via generalized growth models: Case study for the cities of recife and Teresina (in Portuguese) SciELO Preprints. [Google Scholar]
  • 23.Vasconcelos G.L., Duarte-Filho G.C., Brum A.A., Ospina R., Almeida F.A., Macêdo A. Situation of COVID-19 in Brazil in august 2020: An analysis via growth models as implemented in the ModInterv system for monitoring the pandemic. J. Control Autom. Electr. Syst. 2022:1–19. [Google Scholar]
  • 24.2022. Consórcio nordeste official web page. http://www.consorcionordeste-ne.com.br/. (Accessed 28 June 2022) [Google Scholar]
  • 25.2022. The thecnical bulletins are published in the section comitê científico of the following web page. http://www.consorcionordeste-ne.com.br/compras-conjuntas-combate-a-pandemia/. (Accessed 28 June 2022) [Google Scholar]
  • 26.Soares-Filho F.S., Câncio Jr. G.S. 2021. Private communication. [Google Scholar]
  • 27.Harvey J., Chan B., Srivastava T., Zarebski A.E., Dłotko P., Błaszczyk P., Parkinson R.H., White L.J., Aguas R., Mahdi A. 2022. Epidemiological waves - types, drivers and modulators in the COVID-19 pandemic. MedRxiv, Cold Spring Harbor Laboratory Press, URL https://www.medrxiv.org/content/early/2022/01/07/2022.01.07.21268513. [DOI] [PMC free article] [PubMed] [Google Scholar]

Articles from Software Impacts are provided here courtesy of Elsevier

RESOURCES