## 4 Model Development  
This study evaluated several machine learning models, including BiLSTM, LSTM, RNN, Elman, and DLBP, based on their respective capabilities in handling sequential data and forecasting traffic flow and speed. * LSTM and BiLSTM were chosen due to their strong ability to capture temporal dependencies and non-linear relationships in traffic data. While LSTM can model long-range dependencies in time-series data, BiLSTM enhances this by learning from past and future time steps, which is particularly beneficial for capturing the bidirectional nature of traffic patterns. * RNN was used as a baseline model, offering a simple yet effective architecture for time-series forecasting. It was included to benchmark the performance of more complex models like LSTM and BiLSTM. * Elman networks, a type of simple recurrent neural network, were also evaluated to investigate the performance of less complex models in traffic prediction, providing a reference for comparison with the more advanced models. * DLBP was included to explore the potential of deep learning-based approaches in handling traffic flow prediction complexities and assess the added value of deeper architectures in this context. Different time horizons were employed (i.e., 15 min, 30 min, 45 min and 60 min) to evaluate the models' performance under both short-term forecasting conditions; the short-term forecasts aimed to capture rapid changes in traffic patterns. As discussed, while deep learning models like LSTM and BiLSTM provide significant advantages for capturing complex, non-linear relationships in traffic data, they are often considered \"black box\" models due to their lack of transparency in showing how specific input variables affect outputs [66; 67]. Although these are often seen as \"black box\" methods, the mathematical framework governing these models is well-defined. The following set of equations outlines how the model generates predictions. These equations govern the information flow through the network, which determines the model's ability to predict traffic flow, speed, and volume effectively. By incorporating these equations, the interpretability of the model can be addressed, and the underlying mechanism driving the predictions can be clarified. Long Short-Term Memory (LSTM) and Bidirectional Long-Short Term Memory (BiLSTM)  
Long Short-Term Memory (LSTM) is a type of RNN model that was developed to overcome some shortcomings of conventional RNN. Because RNNs are trained using a back-propagation algorithm, the weights are impacted in the model, leading to difficulty in predicting a longer-term relationship. Long Short-Term Memory (LSTM) overcomes this issue because it has multiple gates (input gate, output gate, and forget gate), ensuring that the hidden layer's stored values are helpful in the prediction process and pass through the output layer (Figure 5). Hence, LSTM can learn longer-term dependencies and generate better results than the RNN model. In these models, the following formulae are used to calculate the predicted values (Matlab 2021b):  
\[\text{Input gate }(\text{I}_{\text{t}})=\sigma_{\text{g}}(\text{W}_{ \text{i}}\text{X}_{\text  
prior memory values should be removed from the \"cell state\". The \"cell state\" and \"output gate\" of the LSTM at time t are calculated as follows:  
\[\text{Ct}=\text{ft}\odot\text{ct}-1+\text{it}\odot\text{gt} \tag{5}\]  
\[\text{Ht}=\text{ot}\odot\text{cc}(\text{ct}) \tag{6}\]  
where \(\odot\) denotes the Hadamard product (element-wise multiplication of vectors). Bidirectional Long-Short Term Memory (BiLSTM) is a deep learning model that has the capability to process the input data in two directions (forward and backward), i.e., the model stores the future and the past values in comparison to LSTM (Figure 6). This helps to gain a deeper knowledge of the relationships in the sequential information fed to the network.