## 3 Materials and Methods
### Bidirectional Long Short-Term Memory Networks  
Network traffic data, as a type of time-series data, are characterized by the existence of the temporal continuity and dependence between data points, where adjacent time points can pass information to each other. However, with the deepening of neural network training, traditional RNNs encounter the issue of vanishing gradients, making it challenging to handle long sequence traffic data [21]. LSTM represents a specialized variant of RNN that is designed to tackle the challenge of vanishing gradients during training [22]. LSTM replaces the hidden layer nodes of an RNN with a memory control unit, which regulates the retention of important information while discarding irrelevant data. This mechanism enables LSTM networks to maintain information over longer time intervals, thus enhancing their efficacy in processing data with extended temporal contexts. Consequently, LSTM networks yield superior performance when confronted with datasets containing prolonged time spans.  
LSTM consists of three gates: the input, forgetting, and output gates [23]. Additionally, it maintains a cell state for retaining the long-term memory of flow information. The memory cell of the LSTM is shown in Figure 5.  
Figure 4: Structure of BiTCN residual block.  
Figure 5: LSTM network diagram.  
In the above figure, \(h_{t}\) denotes the hidden layer information at time \(t\), \(C_{t-1}\) represents the cell information at time \(t\), and \(X_{t}\) signifies the input traffic information at time \(t\)[24]. The specific calculation steps are as follows:  
\[f_{t}=\textit{sigmoid}\left(W_{f}\cdot[h_{t-1},x_{t}]+b_{f}\right), \tag{2}\]  
\[i_{t}=\textit{sigmoid}(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}), \tag{3}\]  
\[\widetilde{c}_{t}=\tanh(W_{\widetilde{c}}\cdot[h_{t-1},x_{t}]+b_{c}), \tag{4}\]  
\[c_{t}=f_{t}\cdot c_{t-1}+i_{t}\cdot\widetilde{c}_{t}, \tag{5}\]  
\[o_{t}=\textit{sigmoid}(W_{o}\cdot[h_{t-1},x_{t}]+b_{o}), \tag{6}\]  
\[h_{t}=o_{t}\cdot\tanh(c_{t}), \tag{7}\]  
where \(f_{t}\), \(i_{t}\), \(c_{t}\), and \(o_{t}\), are the forgetting gates, input gates, cell states, and output gates at time \(t\), respectively; \(W_{f}\), \(W_{i}\), \(W_{c}\), and \(W_{o}\) are the weights; and \(b_{f}\), \(b_{i}\), \(b_{c}\), \(b_{o}\) are the bias terms.  
The unidirectional LSTM solely retrieves the data from historical records at a specific time in the future. However, in network traffic prediction, time series forecasting necessitates not only referencing historical data from the current moment, but also considering future traffic information to achieve long-term traffic prediction. Hence, the BiLSTM model is proposed as an enhancement to the LSTM model in terms of improving prediction accuracy. The BiLSTM model comprises two independent LSTM models, which intake input traffic sequences in both forward and reverse orders to extract features, subsequently merging the output vectors of the two LSTM models to form the final output. Experimental results have demonstrated the efficacy and performance superiority of this model for traffic feature extraction compared to a single LSTM structural model [25]. The architecture of the model is depicted in Figure 6.  
The BiLSTM enhances the efficacy of traffic feature extraction and prediction performance by incorporating both historical and future traffic information.