# MTGNet: Multi-Agent End-to-End Motion Trajectory Prediction with Multimodal Panoramic Dynamic Graph
## 3 Methodology
### Global Interaction Encoder
We divide high-interaction scenarios and sparse-interaction scenarios according to the agent density \(\rho^{t}\) and interaction intensity \(I^{t}\):  
\[\rho^{t}=\frac{N}{L\times D} \tag{12}\]  
\[I^{t}=\frac{1}{N}\sum_{i=1}^{N}\sum_{i\in N_{i}}e_{i,j}^{t} \tag{13}\]  
Here, \(\rho^{t}\) represents the agent density within a region of \((L\times D)\) m\({}^{2}\). \(L\) is the length and \(D\) is the width of the rectangular region used for calculating the agent density. \(I^{t}\) represents the strength of the interaction between agents. \(e_{i,j}^{t}\) represents the edge weight between node \(i\) node \(j\) at time step \(t\). When \(\rho^{t}\) exceeds a predefined density threshold \(\rho^{\text{threshold}}\) and \(I^{t}\) exceeds a predefined interaction intensity threshold \(I^{\text{threshold}}\) the scenario is defined as a high-interaction scenario. These thresholds \(\rho^{\text{threshold}}\) and \(I^{\text{threshold}}\) can be dynamically adjusted according to different data characteristics, enabling the model to adapt to various real-world traffic or agent-based scenarios more effectively. \(e_{ij}=c_{j}-c_{i}\)  
To handle the different weights and local relationships of nodes in the graph, we use a graph convolutional network (GCN) instead of a simple fully connected layer [4]. GCN can not only capture the global relationships between nodes but also emphasize more important node interactions in local neighborhoods, avoiding the practice of treating all nodes equally in the fully connected layer. The node features are combined with the edge features through the adjacency matrix to effectively extract local and global information. Each graph convolution layer propagates information through the message-passing mechanism to update the node features. It can capture the mutual relationships between each agent and other agents. As an important extension of the message-passing mechanism in graph neural networks, the Graph Attention Network (GAT) proposed by [PERSON] et al. [46] further emphasizes the attention mechanism on neighboring nodes during the message-passing process, which also reflects the diversity and development of the message-passing mechanism in the field of graph neural networks. The message transmission process between node i and its neighbor node j can be expressed as:  
\[m_{ij}=\sigma\big{(}W_{i}\cdot\left[h_{i},h_{j},e_{ij}\right]\odot softplus \big{(}W_{s}\cdot\left[h_{i},h_{j},e_{ij}\right]\big{)}\big{)} \tag{14}\]  
Here, mij represents the message from node i to node j.  
Wf and Ws are the linear transformation weight matrices for edge features and node features, respectively. hij and hij are the feature vectors of nodes i and j, respectively. \(\rm{e_{ij}}\) is the edge feature between node i and node j.  
\[e_{ij}=c_{j}-c_{i} \tag{15}\]  
Among them, \(\rm{c_{i}}\) and \(\rm{c_{j}}\) are the feature vectors of nodes i and j, respectively. In this way, edge features can express the displacement and relative motion between agents, providing effective input for the feature extraction of graph neural networks. After passing through the graph convolution layer, we can perform subsequent calculations on each node in turn and reconstruct it into a new panoramic vehicle connection network by reconnecting it, which displays the initial position and the offset of the final position.