# Short-Term Passenger Flow Prediction of Urban Rail Transit Based on a Combined Deep Learning Model
## 3 Methodology
### Long Short-Term Memory (LSTM) Model  
Long Short-Term Memory (LSTM) is a derivative network based on Recurrent Neural Networks (RNN). Compared with the original RNN, the gating mechanism is introduced, which can learn long-term dependencies in the input data. It can solve the problems of gradient disappearance, gradient explosion, and the inability to handle long-term dependencies caused by complex network layers [36]. Although the passenger flow of URT fluctuates greatly in the short-term, its passenger flow is still based on the changes of  
Figure 1: Schematic diagram of TCN model structure.  
Figure 2: Residual network structure.  
long-term passenger flow and the recent passenger flow level. The time correlation is significant. Therefore, the LSTM model can be used to make accurate predictions for short-term passenger flow. The model structure of LSTM is shown in Figure 3.  
Similar to other neural networks, LSTM also has an input layer, hidden layer, and output layer. Compared with the traditional RNN model, neurons in the hidden layer can control the current memory unit through the dependency information input at the previous time and the current time. Meanwhile, the input gate, output gate, and forget gate are added to control the sequence information of memory. The structure of the memory unit in the LSTM model is shown in Figure 4. The processing flow is: Assuming that the model is at time \(t\), the calculation completed by the memory line at time \(t\) is the passenger flow information \(C_{l-1}\) at the previous moment. According to the input \(X_{t}\) at the current moment and the output result \(h_{t-1}\) at the previous moment, the forget gate \(f_{t}\) decides to process from the previously stored information \(C_{l-1}\). The forget coefficient is used to multiply the stored information \(C_{l-1}\) bit by bit. The closer the vector \(f_{t}\) is to 0, the more dependency information will be forgotten first, while the information whose value is close to 1 is retained. The forget gate calculation formula is:  
\[f(t)=\sigma(W_{f}\times[h_{t-1},X_{t}]+b_{f}) \tag{2}\]  
where \(W_{f}\) is the weight of \(h_{t-1}\); \(b_{f}\) is the bias condition; \(\sigma\) is the Sigmoid function, and its formula is:  
\[\sigma(x)=\frac{1}{1+e^{-x}} \tag{3}\]  
After the forgetting process in the previous step, the input gate \(i_{t}\) will update the information and add it to \(C_{l-1}\) according to the input information \(X_{t}\) at the current moment and the output information \(X_{t-1}\) at the previous moment. The calculation formula of the input gate is:  
\[i_{t}=\sigma(W_{i}\times[h_{t-1},X_{t}]+b_{i}) \tag{4}\]  
where \(W_{i}\) is the weight of \(h_{t-1}\), and \(b_{i}\) is the bias condition.  
After determining the value to be updated, the dependency information \(C_{l}\) is constructed by the tanh layer, and the state value of the memory unit will be updated by combining these two steps later. The calculation formula of new dependency information is:  
\[\widetilde{C}_{t}=\tanh(W_{c}\times[h_{t-1},X_{t}]+b_{c}) \tag{5}\]  
where \(W_{c}\) is the weight The memory unit is updated by combining the calculated forget coefficient \(f_{t}\), the passenger flow dependency information \(C_{t-1}\) at the previous moment, the memory coefficient \(i_{t}\), and the new passenger flow dependency information \(\widetilde{C}_{t}\). The calculation formula is:  
\[C_{t}=f_{t}\times C_{t-1}+i_{t}\times\widetilde{C}_{t} \tag{7}\]  
The final output information is determined by the output gate according to the memory unit and the input dependency information. The calculation formula is:  
\[\left\{\begin{array}{l}O_{t}=\sigma(W_{o}\times[h_{t-1},X_{t}]+b_{o})\\ h_{t}=O_{t}\times\tanh(C_{t})\end{array}\right. \tag{8}\]  
where \(W_{o}\) is the weight of \(h_{t-1}\), and \(b_{o}\) is the bias condition.