Prediction of Covid-19 Daily Case in Indonesia Using Long Short Term Memory Method

The impact of this pandemic affects various sectors in Indonesia, especially in the economic sector, due to the large-scale social restrictions policy to suppress this case's growth. The details of the growth of Covid-19 in Indonesia are still fluctuating and cannot be fully understood. Recently it has been developed by researchers related to the prediction of Covid-19 cases in various countries. One of them is using a machine learning technique approach to predict cases of daily increase Covid-19. However, the use of machine learning techniques results in the MSE error value in the thousands. This high number indicates that the prediction data using the model is still a high error rate compared to the actual data. In this study, we propose a deep learning approach using the Long Short Term Memory (LSTM) method to build a prediction model for the daily increase cases of Covid19. This study's LSTM model architecture uses the LSTM layer, Dropout layer, Dense, and Linear Activation Function. Based on various hyperparameter experiments, using the number of neurons 10, batch size 32, and epochs 50, the MSE values were 0.0308, RMSE 0.1758, and MAE 0.13. These results prove that the deep learning approach produces a smaller error value than machine learning techniques, even closer to zero.


I. INTRODUCTION
The World Health Organization (WHO) announced that the coronavirus became a global disease outbreak in all countries or what is known as a pandemic [1]. This virus attacks the human respiratory system that can cause pneumonia, and other symptoms such as fever, dry cough, decreased appetite, diarrhea, vomiting, and abdominal pain [2]. This pandemic caused a high mortality rate. Even death cases in Indonesia reached 22,555, with total cases reaching 758,473 as of January 2, 2021 [3]. Recently, cases of people infected with the coronavirus in Indonesia are increasing day by day. Even the number of victims who died reached more than 200 per day. In general, the mechanism for spreading corona cases in Indonesia is not fully known.
Modeling to find out the daily increase in case of coronavirus has become a hot topic lately. There are thousands of cases of coronavirus increased in Indonesia and the fluctuating value from day to day. Therefore, one of the techniques often used to solve predictive problems is modeling the Covid-19 case using machine learning techniques [4][5] [6]. Research conducted by Mandayam et al. [4] and Gambhir et al. [5] using supervised machine learning techniques with the Regression method. Then research by Jarndal et al. [6] using Artificial Neural Network (ANN) method. The error rate of prediction model is usually assessed by Mean Squared Error (MSE), Root Mean Squared Error (RMSE) or Mean Absolute Error (MAE) [7]. The ANN and Regression methods still produce thousands of MSE values due to data fluctuation for the increased case of thousands of domains [4] [6]. The data on the thousands increase of fluctuating Covid-19 needs to use a new predictive modeling process approach.
Artificial Intelligence can use the deep learning technique approach with the Long Short Term Memory (LSTM) method. Hochreiter and Schmidhuber proposed the LSTM method in 1997, that widely used to solve forecasting or prediction in various cases recently. The application of the LSTM method for prediction cases includes stock price prediction [8], mechanical state prediction [9], and water quality prediction [10]. The LSTM method for this prediction resulted in a value of either the MAE, MSE, or RMSE below 0.1. The error value close to zero indicates that the predicted number is getting closer to the actual result. Besides, this method is also the best model for dynamic data, which suddenly changes drastically in various cases [11]. Data on the addition of corona cases in Indonesia fluctuate in the number of thousands every day. Therefore, based on the LSTM method's success in minimizing the error value in other cases and this method is suitable for dynamic data, we propose the LSTM method to predict the Covid-19 case in Indonesia. This paper's contribution is related to the hyperparameter of the LSTM method used to predict Covid-19 data in Indonesia. The data used in this study came from Kawal Covid Indonesia [12]. The data processed in this study used daily increase cases. It is expected that the results of this study will provide a more accurate prediction representation using the LSTM method with an error value close to zero.

II. RESEARCH METHODOLOGY
Prediction of coronavirus cases in Indonesia begins with data acquisition. This study focuses on data on the daily increase cases. Before the data is processed into the next process, the data needs to be pre-processed because the Covid-19 cases fluctuate in the hundreds or even thousands. The preprocessing data results are carried out by making a model using the LSTM method. The model that is formed will be evaluated using MSE, RMSE, and MAE. The best results will be used to predict the daily increase cases. The flowchart of the coronavirus case prediction system is shown in Figure 1.

Data Acquisition
Data Pre-processing  [12]. The data to be analyzed in this study uses data on new positive cases. Covid-19 used in this study is daily time-series data from March 11, 2020 to January 4, 2021. Time series data is a series of data sets ordered by time sequence [11]. Table 1 shows the Covid-19 data used in this study. The total data used in this study was 300 days.

B. Data Pre-processing
Data pre-processing is done before the data is processed using deep learning techniques of the LSTM method. Covid-19 data is divided into data for training and data for testing. The distribution of training data and testing for prediction is 80% training data and 20% testing data. The training data is normalized using the MinMax method so that data that is too large will not affect the modeling process. The MinMax method will convert data from zero to one. The MinMax scaler formula is shown in equation 1. Table 2 shows the results of data normalization.  and can use all the information as input to the system. LSTM has an architecture consisting of input, output, and hidden layers. The hidden layer consists of memory cells. One memory cell has three gates, namely the input gate, forget gate, and output gate [14]. The input of each LSTM unit is the previous output of the LSTM. Using time series data, the Covid-19 case's prediction now depends on the previous day. The concept of the deep network in LSTM is shown in Figure 2. The implementation of LSTM in this research uses a Sequential approach. The first layer is the LSTM layer with the number of units. This research will test the number of neurons in the LSTM layer. A dropout is also applied to each layer to control overfitting. This research uses a dropout value of 0.25. The last layer is the output layer with a linear activation function. The loss parameter uses Mean Absolute Error (MAE) to find the minimum loss value in each iteration. The result of pre-processing data, 240 data is used as training data, and 60 data for testing data. The sequence data is used as input to the LSTM. Figure 3 shows the process of training data using LSTM. In this study, validation data used 20% of the total training data used. The resulting model will be evaluated with matric such as the Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) [16] [17]. These three evaluation methods are used to measure the level of error prediction results. The smaller the value (close to 0), the prediction will be more accurate.

Mean Squared Error (MSE)
The MSE expresses the difference between the original and expected values derived by the squared average difference over the data set. By calculating the errors' middle squares, the error is now calculated in squared target units, which is the average squared difference between the expected values and the actual value. In Equation 2, the MSE formula is shown.
where: ′ : predicted value : actual value : the number of observation

A. Daily Covid-19 Cases Dataset
Daily increase cases data for Covid-19 is divided into two parts as training data and testing data. Figure 4 shows the division, the green line is training data, and the brown line is testing data. This study uses 80% training data and 20% testing data. The pre-processing dataset will be processed to the next stage, namely prediction processing using LSTM. Figure 5 shows a deep learning architecture using LSTM to form a prediction model for the Covid-19 case.

Figure 5. Model Configuration
As shown in Figure 5, the LSTM model's configuration in this study is the LSTM layer, Dropout layer, Dense, and Linear Activation Function. This study uses the LSTM layer with 10, 25, 50, 100, and 200 units / hidden layers for the number of neurons. The Dropout layer functions to randomly select neurons that are dropped out or ignored during the training process. It results in other neurons having to enter to make predictions for neurons that have previously been removed. The dense layer is used to receive each neuron input from all the previous neurons to be connected, and the output will be generated on one neuron. Then, LSTM has a unique architecture to forget unnecessary information. This research uses the Linear Activation function. It takes the inputs and allows an output signal relative to the input, increased by each neuron's weights. In one way, as it requires multiple outputs, a linear function is superior to a phase function, not fair yes and no.

C. Model Evaluation
After the Covid-19 dataset is trained using the LSTM model, the next stage is testing the dataset to predict the addition of daily Covid-19 cases. In this study, we tested three hyperparameters for the prediction of daily Covid-19 cases in Indonesia. The three hyperparameters are the number of epochs, batch size, and the number of neurons. Each experiment was carried out five times because each experiment resulted in different numbers of MSE, RMSE, and MAE. The results we write down are the average of each trial.

The Experiment Number of Epochs
The first parameter in the experiment is the number of epochs. The LSTM model will use the number of neurons 25 and batch size 8. Table 3 shows the experimental results on the effect of the number of epochs.  Table 3, the higher the number of epochs, the higher the error value. The best result is achieved at the number of epochs of 50. The number of epochs of less than 50 is not a significant error value. In the next experiment, the number of epochs will be 50.

The Experiment of Batch Size
The batch size parameter controls how often the network weights change. The best results in the number of epoch experiments are at epoch 50. In the batch size experiment, 50 epochs will be used, and the number of neurons is 25. Experiments on the effect of batch size on the error value are shown in Table 4.
The batch size parameter is one of the critical factors in testing and training data. Table 4 shows the results of the larger batch size, resulting in a smaller error value. In batch sizes 16 and 32, the error value does not significantly change. Therefore, in the window size experiment, batch size 32 was selected.

The Experiment Number of Neurons
The number of neurons in the LSTM affects the training network process. In general, the greater the number of neurons makes the training process longer and the learning of structures more. However, a large number of learning processes can cause overfitting. The experiment on the number of neurons used the number of epoch 50 and batch size 32. Table 5 shows that the more neurons, the higher the error value. The number of epochs between 25 and 50 results in an error value that is not too different. In this experiment, the minimum error is obtained from the number of neurons 10.

D. Discussion
The model created produces varied MSE, RMSE, and MAE values. The most influential hyperparameters are the number of epochs and the number of neurons. The number of epochs that are more than 200 will make the error value increase or can cause overfitting. Figure 6. The Result of Daily Cases Prediction Figure 6 shows the data for daily increase cases represented by a green line and the prediction results represented by a brown line. Then in Figure 7 shows the prediction results with actual data appearing coincided. It proves that the predicted value is close to the actual value. In this study, the best results were obtained with the LSTM model using the number of neurons 10, batch size 32, and epochs 50. The best results were obtained with an MSE error value of 0.03. The use of deep learning techniques results in smaller error values than using machine learning techniques. The value of MSE using machine learning techniques is still thousands [4] [6]. Future research can modify the LSTM model to produce a minimum value of RMSE and MAE.

IV. CONCLUSION
This paper provides an overview of the prediction of the Covid-19 case in Indonesia. The number of Covid-19 cases in Indonesia has recently exploded, adding to the thousands per day. In the beginning, the addition of Covid-19 cases in Indonesia was only in units until recently, there have been thousands, and the data has fluctuated. Many previous studies used machine learning techniques, but the modeling results' error value was still thousands. This study uses a deep learning approach to the LSTM method to build a model. The deep learning approach can minimize the error value in the resulting model. Based on several experiments, the minimum error values are MSE 0.0308, RMSE 0.1758, and MAE 0.13. Based on the prediction results, as shown in Figure 6, the addition of Corona cases in Indonesia is still increasing from day to day. Through these results, we suggest that the government issue stricter policies that corona case, mostly daily cases, can be pressed again, resulting in decreased significance. Future research can modify the LSTM model in order to produce a smaller error value.

ACKNOWLEDGEMENT
The author would like to thank the Kawal Covid Indonesia team for providing updated information on the Covid-19 case in Indonesia. This paper reflects only the authors' views and declares non-financial interest.