## 3 Methodologies
### CMGraph for Efficient Congestion Monitoring
#### 3.3.3 Future-Time Congestion Prediction  
The ability to get notifications in advance about potential congestion problems is a crucial aspect of crowd monitoring. To accomplish this, it is essential to predict crowd movements to identify probable congested areas. Crowd movements feature complex spatial, temporal, and social dependencies that can affect collective crowd dynamics. Essentially, the movement of several crowd groups can be viewed as several spatiotemporal signals that are non-IID, making the forecasting of such signals challenging. In this section, we present an approach that uses graph convolutional network (GCN) and recurrent neural network (RNN), each leveraging spatial and temporal signals respectively, to obtain crowd flow predictions from CMGraphs to be used for advanced congestion alerts. In many domains, numerous existing studies also deal with spatiotemporal data. Many such spatiotemporal problems are frequently solved with a combination of graph neural network (GNN) to learn the spatial features and recurrent neural network (RNN) to learn the temporal dependencies. Various combinations of GNN and RNN models have been used for spatiotemporal tasks such as pandemic forecasting [37], and more closely related to this problem, highway traffic forecasting [38; 39; 40]. However, cars commuting on highways tend to behave in a more routine manner (for instance, rush hours usually lead to heavier car flow), whereas pedestrian crowds in the public urban space have more stochastic and complex patterns, making the forecasting task even more difficult. Figure 5: (**a**) Visualization including crowd count and individual monitoring at the Grand Central Station. (**b**) Real-time congestion visualization with highlighted congestion hotspots at the Grand Central Station. The density map colors range from blue to red with red being the highest density. (**c**) Visualization including crowd count and individual monitoring at the Stanford Stadium. (**d**) Real-time congestion visualization with highlighted congestion hotspots at the Stanford Stadium. Motivated by the challenges that lie within crowd flow forecasting and the lack of deep learning-based spatiotemporal crowd flow forecasting methods, we propose a novel deep learning model, GCN-GRU that uses a combination graph convolutional network (GCN) [41] and gated recurrent unit (GRU) [42] to learn from CMGraphs and perform the crowd forecasting task. The GCN operations can be thought of as learning an embedding from spatial features resulting from the topology of the CMGraphs. The embedded graphs are used as the input to the GRU cells, which learn temporal representations from the time series data. We combine these two operations to process the spatiotemporal features resulting from complex crowd data. The architecture of the model is schematically shown in Figure 6. In the following, we describe the mathematical formulation of the problem and present the spatial and temporal operations that forecast the crowd flows with the graph neural networks. Problem Definition  
The crowd flow prediction problem can be defined as follows: Given the crowd flow information during an observed discrete time horizon \(1\) to \(T_{obs}\), the goal of crowd flow forecasting is to predict the crowd flow information during a future time horizon \(T_{obs+1}\) to \(T_{pred}\). The problem can therefore be written as the sequence generation task of learning a function that maps historical crowd flow data in a sequence of CMGraphs \(G_{1},G_{2},\ldots,G_{T_{obs}}\) to another sequence \(G_{T_{obs+1}},G_{T_{obs+2}},\ldots,G_{T_{pred}}\). Leveraging the CMGraphs, the spatial and temporal information of crowd flow are learned using GCN and GRU, respectively. Spatial Representation Learning with GCN  
For a set of \(N\) nodes in a CMGraph \(G(t)=(V(t),\ E)\), a GCN layer updates the nodal information using a node's neighboring nodal information for all nodes.