Introduction: The COVID-19 pandemic highlighted the critical need for accurate forecasting models to inform public health decision-making. This study compares the performance of three time series techniques—Long Short-Term Memory (LSTM) networks, Transformer models, and Autoregressive Integrated Moving Average (ARIMA)—in predicting the spread of COVID-19.
Methods: We trained and evaluated LSTM, Transformer (Temporal Fusion Transformer), and ARIMA models using the publicly available Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE) COVID-19 Data Repository, encompassing confirmed cases, deaths, vaccination rates, and relevant socio-economic factors. Model performance was assessed using mean absolute error (MAE) and root mean squared error (RMSE) for 7-day and 14-day forecasting horizons.
Results and Discussion: The Transformer-based model consistently outperformed both the LSTM and ARIMA models in terms of forecasting accuracy. For 7-day forecasts, the Transformer achieved an MAE of 85 cases per 100,000 population and an RMSE of 120, while LSTM had an MAE of 90 and RMSE of 125 and ARIMA had an MAE of 105 and RMSE of 155. For 14-day forecasts, the Transformer maintained its superior performance with an MAE of 110 and RMSE of 150, compared to LSTM (MAE of 115 and RMSE of 155) and ARIMA (MAE of 138 and RMSE of 178). The Transformer's ability to capture long-range dependencies and incorporate diverse data sources contributed to its improved performance. Notably, all models were able to capture sudden shifts in the spread of the virus, enabling timely alerts for potential outbreaks.
Conclusion: This study demonstrates the superior performance of Transformer-based models in forecasting the COVID-19 pandemic compared to LSTM and ARIMA models. The findings underscore the potential of Transformers in epidemiological modelling and highlight the importance of leveraging advanced deep learning techniques for accurate and timely predictions in public health crises. Further research will explore the integration of additional data sources and model refinements to enhance forecasting capabilities for future outbreaks.