## 3 Methodologies
### CMGraph for Efficient Congestion Monitoring
#### 3.3.3 Future-Time Congestion Prediction
More formally, given a node \(v_{i}\), whose node embedding vector is \(x_{i}\) (the \(i^{th}\) row of the feature matrix \(X(t)\)), and its set of neighboring nodes \(J\), a GCN layer updates the node embedding as follows:  
\[x_{i}^{(k)}=\frac{1}{|\ J|}\sum_{j\in J}x_{j}^{(k-1)} \tag{4}\]  
Figure 6: The architecture of the proposed GCN-GRU model. where \(W^{(k)}\) and \(x^{(k)}_{i}\) are a learnable parameter and the \(i^{th}\) node's updated embedding of the \(k^{th}\) layer, respectively. In the first layer (i.e., \(k=1\)), \(x^{(0)}_{i}\) is the initial feature vector of the node \(v_{i}\)\(\forall\)\(v_{i}\in V(t)\). Stacking \(K\) GCN layers allow us to update node embeddings using information aggregated from nodes in the \(K\)-hop neighborhood. After \(K\) GCN layers, we have learned the embedded graph, \(G^{\prime}(t)\), whose node embedding matrix is \(X^{\prime}(t)\), each row being the updated embedding vectors \(x^{\prime}_{i}\)\(\forall i\in V(t)\). Each node embedding vector is of an embedding dimension \(H_{\text{GCN}}\), a tunable hyperparameter. The dimension of \(X^{\prime}(t)\) is therefore \(N\times H_{\text{GCN}}\). Temporal Representation Learning with GRU  
While GCN uses spatial information and aggregates information on the relative locations of pedestrians at the same time instant, it does not deal with information in the temporal dimension. On the other hand, GRU can be used to compute hidden state representations of time series data. Mathematically, each GRU operation in a layer \(l\) can be expressed as follows:  
\[r^{(l)}_{t}=\sigma\Big{(}W_{ar}a^{(l)}_{t}+b_{ar}+W_{hr}h^{(l)}_{t-1}+b_{hr} \Big{)} \tag{5}\]  
\[z^{(l)}_{t}=\sigma\Big{(}W^{(l)}_{az}a^{(l)}_{t}+b_{az}+W^{(l)}_{hz}h^{(l)}_{t -1}+b^{(l)}_{hz}\Big{)} \tag{6}\]  
\[n^{(l)}_{t}=\tanh\Big{(}W^{(l)}_{an}a^{(l)}_{t}+b^{(l)}_{an}+r_{t}*\Big{(}W^{( l)}_{hn}h^{(l)}_{t-1}+b^{(l)}_{hm}\Big{)}\Big{)} \tag{7}\]  
\[h^{(l)}_{t}=\Big{(}1-z^{(l)}_{t}\Big{)}*n^{(l)}_{t}+z^{(l)}_{t}*h^{(l)}_{t-1} \tag{8}\]  
where \(W^{(l)}_{ar}\), \(W^{(l)}_{hr}\), \(W^{(l)}_{az}\), \(W^{(l)}_{hz}\), \(W^{(l)}_{an}\), \(W^{(l)}_{hm}\), \(b^{(l)}_{ar}\), \(b^{(l)}_{hr}\), \(b^{(l)}_{hz}\), \(b^{(l)}_{hz}\), \(b^{(l)}_{han}\), \(b^{(l)}_{hm}\) are learnable parameters of the \(l^{th}\) layer. \(a^{(l)}_{t}\) and \(h^{(l)}_{t}\) are the input and output hidden states of the \(l^{th}\) layer at time \(t\), respectively. At \(l=1\), \(a^{(l)}_{t}\) is the output from the GCN part, \(X^{\prime}(t)\). At \(l>1\), \(a^{(l)}_{t}\) is the hidden state from the previous layer \(h^{(l-1)}_{t}\). Moreover, \(h^{(l)}_{t-1}\) is the hidden state of the \(l^{th}\) layer at time \(t-1\), except initialized to \(0\) when \(t=1\). \(\sigma\) is the sigmoid function. \(r^{(l)}_{t}\), \(z^{(l)}_{t}\), \(n^{(l)}_{t}\) are the reset, update, and new gates of the \(l^{th}\) layer, respectively. \(*\) denotes element-wise multiplication. The final output at time \(t=T_{obs}\) after \(L\) GRU layers are then \(h^{(L)}_{T_{obs}}\), a vector with a length \(H_{GRU}\), a tunable hyperparameter. To compute a sequence of predictions from \(T_{obs+1}\),...,\(T_{pred}\), the output is passed through a fully connected (FC) layer to obtain a vector of the desired sequence length.