## 2 Materials and Methods
### Deep Learning with RNN-LSTM Network  
Different from the conventional neural network, LSTM (long short-term memory) network is designed to learn long-term interactions and recall information for long period of time by avoiding the long-term dependency problem. It was first proposed in [32] with a unique four layered communication structure, which consists of blocks of memory called cells where two number of states are transmitted to the next cell as the cell state and the hidden state. The cell state is the basic element of data stream, which provides forward transmission with little change in the data due to some linear transformations. Additionally, data can be manipulated (adding or removal of data) from the cell state by means of the sigmoid gates, which are actually designed as the series of matrix operations with varying individual weights. On the other hand, LSTMs are well known for their excellent performance on time series classification. LSTMs are capable of learning long-term dependencies and also prevent back-propagated errors from vanishing or exploding, thus avoiding the vanishing gradient problem. Recurrent Neural Networks (RNNs) have the capability to capture temporal information from both sequential and spatial sequential data. Therefore, RNN-based LSTMs can simulate long windows of activity by replacing RNNs with LSTM storage locations [33; 34]. The downside of RNNs is the problem of gradient explosion and decay, which interferes with the network's ability to model the \begin{table}
\begin{tabular}{c c c} \hline \hline
**Input Vector** & **DCT Coefficients** & **Inverse DCT Transform** \\ \hline
72 & 227.68398 & 71.99998 \\ \hline
167 & 39.59834 & 167.00004 \\ \hline
15 & 37.25152 & 14.99992 \\ \hline
138 & 5.45163 & 138.00001 \\ \hline
19 & \(-\)31.71883 & 19.00003 \\ \hline
43 & \(-\)0.63242 & 42.99998 \\ \hline
51 & 30.07613 & 51.00003 \\ \hline
120 & \(-\)89.54173 & 120.00009 \\ \hline
10 & \(-\)41.78117 & 9.99995 \\ \hline
85 & \(-\)111.25713 & 85.00000 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Lossy discrete cosine transform (DCT) operations for sample inputs. wide temporal relationships between input from a long contextual window and human activity [35]. The structure of the LSTM neural network is shown in Figure 6 as follows. In the above figure, \(X_{t}\) is current input, \(C_{t-1}\) is memory from the LSTM unit, \(h_{t-1}\) is output of last LSTM unit, \(C_{t}\) is new updated memory, \(h_{t}\) is current output, \(\sigma\) is sigmoid layer, _tanh_ is _Tanh_ layer, \(b\) is bias, \(\times\) is scaling of information, and \(+\) is adding information. The equations of a typical LSTM network are given below:  
\[f_{t}=\sigma\big{(}W_{f}[h_{t-1},X_{t}]+b_{f}\big{)} \tag{5}\]  
\[i_{t}=\sigma(W_{i}[h_{t-1},X_{t}]+b_{i}) \tag{6}\]  
\[N_{t}=tanh(W_{n}[h_{t-1},X_{t}]+b_{n}) \tag{7}\]  
\[C_{t}=C_{t-1}f_{t}+N_{t}i_{t}. \tag{8}\]  
Sigmoid function \(\sigma\) is employed for determining which information is not necessary and should be eliminated from the network. Therefore, it gets two arguments as the old output \(h_{t-1}\) at time \(t-1\) and new input \(X_{t}\) at time t. Forget gate \(f_{t}\), which is a vector of values between 0 and 1, is employed to decide whether the old output should be modified or partially eliminated for each cell state \(C_{t-1}\) with weight matrices \(W_{f}\) and bias \(b_{f}\). For each new input, sigmoid layer and _tanh_ function are employed to determine the importance of information by giving 1 for update operation and 0 for ignorance. Additionally, values to be updated are quantized with weights between \(-1\) and 1 depending on their level of importance. Finally, new cell state \(C_{t}\) is updated from the old cell state \(C_{t-1}\) using the prior information obtained from the network. LSTM's have two disadvantages, i.e., requires high dimensional feature vectors and high number of instances in the training set.