# Dynamic Graph Convolutional Crowd Flow Prediction Model Based on Residual Network Structure
## 3 Proposed Method
### Improved Conditional Convolution Module  
This paper proposes the SCondConv module, as shown in Figure 2c, which is an improvement upon the conditional convolution (CondConv) [21]. Since there is always a high similarity and correlation of OD data within neighboring time slices in the crowd flow prediction problem, the model needs to learn and exploit the contextual relationships between different locations and time steps in the spatio-temporal graph. Inspired by this, this paper captures the temporal dependence of crowd flow within neighboring time slices through the SCondConv module to enhance the correlation between the neighboring time slice data and the prediction results. The SCondConv module can dynamically adjust the size and shape of the convolutional kernel by inputting the content and contextual information of the spatio-temporal map so that the model has a more flexible perceptual field size to accommodate the extraction of feature requirements at different spatial locations and time steps, thus learning contextual relationships in the spatial and temporal information of neighboring time slices. In order to alleviate the problem of gradient disappearance caused by the deepening of the network structure, the activation function Relu in the original CondConv module is replaced by Swish to generate a new conditional convolution module in this paper. Swish is not only nonlinear but also has a smoother curve near zero, which helps alleviate the issue of gradient vanishing. Additionally, the Swish function exhibits a certain level of saturation, which can help mitigate the overfitting of the model. The Swish activation function is defined by Equation (5):  
\[Swish(x)=x\cdot Sigmoid(x) \tag{5}\]  
The execution process of the SCondConv module, as described in Equation (6):  
\[SCondConv(X_{t})=Swish((\alpha_{1}W_{1}+\ldots+\alpha_{n}W_{n})*X_{t}) \tag{6}\]  
where \(X_{t}\in R^{8*C*1*N}\) represents the crowd flow data at time t, and each \(\alpha_{i}=r_{i}(x)\) is a scalar weight associated with the sample, learned through gradient descent. Each convolutional kernel \(W_{i}\) has the same dimensions as regular convolution parameters. The variable \(n\) represents the number of experts, and \(Swish\) corresponds to the activation function defined in Equation (5). Figure 3: (**a**) GCN’s parameter weight assignments; (**b**) Assignment of parameter weights for GCN and spatial attention combinations. The weighted parameters \(\alpha_{i}=r_{i}(x)\), learned through backpropagation, exhibit data dependency. They allow the module to obtain different input functions based on different input samples. These parameters are obtained through Equation (7):  
\[r_{i}(x)=Sigmoid(GAP(x)R) \tag{7}\]  
where \(R\) represents the weight mapping matrix that combines the inputs to the n experts. In the context of predicting crowd flow in urban areas, most existing studies [8; 22; 23] grid the urban regions, transforming the time series data into a spatio-temporal graph structure to be trained by graph convolutional models. However, due to the limitations of convolutional kernels, each layer's ability to extract spatio-temporal correlations is often limited. Moreover, when the network structure of the model is deeper, the deeper layers are more prone to gradient disappearance and gradient explosion during training, resulting in poor convergence [24]. To address this challenge, [PERSON] et al. [25] proposed a residual neural network. Therefore, this paper proposes a deeper network architecture to extract features from the spatio-temporal graph and incorporates residual connections into the network. As shown in Figure 2a, the model's prediction results are connected with the SCondConv results using a residual connection. First of all, while the ScondConv module can learn contextual relationships, it can also reduce the number of parameters of the model by sharing parameters, which can speed up the training and inference of the model and make it more practical in real life.