Forecasting ride-hailing demand via contextual spatiotemporal cross-attention mechanism
-
摘要: 为精准表征乘客在特定地理空间的频繁出行时间偏好或在特定时间范围的频繁访问空间喜好,提出了一种融合前后文时空交叉注意力机制的网约车需求预测模型ST-BiAformer,通过构建前后文时间关联模块,捕捉出行需求在时序维度的依赖特性;设计时空交叉注意力机制模块,交叉捕捉特定时间(或空间)语境下的空间(或时间)关联信息,挖掘了出行需求在特定时空维度的频繁访问模式;在此基础上构建时空融合模块,增强了对出行需求单步及多步的预测性能;所提模型应用于多个数据集中,通过系列对比、消融和鲁棒性分析试验,评估了其在不同时空场景的预测性能。研究结果表明:平均绝对误差和均方根误差较最优基线模型分别降低了7.21%和5.54%,验证了模型在整体预测性能上的提升;在5、10、15 min出行需求预测任务中,这2类误差均降低了1%~7%,表明模型具备良好的单步及多步预测性能;当且仅当所建三大子模块共同作用时,模型能够全面建模出行需求在前后文时间及时空关联维度的依赖特性,进而取得最佳预测性能。所提模型有望精准匹配用户在不同时段(或空间)异质空间(或时间)场景的出行需求,为提升城市网约车的供需调度水平提供技术支持。Abstract: To accurately characterize passengers' temporal preferences for frequent travel within specific geographic areas, or their spatial preferences for frequently visited locations within given time windows, this paper proposed a ride-hailing demand prediction model named ST-BiAformer (Spatiotemporal Bidirectional Association Transformer), which integrates a contextual spatiotemporal cross-attention mechanism. The model captured sequential dependencies in travel demand by constructing a contextual temporal correlation module; designed a spatiotemporal cross-attention mechanism to cross-extract spatial (or temporal) dependencies within specific temporal (or spatial) contexts, thereby revealing recurrent travel demand patterns along targeted spatiotemporal dimensions; and further developed a spatiotemporal fusion module to enhance the model's performance in both single-step and multi-step demand forecasting. The proposed model was evaluated on multiple datasets through a series of comparative, ablation, and robustness experiments, assessing its predictive performance under various spatiotemporal scenarios. Experimental results demonstrate that, compared with the optimal baseline model, the mean absolute error and root mean square error are reduced by 7.21% and 5.54%, respectively, demonstrating improved overall prediction accuracy. In the 5 min, 10 min, and 15 min forecasting tasks, both error metrics decrease by 1% - 7%, indicating sound single-step and multi-step predictive capability. The model achieves the best performance only when all three constituent submodules work jointly, enabling comprehensive modeling of travel demand dependencies along both contextual temporal and spatiotemporal correlation dimensions. The proposed model is expected to precisely match users' ride-hailing demands across heterogeneous spatiotemporal scenarios at different time periods or locations, thereby providing technical support for enhancing supply-demand scheduling in urban ride-hailing services.
-
表 1 模型多步预测试验比较结果
Table 1. Compared results of multi-step prediction experiment models
模型 厦门数据集 NYC_Taxi数据集 BJ_Taxi数据集 5 min 10 min 15 min 5 min 10 min 15 min 5 min 10 min 15 min EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE EMAE ERMSE GCN[24] 3.44 4.80 4.92 5.99 5.94 7.55 3.83 5.02 4.32 5.93 5.15 6.25 4.46 6.42 4.59 6.81 5.17 7.23 LSTM[7] 3.08 4.64 3.81 4.96 4.31 5.56 2.98 4.09 3.01 4.32 3.04 4.39 4.07 5.56 4.25 5.79 4.51 6.19 GRU[8] 2.91 4.16 3.60 4.68 4.07 5.25 2.89 3.97 2.92 4.03 2.97 4.13 4.05 5.60 4.27 5.95 4.47 6.25 BiLSTM[9] 2.80 4.04 3.47 4.52 3.92 5.05 2.70 3.92 2.73 3.94 2.75 3.94 3.53 4.75 3.64 5.01 3.69 5.08 Transformer[12] 2.79 3.81 3.43 4.73 3.75 4.83 2.54 3.45 2.57 3.51 2.61 3.63 3.42 4.47 3.56 4.72 3.61 4.87 Informer[13] 2.56 3.43 2.88 3.87 3.34 4.56 1.89 2.51 1.92 2.62 1.96 2.68 3.15 4.02 3.19 4.07 3.27 4.21 Autoformer[14] 2.35 3.08 2.83 3.81 3.30 4.56 1.77 2.18 1.82 2.27 1.84 2.36 3.12 3.86 3.17 3.92 3.22 4.12 STGCN[25] 2.74 3.58 3.30 4.41 3.81 4.98 2.47 3.39 2.55 3.50 2.63 3.64 3.28 4.37 3.35 4.41 3.43 4.49 GST-MGCN[26] 2.52 3.30 2.93 4.21 3.45 4.71 2.23 3.13 2.31 3.23 2.45 3.51 3.25 4.21 3.31 4.35 3.39 4.45 MVSTGCN[27] 2.57 3.32 2.83 3.97 3.36 4.52 2.18 3.10 2.27 3.18 2.38 3.36 3.21 4.19 3.28 4.30 3.35 4.43 STTN[28] 2.56 3.34 2.90 3.98 3.31 4.43 2.15 2.81 2.19 2.87 2.26 3.21 3.18 4.15 3.25 4.26 3.32 4.39 STFGNN[19] 2.53 3.41 2.83 3.85 3.35 4.51 2.01 2.63 2.05 2.71 2.08 2.73 3.15 3.92 3.23 4.12 3.27 4.28 GraphWaveNet[20] 2.49 3.32 2.81 3.77 3.32 4.42 1.81 2.41 1.86 2.43 1.87 2.47 3.11 3.85 3.16 3.97 3.20 3.99 Pdformer[11] 2.41 3.25 2.79 3.72 3.27 4.48 1.79 2.27 1.80 2.32 1.83 2.39 3.09 4.28 3.13 4.40 3.18 4.53 MoGERNN[23] 2.39 3.17 2.81 3.74 3.25 4.45 1.74 2.14 1.77 2.19 1.79 2.26 3.04 3.78 3.10 3.86 3.19 3.97 ST-BiAformer(本文) 2.24 2.90 2.77 3.64 3.20 4.37 1.63 2.08 1.64 2.09 1.68 2.14 2.85 3.68 2.91 3.74 2.96 3.75 注:表中加粗的数据为最优预测结果,下划线标识的数据为次优预测结果。 表 2 消融试验结果分析
Table 2. Analysis of ablation study results
组合 前后文时间关联模块 时空交叉注意力机制模块 时空融合模块 EMAE ERMSE ① × × √ 4.43 5.58 ② × √ √ 4.08 4.83 ③ √ × √ 3.72 4.63 ④ √ √ × 3.57 4.51 ⑤(本文) √ √ √ 3.20 4.37 表 3 显著性检验结果分析
Table 3. Analysis of significance test results
检验项 EMAE ERMSE 检验值 显著性 检验值 显著性 高、低需求区域 0.798 0.835 有无前后文时间关联模块 0.002 * 0.002 * 有无时空交叉注意力机制模块 0.003 * 0.003 * 有无时空融合模块 0.001 * 0.001 * 注:“*”是指检测结果呈现显著性差异。 -
[1] 李之红, 申天宇, 文琰杰, 等. 基于混合机器学习框架的网约车订单需求预测与异常点识别[J]. 交通信息与安全, 2023, 41(3): 157-165, 174.LI Zhi-hong, SHEN Tian-yu, WEN Yan-jie, et al. Order demand prediction and anomaly-point identification for online car-hailing orders based on hybrid machine learning frame-work[J]. Journal of Transport Information and Safety, 2023, 41(3): 157-165, 174. [2] ZHAO X, CUI M Y, LEVINSON D. Exploring temporal variability in travel patterns on public transit using big smart card data[J]. Environment and Planning B: Urban Analytics and City Science, 2023, 50(1): 198-217. doi: 10.1177/23998083221089662 [3] WEN Y J, LI Z H, WANG X Y, et al. Traffic demand prediction based on spatial-temporal guided multi graph Sand-wich-Transformer[J]. Information Sciences, 2023, 643: 119269. doi: 10.1016/j.ins.2023.119269 [4] 崔建勋, 要甲, 赵泊媛. 基于深度学习的短期交通流预测方法综述[J]. 交通运输工程学报, 2024, 24(2): 50-64. doi: 10.19818/j.cnki.1671-1637.2024.02.003 CUI Jian-xun, YAO Jia, ZHAO Bo-yuan. Review on short-term traffic flow prediction methods based on deep learning[J]. Journal of Traffic and Transportation Engineering, 2024, 24(2): 50-64. doi: 10.19818/j.cnki.1671-1637.2024.02.003 [5] LIANG G J, KINTAK U, NING X, et al. Semantics-aware dynamic graph convolutional network for traffic flow fore-casting[J]. IEEE Transactions on Vehicular Technology, 2023, 72(6): 7796-7809. doi: 10.1109/TVT.2023.3239054 [6] XIA M R, JIN D W, CHEN J Y. Short-term traffic flow prediction based on graph convolutional networks and fede-rated learning[J]. IEEE Transactions on Intelligent Trans-portation Systems, 2023, 24(1): 1191-1203. doi: 10.1109/TITS.2022.3179391 [7] HOCHREITER S, SCHMIDHUBER J. Long short-term memory[J]. Neural Computation, 1997, 9(8): 1735-1780. doi: 10.1162/neco.1997.9.8.1735 [8] CHO K, VAN MERRIENBOER B, GULCEHRE C, et al. Learning phrase representations using RNN encoder-decoder for statistical machine translation[C]//ACL. Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP). Baltimore: ACL, 2014: 1724-1734. [9] GRAVES A, SCHMIDHUBER J. Framewise phoneme classi-fication with bidirectional LSTM and other neural network architectures[J]. Neural Networks, 2005, 18(5): 602-610. [10] LI Z H, XU H, GAO X L, et al. Fusion attention mecha-nism bidirectional LSTM for short-term traffic flow prediction[J]. Journal of Intelligent Transportation Systems, 2024, 28(4): 511-524. doi: 10.1080/15472450.2022.2142049 [11] JIANG J W, HAN C K, ZHAO W X, et al. PDFormer: Propagation delay-aware dynamic long-range transformer for traffic flow prediction[J]. Proceedings of the AAAI Confe-rence on Artificial Intelligence, 2023, 37(4): 4365-4373. doi: 10.1609/aaai.v37i4.25556 [12] VASWANI A, SHAZEER N, PARMAR N, et al. Atten-tion is all you need[J]. Advances in Neural Information Processing Systems, 2017, 30. [13] ZHOU H Y, ZHANG S H, PENG J Q, et al. Informer: Beyond efficient transformer for long sequence time-series forecasting[J]. Proceedings of the AAAI Conference on Arti-ficial Intelligence, 2021, 35(12): 11106-11115. doi: 10.1609/aaai.v35i12.17325 [14] WU H, XU J, WANG J, et al. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting[J]. Advances in Neural Information Processing Systems, 2021, 34: 22419-22430. [15] 姚俊峰, 何瑞, 史童童, 等. 基于机器学习的交通流预测方法综述[J]. 交通运输工程学报, 2023, 23(3): 44-67. doi: 10.19818/j.cnki.1671-1637.2023.03.003 YAO Jun-feng, HE Rui, SHI Tong-tong, et al. Review on machine learning-based traffic flow prediction methods[J]. Journal of Traffic and Transportation Engineering, 2023, 23(3): 44-67. doi: 10.19818/j.cnki.1671-1637.2023.03.003 [16] LIU K, CHEN Z J, YAMAMOTO T, et al. Exploring the impact of spatiotemporal granularity on the demand prediction of dynamic ride-hailing[J]. IEEE Transactions on Intelligent Transportation Systems, 2023, 24(1): 104-114. doi: 10.1109/TITS.2022.3216016 [17] YAN H Y, MA X L, PU Z Y. Learning dynamic and hierar-chical traffic spatiotemporal features with transformer[J]. IEEE Transactions on Intelligent Transportation Systems, 2022, 23(11): 22386-22399. doi: 10.1109/TITS.2021.3102983 [18] HUO G Y, ZHANG Y, WANG B Y, et al. Hierarchical spatio-temporal graph convolutional networks and trans-former network for traffic flow forecasting[J]. IEEE Tran-sactions on Intelligent Transportation Systems, 2023, 24(4): 3855-3867. doi: 10.1109/TITS.2023.3234512 [19] LI M Z, ZHU Z X. Spatial-temporal fusion graph neural networks for traffic flow forecasting[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2021, 35(5): 4189-4196. doi: 10.1609/aaai.v35i5.16542 [20] WU Z H, PAN S R, LONG G D, et al. Graph WaveNet for deep spatial-temporal graph modeling[C]//IJCAI. Pro-ceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence. Macao: International Joint Confe-rences on Artificial Intelligence Organization, 2019: 1907-1913. [21] WANG Q Y, WANG S H, ZHUANG D Y, et al. Uncer-tainty quantification of spatiotemporal travel demand with probabilistic graph neural networks[J]. IEEE Transactions on Intelligent Transportation Systems, 2024, 25(8): 8770-8781. doi: 10.1109/TITS.2024.3367779 [22] ZHANG H P, DONG H H, YANG Z Q. TSGDiff: Traffic state generative diffusion model using multi-source infor-mation fusion[J]. Transportation Research Part C: Emerging Technologies, 2025, 174: 105081. doi: 10.1016/j.trc.2025.105081 [23] ZHOU Q S, ZHANG Y F, MAKRIDIS M A, et al. Mo-GERNN: An inductive traffic predictor for unobserved loca-tions[J]. Transportation Research Part C: Emerging Tech-nologies, 2025, 174: 105080. doi: 10.1016/j.trc.2025.105080 [24] LIU XUN, LEI F Y, XIA G Q, et al. AdjMix: Simplifying and attending graph convolutional networks[J]. Complex & Intelligent Systems, 2022, 8(2): 1005-1014. [25] YU B, YIN H T, ZHU Z X. Spatio-temporal graph convo-lutional networks: A deep learning framework for traffic forecasting[C]//IJCAI. Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence. Stockholm: International Joint Conferences on Artificial Intelligence Organization, 2018: 3634-3640. [26] LV M Q, HONG Z X, CHEN L, et al. Temporal multi-graph convolutional network for traffic flow prediction[J]. IEEE Transactions on Intelligent Transportation Systems, 2021, 22(6): 3337-3348. doi: 10.1109/TITS.2020.2983763 [27] WEI S Q, FENG S Y, YANG H. Multi-view spatial-tem-poral graph convolutional network for traffic prediction[J]. IEEE Transactions on Intelligent Transportation Systems, 2024, 25(8): 9572-9586. doi: 10.1109/TITS.2024.3364759 [28] LI G Y, ZHONG S H, DENG X D, et al. A lightweight and accurate spatial-temporal transformer for traffic forecasting[J]. IEEE Transactions on Knowledge and Data Engineer-ing, 2023, 35(11): 10967-10980. doi: 10.1109/TKDE.2022.3233086 [29] WANG M, ZHANG Y, ZHAO X, et al. Traffic origin-desti-nation demand prediction via multichannel hypergraph convolutional networks[J]. IEEE Transactions on Computa-tional Social Systems, 2024, 11(4): 5496-5509. doi: 10.1109/TCSS.2024.3372856 [30] WEN Y J, XU P, LI Z H, et al. RPConvformer: A novel Transformer-based deep neural networks for traffic flow prediction[J]. Expert Systems with Applications, 2023, 218: 119587. doi: 10.1016/j.eswa.2023.119587 -
下载: