1. Introduction
Coronaviruses are a polymorphic group of respiratory viruses that cause acute inflammatory diseases in domestic and farm animals [1]. In humans, the infection, until recently, was observed mainly in the autumn-winter period and was characterized by a mild course [2]. The situation changed dramatically in 2003, when an outbreak of atypical pneumonia caused by the pathogenic SARS-CoV was registered in China. 10 years later, a new outbreak of coronavirus emerged in the form of Middle East respiratory syndrome (MERS-CoV) [3]. The emergence of SARS-CoV2-related illnesses in December 2019 will go down in history as an international emergency that quickly developed into a pandemic in the first few months of 2020 [4]. A new coronavirus, not only new, from the point of view of its molecular and biological features, but in the context of possible difficulties in diagnosis and treatment, features of the clinical course, high risk of critical conditions and complications, high mortality [5]. The disease often leads to severe bronchopulmonary lesions, ranging from a dry debilitating cough to acute respiratory distress syndrome [6].
Coronavirus infection worsens the operative memory of most patients over the age of 25, but a year after the acute phase of COVID-19, this function is fully restored, a study by British scientists has shown [7]. At the same time, the harder a person suffers from the disease, the more his memory suffers (long-term and short-term covid) [8]. One of the most crucial elements in determining the mortality and morbidity linked to COVID-19 was how patients who required critical care were treated [9]. It is a significant issue for healthcare systems worldwide to prescribe COVID-19 medication to patients who require immediate or urgent respiratory care [10].
Machine learning to simulate cases of COVID-19 infection using an encoder-decoder and attention based on a deep regression model of long-term short-term memory is necessary to combat coronavirus infection and stop its global expansion, as well as for the rehabilitation of patients [11]. Intelligent healthcare is increasingly relying on artificial intelligence, notably machine learning algorithms. Machine learning for simulation includes networks that can learn from unlabeled or unstructured data without supervision [12]. COVID-19 applications are software applications that make extensive use of deep learning, using digital tracking to help track contacts in response to the COVID-19 pandemic, that is, the process of identifying individuals who may have been in contact with an infected person in order to prevent the wider spread of the disease. To prevent the spread of infection, three main factors must be taken into account: determining the cause, taking preventive measures and trying to develop an effective treatment [13].
In Russia, as of the end of 2022, there are more than 20 million confirmed cases and 386 thousand deaths. To date, research is continuing aimed at solving the problems associated with this disease, as well as containment mechanisms and public health policies [14]. Quarantine procedures were aimed at slowing down or stopping the spread of COVID-19, in order to improve the efficiency of medical care. In this regard, it is recommended to develop and implement public health strategies [14]. Among the set of machine learning methods based on learning representations, rather than specialized algorithms for specific tasks, are deep learning models that can help in the development of forecasting models [15]. In recurrent neural networks, the connections between the elements take the shape of a directed sequence. An artificial recurrent neural network (RNN) architecture called long-term shortterm memory (LSTM) is utilized in deep learning [16]. Although numerous neural networks (NNS) have been reported in the past and have also been able to produce an accurate prediction of what will happen in the future, RNN and LSTM are employed in SARS-CoV-2 prediction because they use transitory data [17].
The Kermak-Mckedrick model (SIR Model) is one of the simplest experimental models in which the dynamics of groups of susceptible, infected and recovered individuals is described using systems of differential equations [18]. The model consists of three "cells". S: the number of people susceptible to infection, that is, those people who are not immune to this virus and can potentially become infected. I: the number of infected at some point in time [19]. These are infected people who can infect susceptible people. R: the number of people who have been ill, have immunity, or the number of deceased persons [20]. That is, these are people who were infected and either recovered from the disease and got into a remote compartment, or died. Such a model can be used to calculate indicators such as the spread of the disease, the total number of infected or the duration of the epidemic, as well as to evaluate various epidemiological parameters, such as the reproductive number [21].
These simulations can demonstrate how different public health policies might influence the course of an epidemic, for instance, how precautions can influence the rate of COVID-19's spread [22]. The disadvantage of the Kermak-Mckedrick model is the lack of flexibility – the inability to take into account changes in parameters such as: new mutations of the virus and strain, restrictive measures, vaccination [23]. These models are based on presumptions that, given the circumstances of the SARS-CoV-2 pandemic, seem to be wrong. Hence, more advanced modeling techniques and in-depth understanding of the biology and epidemiological characteristics of the disease are required in order to predict a pandemic [24]. In addition to more conventional techniques, there are two models (RNNS and LSTM) that can forecast temporal data. Recurrent neural networks (RNNS), a form of artificial neural network built from direct communication networks that exhibits behavior resembling that of the human brain, have been used to handle time series and sequential data [25]. An advanced form of recurrent neural network design that can recognize long-term dependencies is the LSTM. The average projected errors for COVID-19 infection cases using machine learning models are almost on par with statistical model mistakes. Long-term time series can be predicted by machine learning techniques [26].
For NLP works, the Encoder-Decoder long short-term memory (LSTM) was developed. A recurrent neural network is the basis of the Encoder-Decoder architecture (RNN) [27]. When compared to other approaches in the literature, particularly those used for text translation, it performed well [28]. Current applications of the Encoder-Decoder LSTM include the prediction of power consumption [29], metal temperature [30], air pollution [31], behavior [32], and gas concentration [33]. Therefore, modern deep units must be used to create the LSTM core for Encoder-Decoder architecture. In addition, using an Encoder-Decoder architecture to anticipate the spread of a pandemic is a pressing need.
Confirmed cases of Covid-19 from the past are often input into an auto-encoding based architecture in the form of time series data. As a sequential self-learning technique, the provided sequential AE is built from a pair of independent Bi-LSTM based encoder and decoder components. Then, we use the encoding component of the proposed AE architecture to obtain the combined (backward/forward) hidden states of the input sequences, expressed as the imported number of Covid-19 instances during a particular time period [34].
In this study, we use machine learning to simulate COVID-19 infection cases in the Ural region using an encoder-decoder and attention based on a deep regression model of long-term short-term memory.
2. Methodology A. Long short-term Memory (LSTM)
LSTM networks are an improved model of recurrent neural networks (RNN), first introduced by the two scientists [35][36], the main goal of its development was to avoid the problems of simple RNN and to obtain better results. All RNN contain a series of repetitive patterns, and in traditional RNN [37], these patterns are in the form of a single layer of recurrent neurons as shown in figure 1.
Figure 1 shows how the neural network takes advantage of the lag information and the lead information of the studied phenomenon. Networks with LSTM also contain a chain, but the shape of this chain is different, as it contains 4 layers instead of 1 layer. Which is shown in figure 2.
Figure 2 explains us the mechanism work of LSTM model, the input information is passed to the forget layer, at which point the model decides to: (a) keep the information in the past and use it for prediction, or (b) forget the information and rely on the instantaneous state, then send this information to a tanh function to normalize the information and extract features and patterns and remove noise from them The main goal of designing LSTM is to reduce long-term dependency and its negative impact on the learning process. In addition to the four gates that the network depends on for its work, it helps the network to remember the most important information, which greatly improves the quality of the output [38]. The key to working with LSTM networks is the cell state, as it is considered like a conveyor belt, as it passes along the entire chain and undergoes slight changes during its passage, and therefore it is a good way to keep information unchanged.
Figure 3 shows: the state cell within the network, where LSTM networks have the ability to change information within the state cell through an architecture based on logic gates.
These gates consist of a set of neuron layers ending with a sigmoid and a set of positive multiplication operations.
The output of the sigmoid layer is between 0 and 1, and its value specifies the amount of information to be allowed to pass from each cell element. LSTM networks contain three logic gates to control the state of the cell. The LSTM model making process consists of three steps [39]:
First step: A decision is made about what information to keep and what is better to forget from the state cell, and this process takes place within the sinusoidal exponential activation function layer, which is called the forget gate [40], through the following equation:
Where 𝑓𝑡 is updated value; 𝜎 is the sigmoid layer (or nonlinear function); 𝑥𝑡 represents a sequence of length t; 𝑏 is constant bias; ℎ represents RNN memory at time step t; and 𝑊 and 𝑈 are weight matrices.
Second step: It is represented by specifying the information to be stored in the state cell and it consists of two parts: first a functional layer called input gate which is responsible for determining the changing value and second a layer that does this ends with the exponential shadow activation function Tanh forming a ray of new candidate values 𝒖𝒕. Add it to the status cell, and the next step is to merge the work of the two layers to change the value of the cell status [41]. Which is represented by the following equation:
Where 𝑖𝑡 is the updated value; 𝑢𝑡 is new candidate values; 𝜎 is the sigmoid layer (or nonlinear function); 𝑥𝑡 is a sequence of length t; 𝑏 is constant bias; ℎ is RNN memory at time step t; and 𝑊 and 𝑈 are weight matrices.
Third steps: Changes the value of the previous state cell, 𝑐𝑡−1, to the new value 𝑐𝑡, where we multiply the value of the old state by𝑓𝑡 , then add 𝑖𝑡𝑢𝑡, [42] which is the new value multiplied by the Boost rate resulting from the shadow's exponential activation function:
Where 𝑐𝑡 represents a memory cell and 𝑓𝑡 represents a value between 0 and 1 produced by the forget gate. Specifically, a value of 0 denotes that the value is nullified, whereas a value of 1 indicates that it is retained [40].
Last step: It is supposed to determine the final output and is based on the output of the state cell, but after making some adjustments: First we pass the value on the sinusoidal exponential activation function layer to determine which part of the state cell we select, then we pass the value of the cell state by the exponential activation function of the shadow and multiply it by the output of the layer of the pocket of the exponential activation function [43]:
Where 𝑜𝑡 is an output gate and ℎ𝑡 is a value between [1, -1].
B. Encoder – Decoder LSTM
Encoder – Decoder LSTM model were primarily designed to address the sequence-to-sequence problem, which is called seq2seq for short. This problem can be described as the number of sequence elements at the time of input differs from the number at the time of output, which leads to the loss of important information [44]. The modeling problem in this case is that the length of the input sequence may differ from the length of the output sequence due to the multiple lengths of the input and output steps. Accordingly, Encoder – Decoder LSTM is used, which is one of the methods that have proven effective to avoid the problem of seq2seq [45]. This architecture consists of two models: one to read the input sequence and encode it into a fixed-length vector, and a second to decode the fixed-length vector and output the predicted sequence [46][47]. Which can be merged by encoder-decoder LSTM specially designed for seq2seq problems. The main objective of the coding phase is to extract more features and information from the input time series data. The data of an asymmetric sequence of length 𝑋= {𝑥_1, 𝑥_2, . . 𝑥_𝑡 } is used as input and the encoder encodes the sequence into a fixed length state vector 𝑐, which is used as input to the decoder [45]. In the decoder stage, the decoder decodes the state vector 𝑐 and predicts the next time sequence 𝑌 by integrating the input data for the current time.
Figure 5 show us the mechanism work of Encoder – Decoder LSTM model, the hidden layer state ℎ is evolved each time the input data is read. When reading the end of the sequence 𝑋, the hidden layer variable ℎ, can be thought of as a summary of the input sequence. Which means that the features and information in the sequence have been extracted and mapped in ℎ. For Encoder part The hidden states ℎ𝑖are computed using the formula:
With this simple formula only the appropriate weights are applied to the previous hidden state ℎ𝑡−1and the input vector𝑥𝑡. For decoder part any hidden state ℎ𝑡−1is computed using the formula:
The output 𝑦𝑡at time step 𝑡 is computed using the formula:
We calculate the exits using the hidden state at the current time step together with the respective weight W(S). Softmax is used to create a probability vector that will help us determine the final output.
C. Attention LSTM
Encoder – Decoder LSTM models are widely used because of their superiority in the fields used. However, with a long sequence of inputs, as in the case of time series, the ED LSTM model encodes a fixed length input sequence [48]. This imposes limits on the length of input sequences that are in the learning phase and causes worse performance for long input sequences [49][50]. Attention is used with the aim of freeing the decoder structure from its internal fixed-length representation. The attention mechanism allows obtaining different information of first-order and lower-order importance and not just the first-order important information. It is described as mapping a query and a set of keyvalue pairs to an output, where the query, keys, values, and output are all vectors [51]. The output is computed as a weighted sum of the values, where the weight assigned to each value is computed by the query's compatibility function with the corresponding key [52].
Figure 6 show us how attention LSTM work, it includes the first step, we map 𝑥𝑡 to ℎ𝑡 :
Where 𝑓 is nonlinear activation function, ℎ𝑡 𝑅𝑡 𝑠 is hidden state at time t, s is size of hidden state, in the second step, an attention mechanism is built through a stochastic attention model. For a particular feature sequence 𝑥𝑘= (𝑥1 𝑘). From the previous hidden state ℎ𝑡−1 and cell state 𝑐𝑡−1 in the LSTM unit, it is determined [53]:
Where𝑉: is vector, 𝑊1 and 𝑊2 are matrices and both learnable parameters by model. 𝑎𝑡 𝑘: is vector has length m and its ℎ𝑡−𝑖 measures the importance of ℎ𝑘−𝑖 input features sequence at time t. and normalized by softmax. 𝛽𝑡 𝑘: is an attention weight, which contains a score of how much attention should be put on ℎ𝑘−𝐼 feature sequences.
From Figure 7, the different information in the sequence length is sent to the SoftMax function to calibrate to uniform weights. Accordingly, the output of the attention model at time t of weighted input feature 𝑢𝑡 is as follows:
Thus, the 𝑥 in equation 1 is replaced by the weights 𝑢𝑡 in the current equation to develop the attention model. It is possible to obtain attention-based time series with better features than input sequence elements.
3. Performance indicator
We use indicators to evaluate the performance of the models used to determine their ability to explain the features and information contained in the data. This is done by examining the extent to which the estimated values using the model correspond to the actual values, taking into account the avoidance of an under fitting problem that may appear from the training data, and an over fitting problem that appears through the test data. The following performance indicators include:
- Mean Square Error (MSE):
- Mean Absolute Error (MAE):
- R-Squared:
- Root Mean Square Error (RMSE):
- Relative Root Mean Square Error (RRMSE):
^ the forecast is value; 𝐲𝐭 is the actual value; and 𝐧 is the number of fitted observed. The smaller the values of these indicators, the better the performance of the model. Table 1 show us the value of the performance indicators of the test data for SARS-CoV-2 infection cases in Ural region. The results show superiority of the (encoder-decoder) LSTM models as imposing restrictions on the length of the input sequence gives better performance than varying the sequence length in the SARS-CoV-2 infection cases data.
Where 𝐲𝐭
We found from the table lower values for (MSE – MAE – RMSE – RRMSE) and this is evidence that the model data estimated from the actual data are closer in the testing phase. We also found a greater value for the coefficient of determination (R Squared), which indicates the ability of the model to capture variations in the number of SARS-CoV-2 infection cases in Ural region. Table 2 shows the most important descriptive statistics of SARS-CoV-2 infection cases in Ural region.
We note from the table 2 that the values of the mean, median, and mode differ, and this indicates that the data is not distributed according to a normal distribution, and therefore it is not possible to rely on the mean and standard deviation in interpretation because it is not robust to outliers. It is possible to rely on median that indicates that the daily rate of infections swallowed 44 cases during the daily period 12/3/2020 to 13/1/2023. The standard error in the table indicates a low value (89.9) indicating that the sample is well representative of the study population. The large size of sample variance (8388220.17) indicates significant changes in the number of SARS-CoV-2 infection cases in Ural region. As the number of infection cases developed from its minimum value (0) on 12/3/2020 to its maximum value (20539) on 12/2/2022. The value of kurtosis (20.54) indicates the Leptokurtic of the data distribution, that is, the presence of values that are far from the median. A positive skewness value (4.35) indicates that the distribution is skewed to the right, meaning that frequencies whose values are greater than the median are more than those whose values are smaller. It is expected, at a confidence level 95%, that the prediction of the number of SARS-CoV-2 infection cases in Ural region will be within the range (913±176.4). Figure 8 shows us the actual and estimated data using the (encoder-decoder) LSTM model in the training phase.
At the loss of validation, we use the model to find a convergence between the actual and estimated values, while the model is able to capture discrepancies in the actual data. By mapping, we rule out the existence of an underfitting problem in the estimate. Figure 9 show us actual and predicted value for COVID19 infection cases in ural region in testing phase, where we find a convergence between the actual values and the expected values, and the return of the number of infections to low levels after the spread of the vaccine in Ural regions. Figure 9 shows the actual and estimated data more clearly.
Figure show us actual and predicted value for COVID19 infection cases in ural region in testing phase, where we find a convergence between the actual values and the expected values, and the return of the number of infections to low levels after the spread of the vaccine in Ural regions. The following figure shows the actual and estimated data more clearly.
We observe from the figure 10 by capturing the estimation data using the (encoder-decoder) LSTM model for actual data variances and rule out an over fitting problem. Figure 11 show us actual and estimated data using Attention LSTM model on training phase.
We note that the estimation data does not capture changes in the actual data, and here, through the graph, we expect that there is an under fitting problem in the model's estimations, and therefore these results cannot be adopted. Figure 12 show us actual and estimated data using Attention LSTM model in testing phase
Figure 13 show us actual and estimated data using Attention LSTM model in testing phase, The following figure shows these estimates more clearly:
Figure 13 show us that the estimation data using the Attention LSTM model has higher variances than the variances of the actual data, and thus we conclude that there is an over fitting problem in the model estimations. Therefore, the estimates of this model cannot be supported.
4. Conclusion
As is well known, the epidemic has an impact on all countries in the world. This research paper examined the role of some deep learning approaches in assisting governmental and medical organizations. In this work, we compared two learning-based Deep Long Short-Term Memory (LSTM) approaches, namely the Encoder Decoder LSTM and Attention LSTM algorithms, to predict COVID-19 infection cases in the Ural region of Russia. The learning models were assessed based on the five popular performance assessment standards, including MSE, MAE, RMSE, RRMSE and R2. However, the deep learning predictive models based on Encoder Decoder LSTM achieved the best performance results compared to the model developed with the Attention LSTM. In order to understand, analyze and collect the latest developments in this field of research, this type of study should be conducted in the future. It can be useful for policy makers and future researchers.
Funding: “This research received no external funding”
Conflicts of Interest: “The authors declare no conflict of interest.”