## 2 Integrated Predictive Traffic Resilience Framework
### Augmented LSTM-Based Traffic Prediction  
Numerous algorithms and frameworks have been developed for traffic prediction. In this paper, we adopt an augmented LSTM with the Kalman Filter approach (see Figure 2) to predict correlated and spatiotemporal traffic data and to account for model uncertainty. This framework is similar to the one proposed in ref. [24]. It is important to note that the proposed framework is not limited to LSTM-based algorithms; other traffic prediction algorithms could also be utilized to forecast future traffic conditions. This LSTM-based algorithm uses a spatiotemporal traffic volume dataset to predict hourly volume over different traffic segments and routes. Initially, both spatial and temporal trends of the dataset are extracted and fed to the LSTM neural network to predict the trends separately. The details of the spatiotemporal data extraction process can be found in ref. [24]. Additionally, the architecture and details of a standard LSTM algorithm are detailed in refs. [25; 26]. In short, the prediction of the standard LSTM algorithm can be formulated as:  
\[\mathbf{i}_{t}=\sigma(\mathbf{W}_{i}[\mathbf{h}_{t-1},\,\mathbf{x}_{i}]+\mathbf{b}_{i}) \tag{5}\]  
Figure 2: An augmented LSTM algorithm with Kalman Filter approach [24]. \[f_{t}=\sigma\Big{(}\mathbf{W}_{f}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\mathbf{b}_{f}\Big{)} \tag{6}\]  
\[\widetilde{c_{t}}=\tanh(\mathbf{W}_{c}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\mathbf{b}_{c}) \tag{7}\]  
\[c_{t}=f_{t}\circ\mathbf{c}_{t-1}+\mathbf{i}_{t}\circ\widetilde{c_{t}} \tag{8}\]  
\[\mathbf{o}_{t}=\sigma(\mathbf{W}_{o}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\mathbf{b}_{o}) \tag{9}\]  
\[\mathbf{h}_{t}=\mathbf{o}_{t}\circ\tanh(\mathbf{c}_{t}) \tag{10}\]  
where \(\mathbf{i}_{t}\) is the input gate vector, \(\mathbf{f}_{t}\) is the forget gate vector, and \(\widetilde{c_{t}}\) is the input modulation vector for the memory cell. \(\mathbf{c}_{t}\), \(\mathbf{o}_{t}\), \(\mathbf{h}_{t}\), and \(\mathbf{x}_{t}\) denote the memory cell vector, the output gate vector, the hidden state vector, and the input vector at time \(\mathbf{t}\). \(\mathbf{W}_{i}\), \(\mathbf{W}_{f}\), \(\mathbf{W}_{c}\), and \(\mathbf{W}_{o}\) refer to the weight matrices for the input gate, forget gate, memory cell, and output gate. Similarly, \(\mathbf{b}_{i}\), \(\mathbf{b}_{f}\), \(\mathbf{b}_{c}\), and \(\mathbf{b}_{o}\) are the bias vectors for the input gate, forget gate, memory cell, and output gate, respectively. Sigmoid functions are typically used as the activation functions for all three gates (input gate \(\mathbf{i}_{t}\), forget gate \(\mathbf{f}_{t}\), and output gate \(\mathbf{o}_{t}\)). The sigmoid function has an output value between 0 and 1, indicating no flow or a complete flow of information when activated. When the input gate \(\mathbf{i}_{t}\) activates, the new input information is stored in the cell. \(\mathbf{i}_{t}\) is obtained from the sigmoid function over the past hidden state vector \(\mathbf{h}_{t-1}\), the present input vector \(\mathbf{x}_{t}\), the weight matrix \(\mathbf{W}_{i}\), and the bias vector \(\mathbf{b}_{i}\). If the forget gate \(\mathbf{f}_{t}\) is activated, the past cell state \(\mathbf{c}_{t-1}\) will be forgotten. In this step, the decision is made on what information needs to be forgotten by using a sigmoid function over \(\mathbf{h}_{t-1}\), and \(\mathbf{x}_{t}\). The weight matrix for the forget gate is \(\mathbf{W}_{f}\), and the bias vector is \(\mathbf{b}_{f}\). By using the activation function tanh over \(\mathbf{h}_{t-1}\), and \(\mathbf{x}_{t}\), an input modulation vector \(\widetilde{c_{t}}\) can be calculated. The tanh function results in either positive or negative outputs, which refer to allowing an increase or decrease in the state. In this step, the weight matrix is \(\mathbf{W}_{c}\), and the bias vector is \(\mathbf{b}_{c}\).