24H-GNN

A Pattern-Driven Pseudo-Label Fusion Graph Network for City-Wide Traffic Flow Prediction

Loop detectors + taxi GPS trajectories · San Francisco Bay Area

Thanh Nhan Ho1 Dong Anh Nguyen2 Minh Tai Pham Nguyen3 Minh Khue Phan Tran4 Hoang Minh Nguyen5 Nguyen Bao Tran6 Trong Nhan Le1

1Faculty of Computer Science and Engineering, Ho Chi Minh City University of Technology 2School of Industrial Management, Ho Chi Minh City University of Technology 3Faculty of Advanced Program, Ho Chi Minh City Open University 4Faculty of Information Technology, Ho Chi Minh City Open University 5Faculty of Foreign Languages – Information Technology, Ho Chi Minh City University of Foreign Languages – Information Technology 6Faculty of Mechanical Engineering, Ho Chi Minh City University of Technology

Ho Chi Minh City, Vietnam  ·  nhan.honhanhocse@hcmut.edu.vn  ·  trongnhanle@hcmut.edu.vn

Pipeline of 24H-GNN: multimodal data goes through preprocessing and alignment, pseudo-label generation, feature construction, a fusion or baseline graph module, and finally prediction and hotspot ranking.
Figure 1: Overall pipeline of the proposed 24H-GNN framework. It comprises (1) multimodal data preprocessing and spatial alignment, (2) cosine-similarity-based pseudo-label generation with spatio-temporal feature construction, and (3) fusion or baseline graph modules followed by a prediction head for traffic flow estimation and hotspot detection.
0.92
hotspot@50 — Fusion-MultiScaleGNN (best baseline: 0.84)
0.97
hotspot@100 — Fusion-GraphSAGE (best baseline: 0.93)
838
road segments with a full 24-hour fused pattern
K = 5
most-similar loop-equipped neighbours per segment

Abstract

Urban traffic flow prediction is essential for effective transportation management but remains challenging due to heterogeneous and spatially inconsistent data sources. We propose a pseudo-label fusion framework that integrates loop detector data and taxi GPS trajectories using spatio-temporal similarity. Graph neural networks (GNNs) are employed to model network dependencies, while an adaptive fusion strategy balances reliable sensor data and trajectory-based estimates. The proposed approach achieves strong hotspot detection performance (hotspot@50 = 0.92, hotspot@100 = 0.97) and consistently outperforms baseline models, particularly under limited supervision. The framework enables scalable city-wide traffic estimation through multi-source data integration.

At a glance

Problem

Loop detectors are accurate but sparse; taxi trajectories are abundant but noisy, biased, and unlabeled.

Idea

Give every trajectory-only segment a pseudo-label borrowed from its K = 5 most similar loop-equipped segments.

Fusion

Blend pseudo-label and taxi profile: ỹ = 0.7 · ypseudo + 0.3 · ptaxi, then learn with GNNs.

Outcome

Best hotspot@50 (0.92) and hotspot@100 (0.97) among all compared models on 838 segments.

Contributions

Reference

Thanh Nhan Ho, Dong Anh Nguyen, Minh Tai Pham Nguyen, Minh Khue Phan Tran, Hoang Minh Nguyen, Nguyen Bao Tran, and Trong Nhan Le. 24H-GNN: A Pattern-Driven Pseudo-Label Fusion Graph Network for City-Wide Traffic Flow Prediction.

BibTeX citation

@misc{ho2026_24hgnn,
  title  = {24H-GNN: A Pattern-Driven Pseudo-Label Fusion Graph Network
            for City-Wide Traffic Flow Prediction},
  author = {Ho, Thanh Nhan and Nguyen, Dong Anh and Nguyen, Minh Tai Pham and
            Tran, Minh Khue Phan and Nguyen, Hoang Minh and Tran, Nguyen Bao and
            Le, Trong Nhan},
  year   = {2026}
}

Method

Loop detectors are accurate but sparsely deployed, whereas taxi trajectories are abundant but noisy and biased — and carry no labels, so they cannot directly provide traffic density. The framework turns this complementary pair into one reference-quality 24-hour dataset that covers the whole network, then trains graph models on top of it.

Data processing

Multimodal data are preprocessed, map-matched to the road network, and normalized into 24-hour patterns.

Pseudo-labels & features

Cosine-similarity pseudo-labels are generated and spatio-temporal features constructed.

Graph learning

A fusion or baseline graph module models dependencies across the road network.

Prediction & ranking

A prediction head estimates 24-hour flow and ranks hotspots.

3.1Fusion dataset with pseudo-labeling

Pseudo-labels are built at the road-segment level for taxi trajectories that have been map-matched onto the city's road network, then calibrated with loop-detector data at sensor locations. For each segment j without a detector, the K = 5 loop-equipped segments NK(j) whose normalized 24-hour pattern yiloop is most similar to the trajectory-derived profile pjtaxi are selected. K = 5 balances local similarity against data sparsity.

Pseudo-label generation for a trajectory-only segment j
  1. Normalize all loop and taxi flows into 24-hour patterns; drop irregular days (holidays, special events).
  2. Compute the cosine similarity si between pjtaxi and every loop pattern yiloop, i ∈ L.
  3. Keep the top K = 5 loop-equipped segments as NK(j).
  4. Turn similarities into weights wi that sum to one.
  5. Return the weighted average of their loop patterns as yjpseudo.
(1) $$s_i=\cos\!\big(y_i^{\text{loop}},\,p_j^{\text{taxi}}\big),\qquad i\in L,\qquad |\mathcal{N}_K(j)|=5$$ (2) $$w_i=\frac{s_i}{\sum_{k\in\mathcal{N}_K(j)}s_k}$$ (3) $$\mathbf{y}_j^{\text{pseudo}}=\sum_{i\in\mathcal{N}_K(j)}w_i\,\mathbf{y}_i^{\text{loop}}$$

The weighted average becomes a pseudo-label: a reliable estimate of the traffic flow that the segment would exhibit if it were equipped with a sensor. In this way, biased or incomplete data are transformed into reference-quality data suitable for machine learning, leveraging the inherent stability of traffic patterns. Excluding irregular days keeps the pseudo-labels focused on stable, long-term behaviour.

Reading

Because the patterns are normalized, cosine similarity compares the shape of the daily curve (when peaks occur) rather than absolute volume — a quiet street can borrow its label from a busy road that has the same daily rhythm. This is our interpretation of Eq. (1), not a claim made in the paper.

3.2Merging the trajectory dataset

After pseudo-labels are assigned to all 838 road segments, each segment is represented by two components: a relative traffic flow vector pjtaxi and a pseudo-label yjpseudo derived from reliable sensor-based data. They are combined by an adjusted fusion operation:

(4) $$\tilde{y}_j=\alpha\cdot y_j^{\text{pseudo}}+(1-\alpha)\cdot p_j^{\text{taxi}},\qquad \alpha=0.7$$
α = 0.7 empirically chosen within [0.6, 0.8] ypseudo preserves the stability of sensor-based patterns ptaxi reflects real-world variations and local deviations

Interactive demo: from loop neighbours to a fused profile

A toy illustration of Eqs. (1)–(4). The sensor-less segment has only a noisy, biased taxi profile (gold, dotted). Three loop neighbours (grey) are weighted by cosine similarity into a pseudo-label (dashed). Drag α to move the fused profile (blue) between the two sources.

loop neighbours / pseudo-label taxi profile ptaxi fused ỹ

Toy example for intuition only — synthetic profiles with K = 3 for readability (the paper uses K = 5); not data or an experiment from the paper.

Experiment

4.1Data sources

Two sources that cover nearly the entire city but are not homogeneous are synthesized into one 24-hour pattern dataset.

SourceDatasetCoverageRole in 24H-GNN
Loop detectorsLargeST (Greater Bay Area subset)2,352 sensors · 2020 and 2021Accurate but sparse — reference patterns for pseudo-labels
Taxi GPS trajectoriesSFMTA Taxi TripsAll permitted taxi companies in the City and County of San FranciscoAbundant but noisy and biased — trajectory profile ptaxi
Fused datasetPseudo-labeled + taxi838 road segments24-hour pattern ỹ per segment (α = 0.7)

Table 1. Data sources and the fused dataset.

Map of loop detector locations in the Bay Area, coloured by traffic volume: low, medium, high, or no data.
(a) Loop detectors location.
Heatmap of taxi trips concentrated in San Francisco and along the Bay Area corridors.
(b) Trajectory taxi trips heatmap.
Figure 2: Loop detectors and trajectory taxi dataset. Sensors blanket the wider Bay Area highway network, whereas taxi trips concentrate densely in San Francisco — the two sources are complementary.

4.2Training setup & baselines

ParameterValue
OptimizerAdam
Learning rate1.0 × 10−4
Number of neighbors (K)5
Fusion coefficient (α)0.7
Epochs50
Batch size10

Table 2. Training and hyperparameter settings.

Baselines (the main comparison set): ASTGCN, DCRNN, STGCN, GCN, GraphSAGE, and STGFormer — models that learn spatio-temporal interactions across road networks. Proposed: Fusion-GraphSAGE and Fusion-MultiScaleGNN. Metrics: R² for flow estimation and hotspot@50 / hotspot@100 for hotspot detection at two ranking thresholds.

Results

The proposed fusion frameworks consistently outperform the baselines on hotspot detection, confirming the effectiveness of adaptive multi-source fusion. Fusion-MultiScaleGNN is best at the smaller ranking threshold (hotspot@50 = 0.92), while Fusion-GraphSAGE is best at the larger one (hotspot@100 = 0.97) — complementary strengths in local and global congestion identification.

+0.08

hotspot@50 over the best baseline (GraphSAGE 0.84 → Fusion-MultiScaleGNN 0.92); Fusion-GraphSAGE also gains +0.04.

+0.04

hotspot@100 over the best baseline (GraphSAGE 0.93 → Fusion-GraphSAGE 0.97); Fusion-MultiScaleGNN matches it at 0.93.

0.82

R² is highest for plain GraphSAGE; the fusion models stay close (0.81 and 0.79).

5.1Explore the benchmark

Models are sorted by the selected metric; ★ marks the best value. Numbers are those of Table 3.

MethodR²hotspot@50hotspot@100
ASTGCN0.710.600.75
DCRNN0.740.640.74
STGCN0.760.680.74
GCN0.750.620.70
GraphSAGE0.820.840.93
STGFormer0.510.000.22
Fusion-GraphSAGE (Ours)0.810.880.97
Fusion-MultiScaleGNN (Ours)0.790.920.93
Best Ours − best baseline−0.01+0.08+0.04

Table 3. Model performance metrics across different models (best per column in bold). The last row is computed from the table: best of our two models minus the best baseline in each column.

5.2Reading the numbers

  • Ranking, not just fitting. Fusion mainly improves how well the most congested segments are identified (hotspot@k), while R² stays within 0.01–0.03 of GraphSAGE.
  • Two models, two scales. MultiScaleGNN leads when ranking only 50 segments; GraphSAGE-based fusion leads at 100.
  • Weaker spatio-temporal baselines. STGFormer reaches R² 0.51 with hotspot@50 of 0.00, while ASTGCN, DCRNN, STGCN, and GCN lie between 0.71 and 0.76 R².

5.3Hotspot visualization

Figure 3 compares ground-truth and predicted top-100 hotspots in the San Francisco Bay Area during the peak period (16–17 h). Predicted locations are quite close to the actual congestion patterns and identify several key bottlenecks in downtown San Francisco and along key arterial routes — an essential capability for practical urban traffic management. Drag the handle to compare.

Ground-truth top 100 congestion hotspots over the San Francisco Bay Area. Predicted top 100 congestion hotspots over the San Francisco Bay Area. Ground truthPrediction
Figure 3: Results with top-100 hotspot detection at 16–17 hours. Left of the handle: ground-truth top-100 hotspots; right: prediction of top-100 hotspots.

Conclusion

This study proposes a pseudo-label fusion framework for city-wide traffic prediction. By integrating loop detector and trajectory data, the model effectively learns 24-hour traffic patterns and improves hotspot detection. The spatio-temporal pseudo-labeling mechanism extends supervision to unlabeled regions, enabling scalable traffic estimation under limited ground-truth data.

Acknowledgements. This work is acknowledged by Ho Chi Minh City University of Technology – Vietnam National University and Ho Chi Minh City Open University, Vietnam.