4.1. Network Architecture
To bridge the gap in previous research, we propose the Multi-Scale Spatiotemporal Dynamic Hypergraph Transformer (MST-Hyper Trans). The novelty of our work lies in its integrated approach to dynamic multi-relation learning across spatial and temporal dimensions. Specifically, unlike prior works, (1) our model introduces a novel multi-scale temporal hypergraph (MSTHCN) to explicitly decouple and capture periodic and cross-modal temporal interactions at multiple granularities (e.g., hour, day, week). (2) We design a dynamic multi-relation spatial hypergraph network (DMRSHN) that integrates geographic proximity, passenger flow similarity, and transportation connectivity to construct both structural and dynamic hyperedges, enabling adaptive learning of high-order spatial correlations among heterogeneous nodes. (3) We introduce a Conditional Meta Attention Gated Fusion Network (CMAGFN) that dynamically generates and fuses features based on real-time context, moving beyond static fusion strategies. As shown in
Figure 3, the model consists of three core modules, forming an end-to-end prediction process. This holistic framework represents a significant step towards accurate and interpretable collaborative forecasting for multi-modal urban transportation systems.
Firstly, the Multi-Scale Temporal Hyperedge Convolutional Network (MSTHCN) is responsible for handling the complexity of the temporal dimension. It effectively captures the periodic and trend patterns of transportation demand at different time granularities (such as hour, day, week) by constructing multi-scale temporal hypergraphs. The internal temporal attention mechanism can adaptively balance the contributions of different scale features, providing the model with powerful temporal representation capabilities. Secondly, the Dynamic Multi-Relationship Space Hypergraph Network (DMRSHN) focuses on modeling high-order dependencies between heterogeneous spatial units. This module integrates multiple semantic relationships, such as geographic proximity, passenger flow similarity, and transportation connectivity, to construct structural hyperedges, and generates dynamic hyperedges through KNN and K-means algorithms to capture spatial correlations that evolve with traffic conditions. The further introduction of a relationship-aware attention mechanism and a hierarchical hypergraph convolution structure achieve refined extraction and fusion of multi-relationship spatial features. Finally, the Conditional Meta Attention Gated Fusion Network (CMAGFN) serves as the decision core of the model, replacing the traditional static fusion approach. This lightweight meta network takes real-time context (such as time, weather, and real-time demand) as input and dynamically generates parameters. Through its core multi-head cross-attention gating mechanism, CMAGFN can adaptively calibrate the fusion weights of intra-mode features and cross-mode spatiotemporal features at the feature dimension level based on the current traffic scene, thereby achieving optimal prediction decisions.
MST-Hyper Trans has completed the complete prediction process from multi-scale temporal feature extraction, dynamic spatial relationship modeling, to context-aware fusion through the collaborative work of MSTHCN, DMRSHN, and CMAGFN modules, significantly improving the ability to accurately predict complex multi-modal transportation systems.
4.2. Multi-Scale Temporal Hypergraph Convolutional Network
To accurately capture the complex multi-scale temporal dependencies in multi-modal transportation demand, we propose the Multi-scale Time Series Hyperedge Convolutional Network (MSTHCN) module. This module significantly enhances the model’s ability to extract periodic, trending, and cross-modal temporal interaction features in transportation demand by combining hypergraph structure modeling with multi-scale temporal analysis. The MSTHCN method addresses the limitations of existing multi-scale temporal models (e.g., TCN) by leveraging multi-scale dynamic hyperedge merging to capture high-order temporal correlations and an attention mechanism for adaptive feature fusion, enabling real-time responsiveness to demand fluctuations in multi-modal traffic systems while mitigating overfitting. The overall structure of the MSTHCN core process includes three parts: multi-scale hyperedge construction, multi-scale temporal hypergraph convolution, and attention-driven fusion. Its structure is shown in
Figure 4.
Inspired by multi-scale time series analysis methods, MSTHCN constructs hyperedges through grouping strategies (such as 1 h and 2 h granularity) and merges similar hyperedges (DSC > 0.8), which is more flexible than TCN’s fixed convolution kernel and can capture the periodicity of traffic demand (such as daily/weekly patterns). Specifically, for historical demand data
, we grouped them by week and hour dimensions to generate four different time scale partitioning schemes: 1 h granularity (7 × 24 groups), 2 h granularity (7 × 12 groups), 3 h granularity (7 × 8 groups), and 4 h granularity (7 × 6 groups). Within each group, we retain the 40% data points with the highest and lowest demand values to form initial hyperedges in order to capture extreme traffic modes. Next, use the Sørensen–Dice coefficient (DSC) [
44] to calculate the similarity between hyperedges:
When the DSC value exceeds the threshold of 0.8, merge similar hyperedges to obtain a simplified hyperedge set , where represents the scale type, and is the hyperedge index. This design enables the model to adaptively capture multi-level time patterns from short-term fluctuations to long-term trends.
Multi-modal traffic data exhibits spatiotemporal heterogeneity. MSTHCN models high-order temporal correlations directly through hypergraph convolution, overcoming the limitation of traditional graph convolution that only deals with pairwise relationships. We use Spectral Hypergraph Convolutional Networks (HGNNs) [
14] to separately process the temporal features within and between patterns. For the input signal
within the pattern and the signal
between patterns, the hypergraph convolution operation is defined as:
where
and
are hypergraph correlation matrices with self-loops added,
and
are the degree matrices of nodes and hyperedges, respectively, and
is the learnable convolution kernel parameter. This process captures high-order temporal correlations between nodes through the hypergraph Laplacian operator, overcoming the limitation of ordinary graph convolution that can only model pairwise relationships.
To dynamically integrate temporal features within and between patterns, we introduce node-level attention weights to dynamically balance intra- and inter-mode features, while existing methods, such as multi-resolution attention, often rely on static weights. For node
, the attention weights of its intra- and inter-pattern features
and
are calculated as follows:
where
,
,
, and
are learnable parameters. The temporal characteristic output of the final node
is:
This mechanism enables the model to adaptively adjust weights based on the current traffic context, highlighting dominant time patterns.
4.3. Dynamic Multi-Relation Spatial Hypergraph Network
Previous methods have had difficulty handling the complex heterogeneous spatial relationships between nodes in multi-modal transportation networks, as well as the characteristics of local and global relationships. The DMRSHN module captures complex high-order spatial dependencies between heterogeneous units (e.g., taxi regions and subway stations) by integrating domain knowledge via multi-relationship structured hyperedges, coupled with a relationship-aware attention mechanism and hierarchical hypergraph convolution for dynamic multi-scale spatial modeling. The DMRSHN module captures the complex high-order spatial relationships between multi-modal traffic nodes in the urban transportation system, as shown in
Figure 5. The core of this network is to handle the dynamic evolution of multiple relationships (geographical proximity, passenger flow similarity, transportation connections), and to use hypergraph networks for high-order correlation modeling in the spatial domain, which can adaptively learn the spatial interactions between stations or regions under different transportation modes.
Firstly, the construction process of various structural hyperedges in the DMRSHN module’s multi-relationship structure hyperedge layer is introduced. The structural hyperedges mainly include geographical proximity hyperedges, passenger flow similarity hyperedges, and transportation connectivity hyperedges. The correlation matrix is mainly calculated between multi-mode transportation nodes, and then multiple hyperedges are obtained through threshold limitation. The calculation process of the relationship matrix is as follows:
- (1)
Geographical Distance Embedding: For nodes
and
, which are spatial units categorized as regions, we define their distance matrix as
. For nodes
and
, which are spatial units categorized as sites, we define their distance matrix as
:
Here, represents the weight of the geographical proximity between regions and , is the distance between the geometric centers of regions and , is the distance threshold, and is the standard deviation of the distance. Similarly, denotes the weight of geographical proximity between sites and , where is the distance between sites and , and is the distance threshold.
For node with spatial units defined as regions and node with spatial units defined as points, we define the distance matrix as . Specifically, when node is located within region , we set = 1. When node is not within the region , we define as the shortest distance from node to region , and the weight is calculated using the method described in Equation (9).
- (2)
Passenger Flow Similarity Embedding: The historical demand sequences of all nodes are normalized, and the similarity between nodes is computed using correlation coefficients. The passenger flow similarity embedding matrix
is defined as follows:
In this context, represents the weight of similarity in passenger flow variation patterns between nodes and . The normalized historical demand sequences for nodes and are denoted as and , respectively. The term refers to the correlation coefficient used to calculate the relationship between two time series. Threshold is determined based on the sparsity of , whereas and represent the standard deviations of and , respectively.
- (3)
Traffic Transfer Embedding: When embedding heterogeneous graphs, incorporating domain-specific knowledge can enhance the learning effectiveness of heterogeneous node features [
45]. To achieve this, we constructed the traffic transfer embedding matrix
to capture the transfer relationships of multi-modal passenger traffic flow. For any two nodes
and
, we define their traffic transfer embedding matrix
:
In this context, represents the traffic connection relevance weight from node to node , and denotes the number of passengers boarding at node within 15 min of alighting from node . Variable indicates the distance between two nodes, is the distance threshold, and serves as the threshold for controlling sparsity. Notably, is typically not equal to , reflecting the directional nature of the transfer relationship.
For the three types of relationship matrices, we establish thresholds , , and , and generate three types of hyperedges for each node based on these thresholds. Then, the similarity between any two super edges in the three super edge sets is calculated by using the Sørensen–Dice coefficient. Combine the super edges with a Sørensen–Dice coefficient less than 0.8 to obtain three relational super edge sets, which are defined as .
In the relationship-aware attention mechanism layer, we first perform the hypergraph convolution operation based on the initial hyperedge set corresponding to each relationship type (i.e., the geography, passenger flow, and connection hyperedge set before the merger), and obtain the preliminary feature representation of node
under the three relationship types:
where
are hyperedge incidence matrices of three relationship types respectively,
is the input characteristics of nodes, and
is a learnable parameter matrix.
Note that Equations (15)–(17) define the relationship-aware attention mechanism, which is proposed in our work to dynamically fuse spatial features from different relational hyperedges (geographic, passenger flow similarity, and connectivity). The attention score for node and relation type is computed by a single-layer MLP (Equation (15)) based on the concatenation of the current node feature and the relation-specific feature. The final attention weights are obtained by normalizing these scores using the Softmax function (Equation (16)), which are then used to compute the weighted sum of the relation-specific features to yield the final spatial representation (Equation (17)). This design allows the model to adaptively prioritize the most relevant spatial relationship for each node under specific traffic contexts.
For node
and relationship type
, we splice its current node feature
with the feature representation
under relationship type k, and calculate the attention score
through a single-layer MLP and Leaky-Relu activation function:
where
represents vector splicing operation and
is a learnable attention vector.
Then use the Softmax function to normalize the attention scores of the three relationship types to obtain the normalized attention weight
:
Finally, the spatial feature
of node
after the fusion of the relationship-aware attention mechanism is the weighted sum of three relationship features:
Through the relationship-awareness mechanism, the model can adaptively allocate different importance weights for geographical proximity, passenger flow similarity, and traffic connectivity according to the specific traffic context, so as to achieve a more refined modeling of heterogeneous spatial dependencies.
In order to overcome the shortcomings of traditional multi-scale convolution kernel parallel processing in feature hierarchy, we propose a hierarchical hypergraph convolution structure. The structure of hierarchical hypergraph convolution is shown in
Figure 6. Through the serial stacking and residual connection of three layers of convolution, our hierarchical design achieves the gradual expansion of information perception range layer by layer, effectively simulating the progressive process of human cognition from local details to global patterns. Compared to simple parallel multi-scale convolution, this method can generate more hierarchical and rich feature representations, thus better serving multi-modal traffic prediction tasks. Equations (18)–(21) describe the hierarchical hypergraph convolution process, a novel design in our work for multi-scale spatial feature extraction. Inspired by the success of hierarchical convolution in CNNs for capturing features at different receptive fields [
46], we apply hypergraph convolutional kernels of increasing effective sizes (e.g., 1 × 1, 3 × 3, 5 × 5) to the KNN and K-means hypergraphs. The outputs from different levels are fused through residual connections (Equations (19) and (20)), enabling the model to progressively capture local-to-global spatial dependencies. The final inter-modal spatial feature
is obtained by concatenating and linearly transforming the features from different hypergraph types (Equation (21)).
The dynamic super edge generation layer samples KNN and K-means neighbor nodes based on the node structure characteristics generated by the relationship-awareness layer, and generates KNN super edge and K-means super edge, that is, the node set represented by , and the node set represented by , .
After completing the construction of KNN hyperedges and K-means hyperedges in the dynamic hyperedge construction layer, this paper constructs a hierarchical hypergraph convolution layer. Multiple layers of different sized convolution kernels are applied to the KNN hypergraph and K-means hypergraph, respectively. Then, the feature representations obtained from different levels of convolution are fused. The calculation process for hierarchical convolution of KNN hyperedges and K-means hyperedges is as follows:
where
is the splicing operation and
is the learnable weight matrix.
is the spatial feature representation finally obtained by the DMRSHN module.
and
are the feature representations obtained by the hierarchical convolution of the KNN super edge and K-means hyperedge, respectively. The algorithmic principles of the DMRSHN module are presented in Algorithm A1 in
Appendix B.
4.4. Conditional Meta Attention Gated Fusion Network
The CMAGFN module overcomes the static limitations of traditional fusion strategies by incorporating a gated fusion mechanism based on multi-head cross-attention, which dynamically calibrates feature weights for context-aware decision-making. As a lightweight meta network, CMAGFN can dynamically generate fusion weights based on real-time context, rather than relying on static parameters. It can dynamically calculate a fine-grained multidimensional gating vector (rather than a single scalar) based on real-time traffic context, thereby adapting the contribution weights of intra-mode features and cross-mode features at the feature dimension level, and achieving more accurate and interpretable feature fusion. Equations (22)–(30) formulate the core of the Conditional Meta Attention Gated Fusion Network (CMAGFN), a key contribution of this paper. The intra- and inter-modal features are first projected by lightweight MLPs (Equations (22) and (23)). The multi-head cross-attention mechanism (Equations (24)–(27)), drawing inspiration from the transformer architecture [
47], is employed to compute the context-aware gating vector
(Equation (28)), where the query is the intra-modal feature, and the key/value are derived from the inter-modal features. This allows the model to dynamically assess the relevance of cross-modal information for each feature dimension. The final fused feature
is a weighted sum of the intra- and inter-modal features under the control of this gating vector (Equation (29)). The entire process is designed to replace static fusion strategies, enabling fine-grained, adaptive feature integration.
The overall architecture is illustrated in
Figure 7, which enables the dynamic optimization of the entire process, from information filtering to feature fusion, through an attention mechanism. The input of the CMAGFN layer is a context vector that comprehensively describes the current traffic status, ensuring that the generated dynamic weights can respond to real-time conditions. It mainly includes core environment context, intra-pattern requirement context, and cross-pattern context, where the core environment context includes timestamps (such as hour, day of the week) and weather conditions (such as sunny, rainy) encoded by embedding layer vectors
and
, respectively. The intra-pattern requirement context
refers to the recent historical demand sequence of nodes in the target transportation mode (e.g., taxi), which is extracted using a lightweight temporal convolutional layer. The cross-modal context includes the pure historical demand sequence
of the relevant patterns, as well as the fused spatiotemporal features
from the MSTHCN and DMRSHN modules. For each node, CMAGFN includes two parallel lightweight MLP paths that generate feature representations optimized for intra-pattern and cross-pattern information, respectively. The intra-model feature generator focuses on learning from the contextual requirements and core environment within the pattern, capturing the historical patterns of the pattern itself.
The cross-modal feature generator focuses on learning from all cross-modal contexts and core environmental contexts, extracting synergistic effect information provided by other traffic modes.
where
, d is the feature dimension.
The core of the CMAGFN module is to use multi-head cross-attention to generate a dynamic multi-dimensional gating vector. The query Q is derived from the output
of the intra-modal feature generator, which is obtained through linear transformation and represents the current node’s own state in the target pattern. The key K and value V are derived from the output
of the cross-modal feature generator and obtained through linear transformation, representing the contextual information provided by other modals:
where
,
, and
are learnable parameter matrices.
Subsequently, calculate the attention score and apply Softmax to obtain the weights:
where
is the dimension of the key vector K, and the scaling factor
is used to prevent gradient vanishing due to excessive dot product results.
After computing the query (Q), key (K), and value (V), the CMAGFN module performs multi-head attention mechanism calculations by using multiple sets of different WQ, WK, and WV matrices to perform h parallel attention calculations as described above. Each head focuses on different aspects of the input information, and finally concatenates the outputs of each head:
where
is the output projection matrix.
The multi-head attention mechanism enables the model to evaluate the relationships between features from different subspaces, thereby gaining a more comprehensive understanding of cross-modal interactions. The CMAGFN module passes the output of multi-head attention through a linear layer and Sigmoid activation function to generate a multidimensional gating vector
:
The distribution of gate control vector
can directly reflect the degree of dependence of the model on intra- and cross-modal information in different contexts, providing insights for decision-making. Ultimately, the fusion feature
of node i is the weighted sum of intra-pattern features and cross-pattern features under this gating vector:
where ⊙ represents the Hadamard product. This design allows the model to adopt different fusion strategies in different feature dimensions, achieving extremely refined fusion.