2.2. Microscopic Spatiotemporal Prediction of Traffic Flow Based on FSE-ST-GCN
Tunnel traffic flow exhibits strong spatiotemporal correlations. To effectively capture its spatial distribution and temporal evolution patterns, it is modeled as a spatiotemporal graph. Considering the discrepancies in traffic conditions across different tunnel segments, each monitoring section is represented as a graph node to construct the spatial topology, thereby accurately characterizing the spatial heterogeneity of tunnel traffic flow.
At the input layer, the GWO-GRU model is employed to predict incoming traffic flow at the tunnel entrance, providing stable macro-level information support for the FSE-ST-GCN model. This information, combined with real-time observed data from each tunnel segment, constitutes the input features of the spatiotemporal graph.
The FSE-ST-GCN model integrates Graph Convolutional Networks (GCN) with spatiotemporal attention mechanisms. Specifically, spatial dependencies among nodes and temporal dynamics are separately captured through spatial attention and temporal attention modules, enabling joint spatiotemporal modeling and effective feature extraction for tunnel traffic flow prediction.
2.2.1. Spatio-Temporal Graph Modeling of Tunnel Traffic Flow
(1) Segmentation Node Modeling
The tunnel is partitioned into four segments: entrance, transition, middle, and exit segments. Each segment is modeled as a graph node, representing the traffic flow state of the corresponding segment at a specific time step. Let
denote the traffic flow of the i-th tunnel segment at time t. Accordingly, the overall traffic state of the tunnel at time t can be formulated as follows:
This modeling paradigm transforms tunnel traffic flow from a one-dimensional time series into graph-structured node representations, providing a solid foundation for subsequent graph neural network modeling.
Figure 6.
Schematic diagram of tunnel segments and nodes.
Figure 6.
Schematic diagram of tunnel segments and nodes.
(2) Spatial Topological Modeling
To characterize spatial dependencies across tunnel segments, the tunnel traffic system is formulated as a graph
, where the adjacency matrix A encodes the connection relationships between graph nodes. In accordance with the physical structure of the tunnel, only adjacent inter-segment connections are considered, and self-loops are incorporated to derive:
where
denotes the identity matrix. This adjacency topology captures the propagation pathways of traffic flow within the tunnel, laying a solid foundation for subsequent graph convolution operations.
The spatial topology of the tunnel is illustrated below:
2.2.2. Adaptive Adjacency Matrix
(1) Construction of the Adaptive Adjacency Matrix
Let N denote the total number of segment nodes within the tunnel. For each node, two embedding matrices are learned:
where
and
represent the source and target embeddings of graph nodes, respectively, and d denotes the dimension of embedding space. By calculating the similarity between node embedding vectors, inter-node correlation relationships are derived to construct the correlation matrix:
Subsequently, normalization is conducted via the Softmax function to obtain the adaptive adjacency matrix:
Driven by raw traffic flow data, this matrix adaptively captures latent spatial dependencies across tunnel segments, thereby overcoming the inherent limitations of pre-defined fixed topological structures.
Figure 7.
Spatial Topology Diagram of Tunnel Segments.
Figure 7.
Spatial Topology Diagram of Tunnel Segments.
Figure 8.
Schematic diagram of the adaptive adjacency matrix generation process.
Figure 8.
Schematic diagram of the adaptive adjacency matrix generation process.
(2) Fusion of Adjacency Matrix Modeling
To integrate the physical prior of tunnel topology with data-driven dynamic inter-segment dependencies, the static adjacency matrix is fused with the adaptive adjacency matrix to form a unified spatial representation:
where
denotes the static physical adjacency matrix,
represents the adaptive adjacency matrix, and
is a learnable parameter that balances their contributions.
This fusion strategy preserves the inherent physical connectivity of tunnel segments while simultaneously capturing latent traffic propagation patterns, thereby improving the model’s capability in spatial feature representation.
Figure 9.
Adaptive ST-GCN Model Architecture.
Figure 9.
Adaptive ST-GCN Model Architecture.
By introducing the adaptive adjacency matrix, the model is able to dynamically learn latent node relationships from data and integrate them with the original topological structure. This enhances its capability to capture complex spatial dependencies in traffic flow, providing a more flexible and effective representation for spatio-temporal graph convolutional modeling.
2.2.3. Channel Attention Mechanism
(1) Principle of the Channel Attention Mechanism
The channel attention mechanism models channel-wise statistics of feature maps to learn the importance of each feature channel. Input features are first aggregated using global average pooling and global max pooling to capture complementary channel-level representations. The two feature descriptors are then projected through a shared multi-layer perceptron (MLP) and fused. Channel attention weights are subsequently generated via a Sigmoid activation function, and applied to recalibrate the original feature maps through channel-wise weighting.
This mechanism adaptively emphasizes informative feature channels and suppresses less relevant responses, thereby enhancing feature discriminability.
Figure 10.
Schematic diagram of the channel attention module.
Figure 10.
Schematic diagram of the channel attention module.
(2) Implementation of the SE Module
For practical implementation, the Squeeze-and-Excitation (SE) block is adopted to construct the channel attention module. The architecture is divided into two core operations: Squeeze and Excitation.
Squeeze: Input feature maps are aggregated through global average pooling to produce holistic channel-wise statistical descriptors.
Excitation: A two-layer fully-connected network captures inter-channel nonlinear dependencies and adaptively generates corresponding channel attention weights.
Finally, the obtained weights are multiplied with the original feature maps in a channel-wise manner to amplify informative channels and suppress redundant ones.
Figure 11.
SE block architecture diagram.
Figure 11.
SE block architecture diagram.
By embedding the SE channel attention module into the spatio-temporal convolutional module of ST-GCN, the importance of channel features can be modeled, thereby enhancing the model’s focus on key discriminative features. Based on these improvements, the SE-ST-GCN network architecture is developed.
In summary, the introduced channel attention mechanism enables the model to extract critical feature information more effectively and strengthen its representation capacity for spatio-temporal dependencies of traffic flow, thereby boosting overall prediction accuracy and stability.
Figure 12.
SE-ST-GCN Model Architecture.
Figure 12.
SE-ST-GCN Model Architecture.
2.2.4. Spatial Attention Mechanism
(1) Principle of the Spatial Attention Mechanism
The core intuition of the spatial attention mechanism is to adaptively compute inter-node correlation weights according to node features, so as to quantify the mutual influence across tunnel segments. Specifically, node features are projected to measure inter-node correlations, yielding an attention weight matrix that encodes spatial dependencies. These weights are then normalized to achieve consistent comparability among inter-node influence scores.
By dynamically adjusting inter-node dependencies according to real-time traffic flow conditions, this mechanism enables the model to prioritize segments that dominate traffic flow propagation. As a result, the model’s capacity for spatial feature extraction is further improved.
Figure 13.
Flowchart of the Spatial Attention Mechanism.
Figure 13.
Flowchart of the Spatial Attention Mechanism.
(2) Spatial Attention Modeling
Based on the aforementioned mechanism, spatial attention is employed to construct a spatial attention matrix that captures dynamic inter-node relationships. This matrix encodes the time-varying dependencies between tunnel segments as traffic conditions change, effectively addressing the inherent limitations of traditional fixed adjacency matrices.
Compared with modeling approaches that rely solely on physical topology, the spatial attention mechanism excavates latent spatial dependencies from traffic data, allowing the model to more flexibly and accurately depict the propagation patterns of traffic flow within tunnels.
Figure 14.
Schematic of the Dynamic Adjacency Matrix Fusion Mechanism.
Figure 14.
Schematic of the Dynamic Adjacency Matrix Fusion Mechanism.
In summary, the introduction of the spatial attention mechanism enables adaptive weighting of the importance of different nodes, enhancing the model’s capability to capture key regions and their spatial dependencies. This further refines the modeling of spatial dependencies in tunnel traffic flow, while experimental results demonstrate that this mechanism effectively reduces prediction errors, improves model accuracy, and enhances the model’s stability and robustness.
2.2.5. Construction of the FSE-ST-GCN Model
(1) Overall Model Structure
The FSE-ST-GCN adopts a multi-layer spatio-temporal convolutional architecture, consisting of an input layer, multiple spatio-temporal convolutional modules (ST-Conv Blocks), and an output layer. The input consists of traffic flow sequences of each tunnel segment within a continuous time window, while the output generates traffic flow predictions for subsequent time steps.
In terms of network architecture, the model stacks multiple ST-Conv Blocks to extract temporal and spatial features of traffic flow layer by layer. During the feature extraction process, various enhancement mechanisms are integrated to effectively model complex spatio-temporal dependencies between traffic flow features.
(2) ST-Conv Block Structural Design
The ST-Conv Block is the core computational unit of the FSE-ST-GCN model. Its internal structure consists of a temporal convolution layer, a fusion graph convolution layer, another temporal convolution layer, and a residual connection. The specific process is as follows:
1. Temporal Convolution Layer: Extracts local dynamic changes in traffic flow along the temporal dimension;
2. Fusion Graph Convolution Layer: Models the spatial dependencies between tunnel segments;
3. Temporal Convolution and Dropout Layer: Further refines temporal features and suppresses overfitting;
4. Residual Connection: Preserves original information and enhances model training stability.
Through this architecture, the model can simultaneously learn the temporal evolution patterns and spatial propagation characteristics of traffic flow at each layer.
Figure 15.
Overall Architecture of the FSE-ST-GCN Network.
Figure 15.
Overall Architecture of the FSE-ST-GCN Network.
Figure 16.
Internal structure of the ST-Conv Block.
Figure 16.
Internal structure of the ST-Conv Block.
(3) Fusion Graph Convolution Mechanism
To enhance the model’s ability to capture complex spatial dependencies, this paper introduces a fused graph convolutional mechanism within the graph convolutional module to unify the modeling of various spatial relationships. Specifically, these include: static adjacency relationships, which describe the physical topological structure between tunnel segments; adaptive adjacency relationships, which learn latent spatial associations through a data-driven approach; and spatial attention relationships, which dynamically characterize the influence weights inter-node.
Based on the above three types of spatial relationships, a unified spatial dependency representation is constructed:
Here, represents the fixed adjacency matrix, represents the adaptive adjacency matrix, represents the spatial attention matrix, and represents the learnable weight parameters.
This fusion method can dynamically capture the implicit propagation paths and key spatial dependencies of traffic flow while preserving the tunnel topology, thereby significantly enhancing spatial feature representation capabilities.
Figure 17.
Schematic of the Fusion Graph-Convolutional Architecture.
Figure 17.
Schematic of the Fusion Graph-Convolutional Architecture.