Abstract
COVID-19 was declared a global pandemic by the World Health Organisation (WHO) on 11th March 2020. Many researchers have, in the past, attempted to predict a COVID outbreak and its effect. Some have regarded time-series variables as primary factors which can affect the onset of infectious diseases like influenza and severe acute respiratory syndrome (SARS). In this study, we have used public datasets provided by the European Centre for Disease Prevention and Control for developing a prediction model for the spread of the COVID-19 outbreak to and throughout Malaysia, Morocco and Saudi Arabia. We have made use of certain effective deep learning (DL) models for this purpose. We assessed some specific major features for predicting the trend of the existing COVID-19 outbreak in these three countries. In this study, we also proposed a DL approach that includes recurrent neural network (RNN) and long short-term memory (LSTM) networks for predicting the probable numbers of COVID-19 cases. The LSTM models showed a 98.58% precision accuracy while the RNN models showed a 93.45% precision accuracy. Also, this study compared the number of coronavirus cases and the number of resulting deaths in Malaysia, Morocco and Saudi Arabia. Thereafter, we predicted the number of confirmed COVID-19 cases and deaths for a subsequent seven days. In this study, we presented their predictions using the data that was available up to December 3rd, 2020.
Keywords: Prediction, RNN, LSTM, COVID-19, Time series
1. Introduction
The COVID-19 virus has been responsible for ≥113 million confirmed cases and ≥2.5 million deaths across the world. This virus has severely affected the economy and the public health status of the people in various countries. COVID-19 is a new form of coronavirus which has affected many people. They are called ‘corona’ viruses because when observed under the electron microscope, they showed the presence of a ‘solar corona’-like image. In the past, these viruses had triggered many outbreaks, such as the Extreme Acute Respiratory Syndrome Coronavirus (SARS-CoV) in China and the Middle East Respiratory Syndrome Coronavirus (MERS-CoV) in the Middle Eastern countries. COVID-19 is seen to be an infectious disease which is caused by Severe Acute Respiratory Coronavirus 2 (SARS-CoV-2) [1], [2]. The COVID-19 virus was initially identified in China in December 2019, after which it spread across all the countries in the world when people started coming in contact with the infected people and then travelled to different regions. It severely affects the lungs and other organs of the respiratory system in the body.
The WHO declared this disease as a pandemic during the initial phases of its transmission, indicating that it is a very severe and deadly disease [3]. It is noted that the coronavirus significantly affects the health of people and even causes death, either directly or through exacerbating pre-existing health problems. As a large proportion of people have been affected by the COVID-19 pandemic throughout the world, and there is no cure available for the disease, it becomes important to estimate the number of potential cases that may occur using available data.
Many researchers, including data scientists, have been working intensely to determine ways to eradicate this disease. Data scientists can effectively contribute to the research by designing prediction models that highlight the probable activities of this virus, which can further help in accurately predicting the spread of this virus. Hence, deep learning (DL) models are regarded as accurate tools which can help in developing prediction models. Though many neural networks (NNs) have been described in the past, the recurrent neural network (RNN) and the long short-term memory (LSTM) are investigated in the forecasting of COVID-19 as they can use temporal data [4].
In this study, RNN and LSTM deep-learning networks have been used. These networks were selected as they could analyse the time series data and accurately predict future trends [4]. These two models showed considerable success in forecasting temporal data among other traditional methods. Firstly, RNNs have been used for processing the time series and the sequential data, which are also helpful in modelling sequence data. Derived from feedforward networks, RNNs exhibit similar behaviour to how the human brain functions. Simply put, RNNs produce predictive results in sequential data that other algorithms cannot. Then, LSTMs, which have a sophisticated gated memory unit designed to handle the vanishing gradient problems in simple RNNs limiting the efficiency, have been used [5], [6], [7], [8], [9], [10].
The main contribution of this paper is that it proposes DL prediction models which can present the best results related to the prediction of confirmed positive COVID-19 cases and cases of death attributed to COVID-19 in Malaysia, Morocco and Saudi Arabia using past and current data. This study uses the Rectified Linear Unit (ReLU) activation function existing in LSTMs [11]; along with tanh and sigmoid activation functions presented in the RNN models [12]. It further predicts the number of coronavirus cases and the deaths directly resulting from this disease using NNs. These NNs used the existing datasets that contained all available data related to the COVID-19 pandemic in countries such as Saudi Arabia, Morocco and Malaysia.
This paper is structured as follows: after this introduction, the second section covers the main objectives. Section 3 covers related works on predicting COVID-19. This is followed by an explanation of the data and the research methodology in the fourth and fifth sections. The experiment set-up and the analysis of the results are introduced in 6, 7, respectively. Section 8 discusses the results and, finally, the conclusion is given in Section 9.
2. Objectives
This research paper aims to fulfil the following objectives:
-
1.
To compare and assess the performance of two NN prediction models, i.e., RNN and LSTM, for understanding which model shows a better performance while predicting the number of positive COVID-19 cases, COVID-recovered cases, and the level of mortality caused by the disease.
-
2.
To use an effective activation function that helps in achieving the best acceptable performance.
-
3.
To estimate the number of potential coronavirus cases for a subsequent seven days.
3. Related works
Dechter stated that the concept of DL was a complement of machine learning (ML) [9]. Deep learning was seen to be a subset of machine learning and even artificial intelligence (AI). The AI technique allows computers to imitate human behaviour, while ML displays similar behaviour after using data-driven algorithms. On the other hand, deep learning is regarded as the component of machine learning which is influenced by the human brain structure. This framework is called an artificial neural network (ANN). While training the model using ML, we need to determine all features which are considered by the model while differentiating between two objects. On the other hand, in DL, these features were derived by the neural networks without requiring any human interference. This degree of independence was only achieved after using a large data volume for training the machines.
For predicting the number of people who would succumb to the COVID-19 virus in the subsequent ten days, we made use of the RNN and LSTM algorithms. In an earlier study, we thoroughly reviewed the prevailing COVID-19 daily cases that used LSTM, RNN, and Gated Recurrent Unit (GRU) and successfully predicted the approximate number of deaths over the next ten days [13]. As an alternative, Zeroual, A. et al., [14] used a technique using RNN, LSTM, Bidirectional LSTM (Bi-LSTM), and GRUs that required the daily number of confirmed COVID-19 cases as the input value. This approach considered the predicted number of new contaminated and recovered cases. In another study, the researchers [15] analysed the confirmed and fatal COVID-19 cases to predict the next month’s number of cases and deaths using RNN, Stacked LSTM, Bi-LSTM and Convolutional LSTM. However, the researchers in [16] proposed an effective COVID-19 prediction model based on LSTM for the data for daily confirmed cases in both national and provincial levels in Iran. The model was able to predict the cases for a subsequent 21 days and it performed better than the other methods. Abbasimehr and Paki [17] presented a forecast of the pandemic based on LSTM and CNN with the Bayesian optimization algorithm. The model’s effectiveness was evaluated using symmetric mean absolute percentage error (SMAPE) which were 0.25 and 2.59 for the short-term (ten days ahead) and for long-term forecasting, respectively. A different forecasting model for COVID-19 was also proposed by Wang et al. using LSTM for predicting cases over the next 30 days [18].
A few machine learning algorithms were also suggested by the Shahid, F., et al., such as autoregressive integrated moving average (ARIMA), SVR and deep learning algorithms such as LSTM and Bi-LSTM to be used for forecasting cases and deaths associated with COVID-19 where the accuracy accomplished for each model revealed that Bi-LSTM generated lowest MAE and RMSE values of 0.0070 and 0.0077, respectively. [19]. The LSTM network and fully connected layer proposed by Kai-chaoMiao, et al. the network framework consists of an LSTM network and fully connected layer. In order to make the proposed LSTM framework work, the meteorological element observation data returned hourly is transferred into time series data [20]. Kai and et. al used deep supervised learning using self-adaptive auxiliary loss for COVID-19 diagnosis from imbalanced CT images [21]. Table 1 below summarises the related work.
Table 1.
Study | Year | Technique | Input | Output | Accuracy |
---|---|---|---|---|---|
Time series forecasting of COVID-19 transmission in Asia Pacific countries using deep neural networks. | January 2021 | LSTM, RNN, and GRU | Daily Confirmed Cases | Next 10 days | More than 90% |
Deep learning methods for forecasting COVID-19 time-series data: A comparative study. | November 2020 | RNN, LSTM, BiLSTM, GRUs algorithms | Daily confirmed and recovered cases collected from six countries namely Italy, Spain, France, China, USA, and Australia. | Forecasting of the number of new contaminated and recovered cases | VAE achieved MAPE values of 5.90%, 2.19%, 1.88%, 0.128%, 0.236%, and 2.04% respectively |
Time series forecasting of Covid-19 using deep learning models: India-USA comparative case study. | November 2020 | RNN, Stacked LSTM, Bi-LSTM and Convolutional LSTM | Confirmed cases and deaths | Next month | Two models with error rate ranges from 2.0 to 3.3 percent |
COVID-19 Infection forecasting based on deep learning in Iran. | November 2020 | LSTM | Daily confirmed cases in both national and province levels, in Iran | Next 21 days | LSTM model performed better than the other methods |
Prediction of COVID-19 confirmed cases combining deep learning methods and Bayesian optimization. | January 2021 | Multi-head attention, LSTM, and CNN with the Bayesian optimization algorithm | Confirmed cases and deaths | 10 days ahead | The mean SMAPE model is 0.25 for the short-term forecasting with a long horizon mean SMAPE of 2.59 |
Time series prediction for the epidemic trends of COVID-19 using the improved LSTM deep learning method: Case studies in Russia, Peru and Iran. | November 2020 | LSTM | Daily confirmed cases | Next 30 days | The proposed method can accurately analyse the trend of the epidemic. |
Predictions for COVID-19 with deep learning models of LSTM, GRU and Bi-LSTM. | November 2020 | ARIMA, SVR, LSTM and Bi-LSTM | Daily confirmed cases and deaths | Prediction of confirmed cases and deaths | Bi-LSTM generates lowest MAE and RMSE values of 0.0070 and 0.0077, respectively |
Application of LSTM for short-term fog forecasting based on meteorological elements | September 2020 | LSTM network and fully connected layer | Meteorological elements (temperature (TEMP), air pressure (AIP), wind speed (WS) …) | Fog forecasting | The proposed LSTM framework achieved 1.1%, 11%, 3%, and 11% higher performance than the best traditional machine learning algorithm. |
Deep supervised learning using self-adaptive auxiliary loss for COVID-19 diagnosis from imbalanced CT images | October 2021 | Deep supervised learning with a self-adaptive auxiliary loss (DSN-SAAL) | Chest CT | Diagnosis of COVID-19 | Outperforms the state-of-the-art methods and is effective for the predictions relating to COVID-19 in varying degrees of data imbalance. |
4. Dataset description
This research used daily confirmed cases and deaths data from Saudi Arabia, Morocco and Malaysia, which were available from the European Centre for Disease Prevention and Control1 . Firstly, this research used data from March 15, 2020, as the date of the first reported case until December 3, 2020. It contained of 816 records and its total size was 4.5 MB. The data for that period was used as follows: 80% for training and 20% for testing [22] of models to find the appropriate parameters. After training, the next step was testing. The pattern of daily confirmed cases for Saudi Arabia, Malaysia, and Morocco - COVID-19 are presented in Fig. 1, Fig. 2 shows the pattern of daily deaths cases for the three countries.
5. Methods and models
Deep neural networks are seen to be an effective technique, which could be used for automatically learning the arbitrary complex mappings from inputs to outputs. These processes support multiple inputs and outputs. Furthermore, these processes are robust to non-linear, multivariate or noisy inputs and multi-step forecasts [23]. Fig. 3 summarises the general research methodology used in this paper to provide COVID-19 predictions using deep neural networks. The special features of this study are also described below:
-
1.
All COVID-19 datasets were considered for training and testing the predictive models [24].
-
2.
To predict the confirmed cases and deaths related to COVID-19, we have used two types of DL-NN, i.e., RNNs and LSTMs. We estimated and compared the performances of the prediction models using the above NNs.
-
3.
We determined the performances of the RNNs and the LSTMs networks, using three types of activation functions, i.e., Relu, tanh, and sigmoid.
-
4.
The drawbacks of using a simple RNN have been presented below.
-
5.
The results indicated that the LSTM showed a better performance in predicting COVID-19 cases.
5.1. Recurrent neural networks (RNNs)
RNNs have been used for processing the time series and the sequential data [5]. The RNN structure included three layers, i.e., an input layer (x), output layer (y), and a hidden layer (h). The advanced feed-forward NNs are generally called RNNs since the information in the simple feed-forward NNs moves in one direction, i.e., it is transmitted from the input to the hidden layer and finally to the output layer. This information never moves in the reverse direction [6].
However, some ties in the RNNs point backwards and show that the information can move in both the forward and the backward directions [7]. These parameters are shared by the RNNs using different time-steps. They consist of loops within the layers, which indicate that a neuron can receive inputs and generate outputs for transmitting the outputs again back to itself. Thus, the RNNs use two forms of input, i.e., existing input which is indicated by xt and another input which is described as yt-1 and is generated from the outputs of the earlier time-steps [1].
In this study, we have used RNNs to model time series data associated with the COVID-19 cases occurring in three countries for a period ranging between March and December 2020. RNNs are supported by their characteristic feature of using the time series data for making future predictions. Here, we have outlined their proposed model for creating an accurate prediction model. In this section, we have investigated the process for predicting new COVID-19 cases and associated deaths for the subsequent seven days in three countries: Morocco, Malaysia and Saudi Arabia. Fig. 4 describes the proposed model and all steps undertaken for producing the model based on RNN and the exponential moving average (EMA). The major steps implemented in this model are shown in Algorithm 1.
Algorithm 1 |
---|
Input: Load dataset for pre-processing to remove the noise using EMA |
Output: Positive COVID-19 cases and deaths over seven days |
Normalize the dataset into values from 0 to 1 |
Initialize the network |
Set the no. of RNN blocks and input activation function |
Select training window size |
for n epochs and batch size do |
Train the network |
end for |
Run Predictions |
Calculate the loss function, MSE, MAE, MAPE and RMSE |
Fig. 4 presents an overview of the RNN framework. Here, the model can assist in determining the number of newCOVID-19 cases and the resulting deaths due to COVID-19. Step 1, i.e., EMA is implemented for assessing the number of confirmed COVID-19 cases using the time series for removing all noise. In Step 2, the data is categorised into two parts, and the data normalisation technique is used. Here, we carried out data normalisation for adjusting the numerical values within the dataset based on a standard scale, while ensuring that the differences within the value range were not distorted.
Thereafter, Step 3 reshapes the 1-D array in a matrix. This matrix can again be converted to form an array. Finally, it is important to initialise the network, i.e., properly set the outputs for the neurons which are initially hidden. The RNN is initialised with the 0-state value, which is also known as the steady state. With regards to the dynamic system recognition, all the above initialisation steps indicate that the system that requires modelling is in a steady state.
5.2. Long short-term memory networks (LSTMs)
RNNs cause the disappearance of the vanishing gradient point error [8], which leads to the development of a novel model called the long short-term memory (LSTM) that can handle this issue. These NNs can record the information for a longer period of time. The LSTM networks were first developed in 1997 by Horchreiter and Schmidhuber. They possess a chain-like structure having multiple repeating modules. It was noted that this RNN learning technique could effectively tolerate the avoidance of the vanishing gradient and explosion of the gradient errors by using the LSTMs-RNN process [9]. However, even this special RNN group could resolve these issues [10].
After we collected the weak results generated from the model that was based on the simple RNN technique, we implemented the LSTM-based prediction model for predicting the COVID-19 cases in the three countries. LSTMs possess certain cell states which can either selectively forget or remember things. Three gates are applicable for a cell state. The first forget gate removes all information from a cell state that it does not need. The second input gate adds vital information to a cell state. The third output gate helps in selecting all vital information and generating output [25]. The cell can store values from a random time interval, while the three gates control the complete information flow into and out of the cell. Fig. 5 describes the LSTM gates [26] while Table 2 presents the formulae used for every component at the time step, t.
Table 2.
Component | Formula | Purpose |
---|---|---|
Input Gate | = σ (. [] + ) | Control level of cell state update |
Forget Gate | Control level of cell state reset (forget) | |
Cell Candidate | Add information to cell state | |
Output Gate | Control level of cell state added to a hidden state |
Fig. 6 below presents the prediction model framework that was based on the LSTM and EMA processes.
Algorithm 2 shows the important steps that were implemented in the LSTM model as the pseudocode below.
Algorithm 2 |
---|
Input: Historical Confirmed Covid-19 cases |
Output: Predicted next seven days for n Data Points |
Data ≤ Historical Confirmed Covid-19 cases |
Function Pre-processing (Confirmed cases, sequence_length) |
Input: Confirmed cases (Dataset) |
Output: The Data is normalised and split to Train and Test |
Data_windows ≤ windows(Confirmed cases, sequence_length) |
Function Normalise(Data_windows) Normalised_data = [] |
For i in Data_windows: |
Normalised_window = [((float(p)/float (i[0])) − 1) for p in i] |
Normalised_data.append(Normalised_window) |
Return Normalised_data |
row ≤ 90% of the shape of normalised data |
Train_data ≤ [: row, : −1] |
Train_label ≤ [: row, −1] //as sequence prediction is done the same data is divided to |
Test_data ≤ [row:, : −1]//train_data, train_label, test_data and test_label. |
Test_label ≤ [row:, −1] |
Function model(a, b, epoch, batch_size) |
Input: a and b are the Train_Data and Train_label respectively. |
Output: the Trained model is obtained. |
Network = sequential () |
Network.add(LSTM(input, output, dropout)) //Input Layer of LSTM RNN |
Network.add(LSTM(cells, activation, dropout)) |
Network.add (LSTM(cells, activation, dropout)) |
Network.add(LSTM(cells, activation, dropout))n //Hidden Layers |
Network.add(LSTM(output, output_activation) //Output Layer |
Network.compile(loss_function, optimizer) //Defining Optimisation of the model |
Network.fit(a, b, epoch, batch_size, validation) //Training the model |
5.3. Evaluation metrics
We evaluated the results of the above experiments using different metrics, i.e., accuracy, mean squared error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean squared error (RMSE) [27]. Accuracy helps in calculating how often the prediction was similar to the actual label. MAE and MSE help in computing the mean absolute error value and mean squared error that is noted between the y_true and y_pred, respectively. Lastly, MAPE is defined as the measure of the prediction accuracy of the forecasting technique used in statistics, such as trend estimation. It is also used as the loss function for regression problems in ML processes.
6. Experimental setting
In this work, we have investigated the best parameter settings such as number of epochs, batch size, and neurons to achieve good prediction result for cases of and death from COVID-19 over a subsequent seven-say period. These parameters are described as follows:
-
•
Epochs: The number of epochs is a factor that defines the number of times that the learning method will function through the whole training dataset. The number of epochs is the number of full passes through the dataset of the training.
-
•
Batch size: The size of batch is a factor that defines the number of samples to work with prior to updating the variables of the internal model. The batch size refers to the number of samples processed ahead of the updating of the model.
-
•
Neurons: The number of neurons impacts the network’s learning capacity. In general, the greater the number of neurons, the greater the learning of the problem structure at the expense of a longer learning period. Greater capacity for learning also results in potential problem of overfitting the data used for training [28].
Table 3 shows the MAE, MSE, RMSE and MAPE under various numbers of parameters such as numbers of epochs, batch size and neurons for RNN and LSTM. A benchmark dataset has been used to conduct experiments and identify the appropriate variables. The dataset was obtained from the Kaggle website2 . The results show that 50 epochs with 40 batch sizes for RNN, and 70 epochs with 56 batch sizes and 7 neurons for LSTM provide adequate training. This means the training process becomes stable, and there is no benefit in increasing the number of epochs. We looked at the validation and training losses and track their values. If the validation loss increases, that means overfitting can happen. Thus, we should set the number of epochs as high as possible to avoid overfitting.
Table 3.
Experiment | Alg. | Epochs | Batch size | Neurons | MAE | MSE | RMSE | MAPE% |
---|---|---|---|---|---|---|---|---|
1 | RNN using Sigmoid | 10 | 8 | – | 5.217 | 4.579 | 7.672 | 85.49% |
2 | 20 | 16 | – | 6.489 | 5.241 | 8.468 | 91.61% | |
3 | 30 | 24 | – | 3.689 | 5.487 | 8.568 | 96.33% | |
4 | 40 | 32 | – | 5.345 | 6.023 | 7.469 | 85.51% | |
5 | 50 | 40 | – | 2.121 | 1.477 | 1.917 | 97.34% | |
6 | RNN using Tanh | 60 | 48 | – | 3.814 | 6.948 | 7.861 | 89.01% |
7 | 70 | 56 | – | 3.373 | 2.326 | 1.812 | 96.27% | |
8 | 80 | 64 | – | 2.932 | 7.804 | 7.743 | 90.95% | |
9 | 90 | 72 | – | 2.511 | 8.302 | 7.714 | 92.35% | |
10 | 100 | 80 | – | 2.763 | 8.766 | 7.625 | 93.32% | |
1 | LSTM using ReLU | 10 | 8 | 1 | 3.541 | 1.852 | 1.412 | 97.09% |
2 | 20 | 16 | 2 | 4.234 | 1.894 | 1.521 | 98.75% | |
3 | 30 | 24 | 3 | 2.402 | 2.636 | 1.701 | 98.15% | |
4 | 40 | 32 | 4 | 2.253 | 3.378 | 2.516 | 96.75% | |
5 | 50 | 40 | 5 | 1.683 | 4.121 | 1.411 | 97.34% | |
6 | 60 | 48 | 6 | 1.114 | 4.862 | 1.798 | 98.01% | |
7 | 70 | 56 | 7 | 0.544 | 1.604 | 0.726 | 99.27% | |
8 | 80 | 64 | 8 | 2.024 | 4.346 | 1.301 | 98.95% | |
9 | 90 | 72 | 9 | 2.594 | 3.088 | 1.612 | 97.05% | |
10 | 100 | 80 | 10 | 1.163 | 4.831 | 1.704 | 97.12% |
7. Results
In this section, we have presented the experimental results that were generated after the implementation and analysis of RNN and LSTM with EMA proposed prediction models. RNN and LSTM have been adopted for predicting the two parameters associated with COVID-19 cases in three countries. We determined the number of a) Confirmed COVID cases, and the b) Resultant COVID-related deaths.
We initially implemented the simple RNN model, however, it was soon discarded as it performed poorly. Thereafter, we used the LSTM-based prediction model for predicting the COVID-19 cases derived from the datasets. The LSTMs consist of cell states and actively forget or remember information. The three gates which worked in the cell state included the forget gate, input and output gates. Hence, we used these gates for developing three layers, i.e., the LSTM layer, the Dropout layer and the Dense layer for developing the LSTM model. Here, we implemented two different steps compared to simple RNN. Initially, we set a fixed random seed for reproducibility and used a rectified linear activation function (ReLU). Using the ReLU, we estimated the Keras metrics for the LSTM and derived the best results. Furthermore, we also decreased the vanishing gradient point error.
Table 4 presents the results of the RNN- and the LSTM-based prediction models. Fig. 7, Fig. 8, Fig. 9, Fig. 10, Fig. 11, Fig. 12, Fig. 13, Fig. 14, Fig. 15, Fig. 16, Fig. 17, Fig. 18 depict the graphical representation of the results. The results indicated that the LSTM-based prediction model showed a 98.53% accuracy, which was 5.13% better compared to the accuracy displayed by the RNN model.
Table 4.
Country | Algorithm | Day1 | Day2 | Day3 | Day4 | Day5 | Day6 | Day7 | MAE | MSE | RMSE | MAPE % | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Saudi Arabia | Actual | 293 | 295 | 281 | 269 | 262 | 262 | 260 | ||||||
RNN | Cases | Predicted | 307 | 308 | 295 | 283 | 276 | 276 | 274 | 13.750 | 189.128 | 13.752 | 0.950 | |
LSTM | Predicted | 291 | 298 | 296 | 270 | 260 | 256 | 262 | 4.617 | 41.746 | 6.461 | 0.983 | ||
Saudi Arabia | Actual | 16 | 16 | 15 | 15 | 14 | 14 | 13 | ||||||
RNN | Deaths | Predicted | 16 | 16 | 14 | 15 | 14 | 14 | 13 | 0.161 | 0.026 | 0.161 | 0.969 | |
LSTM | Predicted | 16 | 16 | 15 | 14 | 14 | 14 | 13 | 0.161 | 0.026 | 0.161 | 0.969 | ||
Malaysia | Actual | 935 | 1109 | 1315 | 1309 | 1212 | 1472 | 851 | ||||||
RNN | Cases | Predicted | 957 | 1119 | 1303 | 1298 | 1213 | 1437 | 876 | 16.481 | 381.864 | 19.541 | 0.955 | |
LSTM | Predicted | 942 | 1111 | 1323 | 1310 | 1210 | 1485 | 859 | 5.857 | 50.714 | 7.121 | 0.994 | ||
Malaysia | Actual | 3 | 2 | 1 | 7 | 3 | 3 | 2 | ||||||
RNN | Deaths | Predicted | 2 | 2 | 1 | 6 | 2 | 2 | 2 | 0.571 | 0.571 | 0.755 | 0.836 | |
LSTM | Predicted | 3 | 2 | 2 | 7 | 3 | 3 | 2 | 0.142 | 0.142 | 0.377 | 0.857 | ||
Morocco | Actual | 4178 | 4592 | 4412 | 4115 | 2533 | 3508 | 4346 | ||||||
RNN | Cases | Predicted | 4094 | 4474 | 4310 | 4035 | 2509 | 3462 | 4249 | 78.244 | 7063.968 | 84.047 | 0.981 | |
LSTM | Predicted | 4182 | 4582 | 4415 | 4121 | 2562 | 3518 | 4341 | 9.571 | 161.0 | 12.688 | 0.997 | ||
Morocco | Actual | 80 | 70 | 50 | 50 | 57 | 69 | 70 | ||||||
RNN | Deaths | Predicted | 78 | 69 | 50 | 50 | 57 | 68 | 69 | 0.714 | 1.012 | 1.021 | 0.991 | |
LSTM | Predicted | 82 | 71 | 51 | 51 | 57 | 70 | 70 | 0.857 | 1.142 | 1.069 | 0.986 |
8. Discussion
According to the results obtained in the previous section, it became clear to us that the technique used in the proposed prediction model (LSTM) achieved an accuracy of 98.58%, and this result is better than the second model (RNN) where there was an improvement in accuracy by 5.13% and by comparing the results of the proposed model with other studies, this can be put down to several reasons.
-
•
Gradient vanishing and exploding problems.
-
•
Training RNN is a very difficult task.
-
•
It cannot process very long sequences if using tanh or relu as an activation function [29].
Also, we found that the proposed LSTM model achieved better results, and this was due to the presence of three types of memory, the first - the Input Gate: decides which values from the input to update the memory state (take the input from tanh and input weight and apply the Sigmoid activation, then the output 0 or 1). Second, the Forget Gate decides what information to throw away from the block. The third is the Output Gate that decides what to output based on input and the memory of the block.
To improve the forecast results and what was concluded during the analysis, we noticed through the literature survey that the process of removing noise in any data depends on time (time series), as many researchers had not paid specific attention to this and ignored this step, and accordingly, some inaccurate results may appear. This caught our attention and prompted us to use the exponential moving average technique to get rid of the confusion in the data, and the results of the experiments showed better accuracy.
9. Conclusion
The COVID-19 pandemic has severely affected the lives of people in every country across the globe. This condition is getting worse in certain areas. Currently, there is no cure for this disease and even the odds of predicting the severity of this pandemic are small. Hence, deep learning models have been applied to make predictions about this disease. For this purpose, we used the time series datasets, collected from all COVID-19-affected countries, for proposing two DL-based prediction models. Two NN-based prediction models, RNN and LSTM, have been evaluated using time series data from three datasets. We used the Python language for developing and implementing the NNs. In step 1, we applied the simple RNN-based prediction model to the datasets. However, we noted that the results of the metrics varied for every execution, which led to an unstable outcome. Whenever implementing the RNN model, we noted different results, which led to a vanishing gradient point error. Thereafter, we applied the LSTM-NN process for developing another prediction model. Their results for the metrics were very promising and stable, which did not change even after numerous executions. The proposed LSTM prediction model showed a 98.53% accuracy with regards to the number of confirmed COVID-19 cases and resultant deaths. This model also decreased the vanishing gradient point error value. In future, we aim to extend this model for predicting the numbers of COVID-related cases and deaths in individual countries. We also wish to compare the DL-based and ML-based prediction models for the COVID-19 pandemic.
CRediT authorship contribution statement
Madini O. Alassafi: Conceptualization, Formal analysis, Investigation, Visualization, Methodology, Software, Writing - review & editing, Writing – original draft. Mutasem Jarrah: Conceptualization, Formal analysis, Investigation, Visualization, Methodology, Software, Writing - review & editing, Writing – original draft. Reem Alotaibi: Conceptualization, Formal analysis, Investigation, Visualization, Methodology, Software, Writing - review & editing, Writing – original draft.
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.
Acknowledgment
The authors extend their appreciation to the Deputyship for Research & Innovation, Ministry of Education in Saudi Arabia for funding this research work through the project number IFPHI-157-612-2020 and King Abdulaziz University, DSR, Jeddah, Saudi Arabia.
Biographies
Dr. Madini O. Alassafi received his B.S. degree in Computer Science from King Abdulaziz University, Saudi Arabia in 2006, and received M.S. degree in Computer Science from California Lutheran University, United State of America in 2013. He has been awarded the PhD qualification in “Security Cloud Computing” in February 2018 from University of Southampton, United Kingdom. He is currently work as an assistant professor of Information Technology department in the Faculty of Computing and Information Technology at King Abdulaziz University. His research interests span mainly around Cloud Computing and Security, Distributed Systems, Internet of Things (IoT) Security issues, Cloud Security Adoption, Risks, Cloud Migration Project Management, Cloud of Things and Security Threats. He is now Vice dean of Faculty of Computing and Information Technology at King Abdulaziz University, Jeddah, Saudi Arabia.
Dr. Mutasem Jarrah is currently an Assistant Professor in the Faculty of Computing and Information Technology. He received a B.S. from Philadelphia university in computer science - Jordan and an M.S. from the AL Balqa Applied university, in the Fuzzy logic thesis track. He received his Ph.D. from UTM in stock market prediction based on deep learning and news. His research interests span mainly Deep Learning, Machine Learning, Predictions, Classification, Regression and Time Series. https://scholar.google.com/citations?hl=en&user=DSlWGXQAAAAJ&view_op=list_works&sortby=pubdate.
Dr. Reem Alotaibi is an assistant professor at the Faculty of Computing and Information Technology, King Abdulaziz University, Jeddah, Saudi Arabia. Currently, she is the supervisor of the Information Technology department. Dr.Alotaibi received her PhD in computer science from University of Bristol, Bristol, U.K., in 2017. During 2017-2018 she was a visiting lecturer at the Intelligent Systems Laboratory, University of Bristol. Her research interests include Artificial Intelligence, Machine earning, Data mining and Crowd management. Dr. Alotaibi’s research has been funded by several sources in Saudi Arabia including Deputyship for Research & Innovation, Ministry of Education, King Abdulaziz City for Science and Technology (KACST) and Deanship of Scientifc Research (DSR), King Abdulaziz University.
Communicated by Zidong Wang
Footnotes
References
- 1.Hosseiny M., Kooraki S., Gholamrezanezhad A., Reddy S., Myers L. Radiology perspective of coronavirus disease 2019 (COVID-19): lessons from severe acute respiratory syndrome and Middle East respiratory syndrome. Am. J. Roentgenol. 2020;214(5):1078–1082. doi: 10.2214/AJR.20.22969. [DOI] [PubMed] [Google Scholar]
- 2.Kumari A., Sood M. In: Book Implementation of SimpleRNN and LSTMs Based Prediction Model for Coronavirus Disease (Covid-19) Editor, editor. IOP Publishing; 2021. Implementation of SimpleRNN and LSTMs based prediction model for coronavirus disease (Covid-19) pp. 012015. [Google Scholar]
- 3.Jamal M., Shah M., Almarzooqi S.H., Aber H., Khawaja S., El Abed R., Alkhatib Z., Samaranayake L.P. Overview of transnational recommendations for COVID-19 transmission control in dental care settings. Oral Dis. 2021;27(S3):655–664. doi: 10.1111/odi.13431. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Apaydin H., Feizi H., Sattari M.T., Colak M.S., Shamshirband S., Chau K.-W. Comparative analysis of recurrent neural network architectures for reservoir inflow forecasting. Water. 2020;12(5):1500. doi: 10.3390/w12051500. [DOI] [Google Scholar]
- 5.A. Agarwal, A. Mishra, P. Sharma, S. Jain, S. Ranjan, R. Manchanda, Using LSTM for the Prediction of Disruption in ADITYA Tokamak, arXiv preprint arXiv:2007.06230, 2020.
- 6.Song X., Liu Y., Xue L., Wang J., Zhang J., Wang J., Jiang L., Cheng Z. Time-series well performance prediction based on Long Short-Term Memory (LSTM) neural network model. J. Petrol. Sc. Eng. 2020;186:106682. doi: 10.1016/j.petrol.2019.106682. [DOI] [Google Scholar]
- 7.Van Houdt G., Mosquera C., Nápoles G. A review on the long short-term memory model. Artif. Intell. Rev. 2020;53(8):5929–5955. [Google Scholar]
- 8.Zhang R., Li G., Ma Z. A deep learning based hybrid framework for day-ahead electricity price forecasting. IEEE Access. 2020;8:143423–143436. [Google Scholar]
- 9.Kumar J., Goomer R., Singh A.K. Long short term memory recurrent neural network (LSTM-RNN) based workload forecasting model for cloud datacenters. Procedia Comput. Sci. 2018;125:676–682. [Google Scholar]
- 10.Sagheer A., Kotb M. Time series forecasting of petroleum production using deep LSTM recurrent networks. Neurocomputing. 2019;323:203–213. [Google Scholar]
- 11.Li S., Zhao D., Li Q. ‘A Framework for predicting network security situation based on the improved LSTM. EAI Endorsed Trans. Collab. Comput. 2020;4(13):165278. doi: 10.4108/eai.12-6-2020.165278. [DOI] [Google Scholar]
- 12.J. Kim, H. Kim, The impact of activation functions applying to recurrent neural network on Intrusion Detection.
- 13.Zeroual A., Harrou F., Dairi A., Sun Y. Deep learning methods for forecasting COVID-19 time-series data: a comparative study. Chaos, Solitons Fractals. 2020;140:110121. doi: 10.1016/j.chaos.2020.110121. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Shastri S., Singh K., Kumar S., Kour P., Mansotra V. Time series forecasting of Covid-19 using deep learning models: India-USA comparative case study. Chaos, Solitons Fractals. 2020;140:110227. doi: 10.1016/j.chaos.2020.110227. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.M. Azarafza, M. Azarafza, J. Tanha, Covid-19 infection forecasting based on deep learning in iran, medRxiv, 2020.
- 16.Abbasimehr H., Paki R. Prediction of COVID-19 confirmed cases combining deep learning methods and Bayesian optimization. Chaos, Solitons Fractals. 2021;142:110511. doi: 10.1016/j.chaos.2020.110511. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Wang P., Zheng X., Ai G., Liu D., Zhu B. ‘Time series prediction for the epidemic trends of COVID-19 using the improved LSTM deep learning method: Case studies in Russia, Peru and Iran. Chaos, Solitons Fractals. 2020;140:110214. doi: 10.1016/j.chaos.2020.110214. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Shahid F., Zameer A., Muneeb M. ‘Predictions for COVID-19 with deep learning models of LSTM, GRU and Bi-LSTM. Chaos, Solitons Fractals. 2020;140:110212. doi: 10.1016/j.chaos.2020.110212. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Kim M.H., Kim J.H., Lee K., Gim G.-Y. The prediction of COVID-19 using LSTM algorithms. Int. J. Networked Distrib. Comput. 2021;9(1):19. doi: 10.2991/ijndc.k.201218.003. [DOI] [Google Scholar]
- 20.Miao K.-C., Han T.-T., Yao Y.-Q., Lu H., Chen P., Wang B., Zhang J. Application of LSTM for short term fog forecasting based on meteorological elements. Neurocomputing. 2020;408:285–291. [Google Scholar]
- 21.Hu K., Huang Y., Huang W., Tan H., Chen Z., Zhong Z., Li X., Zhang Y., Gao X. Deep supervised learning using self-adaptive auxiliary loss for COVID-19 diagnosis from imbalanced CT images. Neurocomputing. 2021;458:232–245. doi: 10.1016/j.neucom.2021.06.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Wu C.-T., Chang H.-T., Wu C.-Y., Chen S.-W., Huang S.-Y., Huang M., Pan Y.-T., Bradbury P., Chou J., Yen H.-W. Machine learning recommends affordable new Ti alloy with bone-like modulus. Mater. Today. 2020;34:41–50. [Google Scholar]
- 23.H. Bansal, G. Bhatt, P. Malhotra, Systematic Generalization in Neural Networks-based Multivariate Time Series Forecasting Models, arXiv preprint arXiv:2102.05602, 2021.
- 24.European Centre for Disease Prevention and Control. <https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide>, (last accessed on 26/9/2021).
- 25.R. Chandra, A. Jain,D.S. Chauhan, Deep learning via LSTM models for COVID-19 infection forecasting in India, arXiv preprint arXiv:2101.11881, 2021. [DOI] [PMC free article] [PubMed]
- 26.Lin S., Tian H. In: Book Short-Term Metro Passenger Flow Prediction Based on Random Forest and LSTM. Editor, editor. IEEE; 2020. Short-term metro passenger flow prediction based on random forest and LSTM’; pp. 2520–2526. [Google Scholar]
- 27.Datta R.K., Sajid S.W., Moon M.H., Abedin M.Z. The Big Data-Driven Digital Economy Artificial and Computational Intelligence. Springer; 2021. Foreign currency exchange rate prediction using bidirectional long short term memory; pp. 213–227. [Google Scholar]
- 28.Yadav V., Bharadwaj V., Bhatt A., Rawal A. Data Management Analytics and Innovation. Springer; 2020. Question–answer system on episodic data using recurrent neural networks (RNN) pp. 555–568. [Google Scholar]
- 29.Ribeiro A.H., Tiels K., Aguirre L.A., Schön T. In: Book Beyond Exploding and Vanishing Gradients: Analysing RNN Training using Attractors and Smoothness. Editor, editor. PMLR; 2020. Beyond exploding and vanishing gradients: analysing RNN training using attractors and smoothness; pp. 2370–2380. [Google Scholar]