# Pedestrian Trajectory Prediction Based on Dual Social Graph Attention Network
## 3 Methods
### Network Architecture  
The structure of the dual social graph attention network proposed in this paper is shown in Figure 1. This method consists of two branches: the spatiotemporal weighted attention network (STWGAT) branch and the spatiotemporal graph convolutional neural network (STGCN) branch. The STWGAT branch is based on the directed social attention function and is used to collect and model various interaction information between pedestrians. The STGCN branch is based on the group attention function, which identifies groups from the crowd and quantifies their interaction intensity. These two branches encode different interaction information into feature sequences. We will fuse the features encoded by these two branches into a single feature, and then use the Temporal Extrapolation Convolutional Neural Network (TXP-CNN) to perform trajectory prediction based on the encoded features.  
When constructing the graph \(G(V,E)\), we regarded pedestrians as the nodes \(V\) of the graph, and the interaction relationships between pedestrians as the edges \(E\) between the nodes.  
Figure 1: The architecture of the DSGAT network that we proposed. Our method aggregates the directed social features of pedestrians based on a directed social attention function, and quantifies group features based on a group attention function.  
We constructed two graphs to extract the scene features. The first graph is a directed graph \(G_{1}\) based on the directed social attention function for weighted calculation, where the elements \(w_{ij}\) in its adjacency matrix represent the edge from node \(i\) to node \(j\), and the size of element \(w_{ij}\) is calculated by using the directed social attention function, which directly reflects the influence of node \(i\) on node \(j\).  
The second graph is an undirected graph \(G_{2}\) constructed based on the group attention function, where the elements \(e_{ij}\) in its adjacency matrix are calculated after being determined by the group attention function, which can determine whether node \(i\) and node \(j\) belong to the same group and be used to calculate the group interaction intensity.  
After network computation, the dimensions of the graph features \(V\) for these two branches are transformed from \(T_{obs}\times 2\times N\) to \(T_{obs}\times 5\times N\). Here, \(T_{obs}\) represents the number of observed time steps, and \(N\) denotes \(N\) pedestrians. The original \"2\" refers to the positional features, \(x\) and \(y\), of the pedestrians. The model learns a bivariate Gaussian distribution from \(x\) and \(y\), introducing three additional parameters: \(\mu_{i}^{i},\sigma_{i}^{i}\), and \(\rho_{i}^{i}\). As a result, the output shape of the graph features, \(V\), for both branches of the network becomes \(T_{obs}\times 5\times N\).  
In Figure 1, the GCN (Graph Convolutional Network) functions as a spatial convolution, extracting the spatial features of pedestrians. Subsequently, the TCN (Temporal Convolutional Network) extracts temporal features, composed of 2D convolutions, batch normalization, PReLU, and Dropout. The TPCNNS is the core module in TXP-CNN for temporal extrapolation, directly expanding the temporal dimension of spatiotemporal graph embeddings through multiple layers of 2D convolutions. This approach replaces traditional recurrent structures, enabling efficient multi-step prediction with fewer parameters.