作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程

• •    

基于起讫点角色二部图的区域间 OD 交通流预测方法

  • 发布日期:2026-09-14

Inter-regional OD Traffic Flow Prediction Method Based on Origin-Destination Role Bipartite Graph

  • Published:2026-09-14

摘要: 针对区域间起讫点(Origin-Destination,OD)交通流预测中起点与终点角色差异刻画不足、区域对交互关系利用不充分及预测矩阵结构约束较弱的问题,提出一种基于起讫点角色二部图的交通流预测方法BiHOD-Net。由于同一区域作为起点时反映交通产生状态、作为终点时反映交通吸引状态,采用统一节点表示容易混合两类不同交通语义,同时仅依据单条OD边预测误差进行优化可能导致局部误差在矩阵行、列方向累积。为此,该方法首先从历史OD矩阵中分别提取区域作为起点和终点时面向不同目的地和来源地的流出、流入分布,构建起点角色序列和终点角色序列,并采用基于分块的时间序列Transformer(Patch Time Series Transformer,PatchTST)对两类角色序列进行独立时序编码,提取局部时间片段内的变化特征及片段之间的时间依赖,再结合区域静态属性生成具有不同交通语义的起点角色表示和终点角色表示。随后,将两类角色节点分别置于二部图两侧,根据历史OD联系构建起讫点角色二部图,其中起点到终点传播按照历史流出关系进行归一化,终点到起点传播按照历史流入关系进行归一化,通过双向消息传播建模交通产生侧与交通吸引侧之间具有方向性和非对称性的交互关系。在边级预测阶段,联合传播后的起点角色表示和终点角色表示,并融合角色绝对差异项、逐元素乘积项以及由最近流量、平均流量、最大流量、标准差、活跃比例等构成的边历史特征,形成显式区域对表示,以分别刻画起讫点状态差异、匹配关系和具体OD边自身的历史流动特征。在此基础上,采用门控线性单元(Gated Linear Unit,GLU)对不同信息进行自适应筛选并输出未来边级交通流。同时,在边级交通流预测损失基础上引入OD矩阵边际一致性约束,以真实矩阵的行边际和列边际作为监督信号,减小局部边级预测误差累积造成的区域总流出量和总流入量偏差,从而兼顾具体区域对预测精度与OD矩阵整体结构。本文在北京、成都、南京和NYC-Taxi 4个出租车OD交通流数据集上开展实验,并设置20、40和60 min预测间隔,与历史平均、支持向量回归、深度时序模型、时空图神经网络以及多种OD需求和OD矩阵预测方法进行统一比较。采用平均绝对误差(Mean Absolute Error,MAE)、均方根误差(Root Mean Square Error,RMSE)和平均绝对百分比误差(Mean Absolute Percentage Error,MAPE)评价预测性能。结果表明,在4个数据集和3种预测间隔形成的36组评价结果中,BiHOD-Net取得28项最优和6项次优,94.4%的结果位于前两名,其中在北京和NYC-Taxi数据集的9项评价结果上均取得最优值。在60 min预测任务中,BiHOD-Net在北京数据集上的MAE、RMSE和MAPE分别为1.0389、1.5087和47.6338%,在NYC-Taxi数据集上分别为0.8499、0.8822和42.4931%。消融实验表明,在北京数据集60 min预测任务中,去除边历史特征、起讫点角色区分、O-D二部图传播和矩阵边际一致性约束后,MAE分别由完整模型的1.0389增至1.3728、1.1084、1.1048和1.0990;成都、南京和NYC-Taxi数据集上的关键消融结果进一步表明上述核心设计在不同区域划分方式和OD网络结构下均能带来稳定增益。采用42、123和2024三个随机种子进行的重复实验中,各数据集预测结果整体保持稳定。实验结果说明,BiHOD-Net能够通过起讫点角色分离、双向二部图传播、显式区域对交互及矩阵边际一致性约束有效刻画区域间方向性OD交通需求,在动态稀疏OD交通流预测任务中具有较好的综合预测性能、稳定性和跨数据集适应性。

Abstract: To address the insufficient distinction between origin and destination roles, inadequate utilization of regional-pair interactions, and weak structural constraints on predicted matrices in inter-regional origin-destination (OD) traffic flow forecasting, this paper proposes BiHOD-Net, an OD traffic flow prediction method based on an origin-destination role bipartite graph. Since the same region reflects traffic generation when acting as an origin and traffic attraction when acting as a destination, using a unified node representation may mix these two different traffic semantics. Moreover, optimizing only the prediction error of individual OD edges may cause local errors to accumulate along the row and column dimensions of the OD matrix. To address these issues, BiHOD-Net first extracts the outflow and inflow distributions of each region toward different destinations and from different origins from historical OD matrices, respectively, and constructs origin-role and destination-role sequences. A patch-based time series Transformer (Patch Time Series Transformer, PatchTST) is then employed to independently encode the two role sequences, capturing temporal variations within local patches and dependencies across different patches. These temporal features are further combined with regional static attributes to generate origin-role and destination-role representations with distinct traffic semantics. Subsequently, the two types of role nodes are placed on opposite sides of a bipartite graph to construct an origin-destination role bipartite graph according to historical OD connections. Origin-to-destination propagation is normalized according to historical outflow relationships, whereas destination-to-origin propagation is normalized according to historical inflow relationships. Through bidirectional message propagation, the model captures directional and asymmetric interactions between the traffic generation and attraction sides. At the edge-level prediction stage, the propagated origin-role and destination-role representations are integrated with their absolute difference, element-wise product, and edge historical features derived from recent flow, mean flow, maximum flow, standard deviation, and activity ratio, forming an explicit regional-pair representation that characterizes role differences, matching relationships, and the historical movement patterns of individual OD edges. On this basis, a gated linear unit (Gated Linear Unit, GLU) is employed to adaptively filter different types of information and predict future edge-level traffic flows. Meanwhile, an OD matrix marginal consistency constraint is introduced in addition to the edge-level traffic flow prediction loss. By using the row and column marginals of the ground-truth OD matrix as supervision signals, this constraint reduces deviations in regional total outflow and inflow caused by accumulated local edge-level prediction errors, thereby balancing the prediction accuracy of individual regional pairs and the overall structure of the OD matrix. Experiments are conducted on four taxi OD traffic flow datasets from Beijing, Chengdu, Nanjing, and NYC-Taxi, with prediction intervals of 20, 40, and 60 min. BiHOD-Net is compared under a unified protocol with historical average, support vector regression, deep temporal models, spatio-temporal graph neural networks, and multiple OD demand and OD matrix forecasting methods. Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Percentage Error (MAPE) are adopted as evaluation metrics. The results show that, among the 36 evaluation results formed by four datasets and three prediction intervals, BiHOD-Net achieves 28 best and 6 second-best results, with 94.4% of the results ranking among the top two. In particular, it achieves the best performance for all nine evaluation results on both the Beijing and NYC-Taxi datasets. For the 60 min prediction task, the MAE, RMSE, and MAPE of BiHOD-Net are 1.0389, 1.5087, and 47.6338%, respectively, on the Beijing dataset, and 0.8499, 0.8822, and 42.4931%, respectively, on the NYC-Taxi dataset. Ablation experiments show that, for the 60 min prediction task on the Beijing dataset, removing edge historical features, origin-destination role separation, O-D bipartite graph propagation, and the matrix marginal consistency constraint increases the MAE from 1.0389 for the complete model to 1.3728, 1.1084, 1.1048, and 1.0990, respectively. Additional key ablation experiments on the Chengdu, Nanjing, and NYC-Taxi datasets further demonstrate that these core designs provide stable improvements under different regional partition schemes and OD network structures. Repeated experiments using three random seeds, 42, 123, and 2024, also show that the prediction results remain generally stable across all datasets. These results demonstrate that BiHOD-Net can effectively characterize directional inter-regional OD traffic demand through origin-destination role separation, bidirectional bipartite graph propagation, explicit regional-pair interaction, and OD matrix marginal consistency constraints, providing favorable overall prediction performance, stability, and cross-dataset adaptability for dynamically sparse OD traffic flow forecasting.