Skip to main content

A Deep Learning Approach to Forecast SARS-CoV-2 on the Peruvian Coast

  • 696 Accesses

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 12951)


The current spreading of the SARS-CoV-2 pandemic had put all the scientific community in alert. Even in the presence of different vaccines, the active virus still represents a global challenge. Due to its rapid spreading and uncertain nature, having the ability to forecast its dynamics becomes a necessary tool in the development of fast and efficient health policies. This study implements a temporal convolutional neural network (TCN), trained with the open covid-19 data set sourced by the Health Ministry of Peru (MINSA) on the Peruvian coast. In order to obtain a robust model, the data was divided into validation and training sets, without overlapping. Using the validation set the model architecture and hyper-parameters were found with Bayesian optimization. Using the optimal configuration the TCN was trained with a test and forecasting window of 15 days ahead. Predictions on available data were made from March 06, 2020 until April 13, 2021, whereas forecasting from April 14 to April 29, 2021. In order to account for uncertainty, the TCN estimated the 5%, 50% and 95% prediction quantiles. Evaluation was made using the MAE, MAD, MSLE, RMSLE and PICP metrics. Results suggested some variations in the data distribution. Test results shown an improvement of 24.241, 0.704 and 0.422 for the MAD, MSLE and RMSLE metrics respectively. Finally, the prediction interval analysis shown an average of 97.886% and 97.778% obtained by the model in the train and test partitions.


  • Deep learning
  • SARS-CoV-2
  • Temporal convolutional neural networks
  • Time series data

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-030-86970-0_22
  • Chapter length: 16 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
USD   89.00
Price excludes VAT (USA)
  • ISBN: 978-3-030-86970-0
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   119.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.
Fig. 3.
Fig. 4.
Fig. 5.
Fig. 6.


  1. Abbasimehr, H., Paki, R.: Prediction of COVID-19 confirmed cases combining deep learning methods and Bayesian optimization. Chaos Solitons Fractals 142, 110511 (2021).,

  2. Abou-Ismail, A.: Compartmental models of the COVID-19 pandemic for physicians and physician-scientists. SN Compre. Clin. Med. 2(7), 852–858 (2020).,

  3. Anastassopoulou, C., Russo, L., Tsakris, A., Siettos, C.: Data-based analysis, modelling and forecasting of the COVID-19 outbreak. PLOS ONE 15(3), e0230405 (2020).,

  4. Bai, S., Kolter, J.Z., Koltun, V.: An empirical evaluation of generic convolutional and recurrent networks for sequence modeling (2018).

  5. Bakshy, E., et al.: AE: a domain-agnostic platform for adaptive experimentation (2018)

    Google Scholar 

  6. Balandat, M., et al.: BoTorch: a framework for efficient monte-carlo bayesian optimization (2019).

  7. Bchetnia, M., Girard, C., Duchaine, C., Laprise, C.: The outbreak of the novel severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2): a review of the current global status. J. Infect. Public Health 13(11), 1601–1610 (2020).,

  8. Chimmula, V.K.R., Zhang, L.: Time series forecasting of COVID-19 transmission in Canada using LSTM networks. Chaos Solitons Fractals 135, 109864 (2020).,

  9. Dong, E., Du, H., Gardner, L.: An interactive web-based dashboard to track COVID-19 in real time. Lancet Infect. Dis. 20(5), 533–534 (2020).,

  10. Giannis, D., Ziogas, I.A., Gianni, P.: Coagulation disorders in coronavirus infected patients: COVID-19, SARS-CoV-1, MERS-CoV and lessons from the past. J. Clin. Virol. 127, 104362 (2020).,

  11. Glorot, X., Bengio, Y.: Understanding the difficulty of training deep feedforward neural networks. In: Teh, Y.W., Titterington, M. (eds.) Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. Proceedings of Machine Learning Research, vol. 9, pp. 249–256. PMLR, Chia Laguna Resort (2010).

  12. Harrison, S.L., Fazio-Eynullayeva, E., Lane, D.A., Underhill, P., Lip, G.Y.H.: Comorbidities associated with mortality in 31,461 adults with COVID-19 in the United States: a federated electronic medical record analysis. PLOS Med. 17(9), e1003321 (2020).,

  13. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778. IEEE (2016).,

  14. Hinton, G.E., Srivastava, N., Krizhevsky, A., Sutskever, I., Salakhutdinov, R.R.: Improving neural networks by preventing co-adaptation of feature detectors (2012).

  15. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997).,

  16. INEI: Perú - Censos Nacionales 2017: XII de Población, VII de Vivienda y III de Comunidades Indígenas (2017).

  17. Ioffe, S., Szegedy, C.: Batch normalization: accelerating deep network training by reducing internal covariate shift. In: Bach, F., Blei, D. (eds.) Proceedings of the 32nd International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 37, pp. 448–456. PMLR, Lille (2015).

  18. MINSA: Casos positivos por COVID-19 - [Ministerio de Salud - MINSA] (2020).

  19. Mohimont, L., Chemchem, A., Alin, F., Krajecki, M., Steffenel, L.A.: Convolutional neural networks and temporal CNNs for COVID-19 forecasting in France. Appl. Intell. (2021).,

  20. Nair, V., Hinton, G.E.: Rectified linear units improve restricted boltzmann machines. In: Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML’10, Omnipress, Madison, WI, USA, pp. 807–814 (2010)

    Google Scholar 

  21. Paszke, A., et al.: PyTorch: an imperative style, high-performance deep learning library. In: Wallach, H., Larochelle, H., Beygelzimer, A., d’ Alché-Buc, F., Fox, E., Garnett, R. (eds.) Advances in Neural Information Processing Systems, vol. 32, pp. 8024–8035. Curran Associates, Inc. (2019).

  22. Reuters: Peru hits new COVID-19 case record as Brazilian variant spreads (2021).

  23. Smith, L.N.: Cyclical learning rates for training neural networks. In: 2017 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 464–472. IEEE (2017).,

  24. Tieleman, T., Hinton, G.: Lecture 6.5-rmsprop: divide the gradient by a running average of its recent magnitude. COURSERA Neural Netw. Mach. Learn. 4(2), 26–31 (2012)

    Google Scholar 

  25. Wieczorek, M., Siłka, J., Połap, D., Woźniak, M., Damaševičius, R.: Real-time neural network based predictor for cov19 virus spread. PLOS ONE 15(12), e0243189 (2020).,

  26. Zeroual, A., Harrou, F., Dairi, A., Sun, Y.: Deep learning methods for forecasting COVID-19 time-Series data: a comparative study. Chaos Solitons Fractals 140, 110121 (2020).,

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to I. Luis Aguilar .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Aguilar, I.L., Ibáñez-Reluz, M., Aguilar, J.C.Z., Zavaleta-Aguilar, E.W., Aguilar, L.A. (2021). A Deep Learning Approach to Forecast SARS-CoV-2 on the Peruvian Coast. In: , et al. Computational Science and Its Applications – ICCSA 2021. ICCSA 2021. Lecture Notes in Computer Science(), vol 12951. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86969-4

  • Online ISBN: 978-3-030-86970-0

  • eBook Packages: Computer ScienceComputer Science (R0)