Urban population OD flow prediction method and related equipment
By constructing an urban population OD flow prediction model that integrates multiple dimensions, the shortcomings of existing technologies in predicting OD flow within cities are addressed, achieving more accurate and detailed prediction results that are adaptable to the spatial structure and travel characteristics of different cities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies struggle to provide accurate and detailed OD (Original Demand) flow forecasting within cities, particularly in terms of considering complex interactions and spatial dependencies between regions.
A city population OD flow prediction model is constructed, including a spatial adjacency encoder, a land use complementarity encoder, a traffic connectivity encoder, and a population OD flow predictor. By integrating a geographic adjacency map, a land use complementarity map, and a traffic connectivity map, the multi-dimensional encoder captures the multi-factor influence of urban travel.
It significantly improves the accuracy and relevance of OD traffic prediction, can adapt to the spatial structure and travel characteristics of different cities, makes up for the shortcomings of traditional models and machine learning models, and provides more comprehensive prediction support.
Smart Images

Figure CN121809763A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of spatial information technology, and specifically relates to a city population OD flow prediction method and related equipment. BACKGROUND
[0002] Population flow is the core driving force of urban development, which not only promotes the process of urbanization and drives industrial upgrading, but also helps to narrow the regional gap. Accurate estimation of OD flow within the city plays an irreplaceable role in many key fields. In traffic planning, demand modeling based on such travel flow can help optimize public transportation line layout, rationally allocate road capacity, and guide the scientific deployment of traffic monitoring facilities. In the field of public health, understanding and predicting people's travel patterns can more accurately assess the risk of disease transmission such as epidemics, and provide strong support for prevention and control work. At the same time, travel modeling combined with geographic spatial features also deepens people's understanding of urban spatial structure and promotes interdisciplinary research on the interaction between urban built environment and human activities.
[0003] In the application of these fields, the demand for travel flow prediction is increasingly high, especially the fine-grained OD flow prediction within the city, which needs to accurately capture complex travel patterns. However, urban internal travel is influenced by multiple factors such as geographical location, transportation facilities, population density, and travel purpose, and the relationship is complex. Traditional prediction methods are difficult to fully cover these variables and accurately reflect the real travel patterns, making it difficult to meet the requirements of accuracy and detail in various fields.
[0004] To solve this problem, related technologies have been continuously developed, forming three main types of flow prediction models. Early classic traditional models such as gravity model, intervening opportunities model, and radiation model attempt to establish a relationship between regional characteristics and spatial flow through simple, universal, and easy-to-understand methods. Subsequently, machine learning models such as Bayesian networks, k-nearest neighbors, support vector machines, XGBoost, and random forests leverage data-driven advantages to capture complex nonlinear relationships between features to improve accuracy. In recent years, deep learning technologies such as deep neural networks (DNN), convolutional neural networks (CNN), and graph neural networks (GNN) have emerged, among which GNN and its derivatives such as heterogeneous graphs, hypergraphs, graph convolution networks (GCNs), and graph attention networks (GATs) have shown potential in modeling spatial relationships and have incorporated geographic or economic context information.
[0005] However, these methods still have obvious limitations: the classic traditional model is difficult to deal with complex interaction; most machine learning models ignore the inter-regional spatial dependence which is crucial to human flow; and the current outstanding GNN-based research mostly focuses on large-scale inter-city migration or representation learning tasks, and its application in intra-city fine-grained OD flow prediction is still very limited. Overall, the existing technology still cannot fully meet the demand for accurate and detailed intra-city travel flow prediction in various fields. SUMMARY
[0006] The present application provides a city population OD flow prediction method and related equipment, which solves the problem that the classic traditional model is difficult to deal with complex interaction; most machine learning models ignore the inter-regional spatial dependence which is crucial to human flow.
[0007] To achieve the above object, the present application provides the following technical scheme: A city population OD flow prediction method, comprising: Obtaining target city data, dividing the target city area into a plurality of non-overlapping geographic units according to the target city data, and extracting the information attributes of the geographic units; Establishing a geographic adjacency graph according to the information attributes of each geographic unit; Inputting the geographic adjacency graph into a trained city population flow prediction model to output a prediction result; Wherein, the city population flow prediction model comprises a spatial adjacency encoder, a land use complementary encoder, a traffic connection encoder and a population OD flow predictor; The spatial adjacency encoder outputs a node feature matrix according to the geographic adjacency graph, the land use complementary encoder outputs a land use complementary graph and a geographic spatial distance graph according to the node feature matrix, the traffic connection encoder outputs a traffic connectivity graph according to the node feature matrix, and the population OD flow predictor completes the population OD flow prediction according to the land use complementary graph, the geographic spatial distance graph and the traffic connection graph.
[0008] Preferably, the specific steps of the spatial adjacency encoder outputting the node feature matrix according to the geographic adjacency graph are: The spatial adjacency encoder uses the GraphSAGE algorithm based on the geographic adjacency graph, uses the mean as the aggregation function, aggregates the features of the adjacent nodes of the node into a neighborhood vector, splices the features of the node itself and the aggregated neighborhood vector through the CONCAT function, processes through the ReLU activation function and the trainable weight matrix, and outputs the node feature matrix.
[0009] Preferably, the specific steps of the land use complementary encoder outputting the land use complementary graph and the geographic spatial distance graph according to the node feature matrix are: construct a geospatial distance graph based on the information attributes of each geographic unit, calculate a land use function coefficient or a function complement index, construct a land use complement graph set according to the land use function coefficient or the function complement index, and provide the land use complement graph set; input the geospatial distance graph and the land use complement graph set into the parallel graph attention network, calculate the attention coefficient in combination with the edge weight matrix of the geospatial distance graph and the edge weight matrix of the land use complement graph, obtain the attention weight through normalization, aggregate the node features to generate the feature matrix corresponding to each graph, and complete the construction of the geospatial distance graph and the land use complement graph.
[0010] Preferably, the traffic connection encoder includes the following steps: construct a traffic connectivity graph set according to the traffic modes based on the information attributes of the geographic units, input the traffic connectivity graph set and the node feature matrix into the parallel graph attention network, calculate the attention weight in combination with the adjacency matrix of each traffic graph, aggregate the node features to generate the feature matrix corresponding to each traffic graph, capture the k-order spatial correlation through the multi-layer graph attention network, and then construct the reachability matrix of each traffic mode, and fuse the traffic reachability matrices to obtain the traffic connectivity graph.
[0011] Preferably, the population OD flow predictor includes the following steps for completing the population OD flow prediction based on the land use complement graph, the geospatial distance graph and the traffic connection graph: extract the origin region representation vector and the destination region representation vector based on the node feature matrix, integrate the geospatial distance graph and the land use complement graph to form a spatial correlation strength matrix, construct a comprehensive reachability matrix based on the traffic connectivity graph, and splice the origin region representation vector, the spatial correlation strength matrix, the comprehensive reachability matrix and the destination region representation vector to construct an input feature vector; input the input feature vector into a multi-layer perceptron, calculate through edge-level regression, and output the population OD flow prediction result from the corresponding origin region to the destination region.
[0012] Preferably, when the urban population flow prediction model is trained, the model parameters are optimized through a loss function, and the loss function is as follows:
[0013] wherein, represents the total number of OD pairs, is the real OD flow, is the predicted flow.
[0014] An urban population OD flow prediction system includes: The data acquisition module is configured to acquire target city data, divide a target city area into a plurality of non-overlapping geographical units according to the target city data, and extract information attributes of the geographical units. The adjacency graph establishment module is configured to establish a geographical adjacency graph according to the information attributes of each geographical unit. The prediction module is configured to input the geographical adjacency graph into a trained city population flow prediction model and output a prediction result. The city population flow prediction model comprises a spatial adjacency encoder, a land use complementary encoder, a traffic connection encoder, and a population OD flow predictor. The spatial adjacency encoder outputs a node feature matrix according to the geographical adjacency graph, the land use complementary encoder outputs a land use complementary graph and a geographical spatial distance graph according to the node feature matrix, the traffic connection encoder outputs a traffic connectivity graph according to the node feature matrix, and the population OD flow predictor completes population OD flow prediction according to the land use complementary graph, the geographical spatial distance graph, and the traffic connectivity graph.
[0015] A computer device comprises a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the population OD flow prediction method.
[0016] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the population OD flow prediction method.
[0017] A computer program product comprises a computer program, and the computer program is executed by a processor to implement the steps of the population OD flow prediction method.
[0018] Compared with the prior art, the present application has the following beneficial effects: the present application provides a city population OD flow prediction method, which effectively solves the deficiencies of the prior art in fine-grained city internal OD flow prediction by constructing a city population flow prediction model that integrates multiple dimensions of key factors, captures the spatial correlation between geographical units with the help of a spatial adjacency encoder, excavates the regional functional complementarity and geographical distance characteristics through a land use complementary encoder, integrates traffic accessibility information using a traffic connection encoder, and the feature maps output by the multiple-dimensional encoders provide comprehensive support for prediction. This design fully considers the comprehensive influence of spatial location, land use, and traffic conditions on city travel, and makes up for the defects of traditional models that ignore spatial dependence and existing machine learning and deep learning models that are insufficient in integrating multiple factors, significantly improving prediction accuracy and fit. At the same time, the model divides geographical units and extracts attributes based on actual data of a target city, adapts to the spatial structure and travel characteristics of different cities, and has strong application flexibility. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0020] Figure 1 A flow chart of a city population OD flow prediction method according to an embodiment of the present application; Figure 2 A comparison diagram of spatial correlation capture of a single-layer GAT model and a multi-layer GAT model according to an embodiment of the present application; Figure 3 A schematic diagram of a city population flow prediction model according to an embodiment of the present application; Figure 4 A visualization display diagram of real OD flow and prediction results of three best performance models according to an embodiment of the present application; Figure 5 A block diagram of a city population OD flow prediction system according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will combine the drawings in the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art on the basis of the embodiments in the present application without creative labor are within the scope of protection of the present application.
[0023] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0024] In order to make those skilled in the art better understand the technical solutions of the present application, the following will make a further detailed introduction to the present application in combination with the drawings.
[0025] As shown in the drawings, Figure 1 The present application provides a city population OD flow prediction method, which comprises: S1: Obtain target city data, divide the target city area into multiple non-overlapping geographic units according to the target city data, and extract the information attributes of the geographic units; S2: Establish a geographic adjacency graph according to the information attributes of each geographic unit; S3: Input the geographic adjacency graph into the trained city population flow prediction model to output the prediction result; Wherein, the city population flow prediction model comprises a spatial adjacency encoder, a land use complementary encoder, a traffic connection encoder and a population OD flow predictor; The spatial adjacency encoder outputs a node feature matrix according to the geographic adjacency graph, the land use complementary encoder outputs a land use complementary graph and a geographic spatial distance graph according to the node feature matrix, the traffic connection encoder outputs a traffic connectivity graph according to the node feature matrix, and the population OD flow predictor completes the population OD flow prediction according to the land use complementary graph, the geographic spatial distance graph and the traffic connection graph.
[0026] By constructing a city population flow prediction model integrating multiple key factors, the deficiencies of the prior art in fine-grained city internal OD flow prediction are effectively solved. The spatial adjacency encoder captures the spatial correlation between geographic units, the land use complementary encoder excavates the regional functional complementarity and geographic distance characteristics, and the traffic connection encoder integrates traffic accessibility information. The feature maps output by the multi-dimensional encoders provide comprehensive support for prediction. This design fully considers the comprehensive influence of space location, land use and traffic conditions on city travel, makes up for the defects of traditional models ignoring spatial dependence and existing machine learning and deep learning models lacking multi-factor integration, and significantly improves prediction accuracy and fitness. At the same time, the model divides geographic units and extracts attributes based on actual data of the target city, adapts to the spatial structure and travel characteristics of different cities, and has strong application flexibility.
[0027] The detailed steps are: Divide the city geographic unit: In order to calculate the regional attributes and the relationship between regions, the city is conceptualized as a graph. Therefore, we need to divide the study area into multiple city geographic units. These geographic units can be grids, blocks, census tracts, traffic analysis zones, etc. In this study, the city space is divided into non-overlapping equal-area grid units (each unit has an area of 1 km x 1 km), denoted as , where is the number of regions. In addition, each geographic unit can be represented as a vector , which represents the region , which considers attributes. It contains comprehensive information in infrastructure, land use, social economy, transportation, etc.
[0028] Geographical adjacency graph construction: The geographical adjacency network is an undirected and unweighted graph , representing the geographical adjacency relationship between regions. In Fig. , represents a set of nodes, each node corresponding to a 1-kilometer grid cell. The vector of all grid cells constitutes the node attribute matrix , and it should be noted that . We use the queen proximity as an indicator to measure the geographical adjacency relationship between grid cells, thereby generating a set of edges , where is adjacent to , , and vice versa .
[0029] Geospatial distance graph construction: As is known, distance is one of the key factors affecting human cross-regional movement. In particular, in population flow prediction models, distance is an indispensable feature. Therefore, we construct a complete Euclidean distance graph , where is a set of edges between every two nodes, is a weighted matrix whose weight is the normalized Euclidean distance reciprocal, is the output feature matrix of the geographical proximity encoder.
[0030] Land use complementarity graph construction: In addition, considering the different purposes of people's travel, multiple spatial correlation graphs are generated based on different land use complementarity indexes. It is worth mentioning that the land use complementarity graph is a directed and weighted graph. Among them the weight of and region is equal to the land use complementarity index between region and region , the weight matrix is asymmetric, that is . is a set of edges of the spatial correlation graph , where , and region have no edge between them. In this invention, represents a set of land use complementarity graphs generated by all types of land use complementarity indexes.
[0031] Traffic connectivity graph construction: Humans will travel in the city by various means of transportation. Therefore, our population flow prediction model involves a traffic correlation network. We selected three most common traffic travel networks, i.e., subway, bus, and road, and constructed a set of traffic correlation graphs based on the nodes . All traffic connectivity graphs we constructed contain the coordinate information of nodes.
[0032] OD flow graph construction: Flow data also constitutes a weighted directed graph , which shares the same nodes with all the above graphs. is a set of OD flows weighted by flow strength, where represents the flow from region to region . can be regarded as edge-level flow and has asymmetry, i.e. .
[0033] The problem of predicting the OD flow of the population within the city in the present invention can be converted into the problem of predicting the edge attribute in the city graph. In reality, various geographical spatial correlations and multi-modal traffic connection networks are mapped into different graphs, forming a graph set. The upstream task is to update and aggregate features according to the node attributes and their correlations. The downstream task is edge-level regression, which uses the obtained features and their multiple correlations to predict the OD flow of the population within the city. Given a geographical adjacency graph , a geographical spatial distance graph , a set of land use complementarity graphs and a set of traffic connection graphs , the trained model can effectively predict the OD flow in . The graph-to-graph prediction process is summarized as follows:
[0034] wherein, is the predicted population OD flow graph.
[0035] The structure of the city population flow prediction model as shown in Figure 3 includes: spatial adjacency encoder: First, in the preprocessing stage, we divide the study area into equal-sized grid cells and fuse multi-source features to construct a geographic adjacency graph. The node feature vectors on the geographic adjacency graph consist of socioeconomic attributes (i.e., land use mix, nighttime light representing economic development, population density, and floor area ratio), functional semantic attributes (i.e., the density of various points of interest (POIs), and transportation accessibility (i.e., the number of subway stations, bus stops, and intersections). Since population flow within a city is influenced not only by origin and destination points but also by its surrounding neighboring areas, we apply the GraphSAGE (Graph Sampling and Aggregation) algorithm to aggregate node features individually based on proximity relationships.
[0036] Given a geographic adjacency graph Each node First, the neighbor information and feature information of adjacent nodes are... Aggregate to neighborhood vector In this context, the vector is calculated based on the representation generated during the previous iteration:
[0037] Wherein, the initial feature vector of a node is the input node's attribute vector. , It is the output embedded node feature, where This represents the total number of GraphSAGE layers. AGGREGATE represents a function that aggregates neighborhood information; the aggregation function can be the mean, pooling, or LSTM aggregator. In this invention, we use the mean aggregation function. Next, the node's current embedding... Should be passed The function and its aggregated neighborhood vector and target node information Combine them and embed them in the following way:
[0038] in, It is the first The trainable weight matrix of the layer, It is the activation function, which can be ReLU, Leaky ReLU, etc.
[0039] In this study, we utilize two GraphSAGE layers to capture feature information from second-order neighbor nodes using a mean aggregator. Each layer is followed by a ReLU activation function to improve the fitting performance of the neural network model. This encoder achieves the fusion of neighboring features, and the resulting convolutional feature matrix is... This information will then be fed into subsequent encoders to reconstruct other relationship graphs.
[0040] Land use complementary encoder: The socio-economic attributes of regions and the multiple geographical spatial connections between regions have a significant impact on spatial flow prediction. In addition, spatial interaction has a significant impact on human activity, and reasonable modeling of spatial interaction can improve the accuracy of predicting the intensity of population flow. Moreover, there is usually a distance decay effect in the inter-regional population flow, that is, as the distance between two regions increases, the flow intensity will decrease. Based on the above, we construct the Euclidean distance graph and multiple types of land use complementary graphs to describe the various relationships between two nodes.
[0041] The basic purpose of people moving from one place to another is to carry out certain activities, which indicates that the urban functions of the destination are the fundamental driving force of travel flow. Therefore, we adopt the land use function complementarity index proposed by Ren et al. In the present invention, we use five main types of points of interest (POI) to represent the different urban functions of a region, namely residential (R), industrial (I), green (G), commercial (C) and public service (P).
[0042] The land use complementarity index will be constructed by two functions or one function itself. The steps for calculating the land use complementarity index are as follows: (1) adopt land use function coefficients to measure the specific land use function within a region, which ensures the comparability of all land use functions. The formula is as follows:
[0043] wherein, denotes the function index of region . In addition, denotes the volume of the function of region ; and denotes the total volume of region . denotes the volume of the function of the entire region; denotes the total volume of the entire region. Based on the land use function coefficients, the function complementarity index is calculated to generate the weight matrix and edge set
[0044] , which is as follows:
[0045] wherein, the weight of the edge denotes the function of region and the function of region One-way functional complementarity between Due to the weight matrix and They are transposes of each other, and and The relationships are mutually exclusive, so we only need to select one. For example, we only select from two complementary land use maps. and Select In summary, we ultimately constructed 15 different land use complementarity maps. Since the strength of distance correlation and multiple land use complementarity correlations differs in their effects on population flow prediction, we introduced trainable parameters for each edge correlation weight.
[0046] Graph Attention Networks (GAT) utilize a multi-head attention mechanism to update node representations, providing an effective solution for capturing multiple geospatial associations. This mechanism non-linearly integrates the feature vectors of neighboring nodes according to the graph structure.
[0047] Therefore, we utilize GAT to update and embed geospatial distance maps. and land use complementarity atlas The node representation of each graph in the graph. Due to the complete Euclidean distance graph and Some graphs in the dataset are too large, so we use Custer-GCN to divide them into several subgraphs to reduce computational cost and memory usage. The GAT operation involves transforming input features into attention-based aggregations, normalizing attention coefficients, and finally generating updated node embeddings. First, a shared linear transformation is applied to each node, and the attention coefficients for each edge are... The definition is as follows:
[0048] in, Indicates the first layer in the l-th layer The size of the node Features of nodes The importance of , and It is a trainable weight matrix, and LeakyReLU is a non-linear activation function. '||' indicates transpose, and '||' indicates concatenation. Please note that the calculation of the attention coefficient includes... It can be of It can also be of In this way, the model can learn the influence of various geospatial relationships between regions during training. Then, the nodes... Attention coefficient of all neighbors normalized by a softmax function to obtain attention weights :
[0049] where, denotes the attention weight of the th head in the th layer from the th node to the th node, and denotes all neighbors of the node . The complete form of the attention weight generated by the multi-head attention mechanism is:
[0050] After the attention weight is calculated, the th head aggregates the features of the region in the following way:
[0051] where, denotes the feature vector of the region in the th layer for the th head, which aggregates its own attributes and those of its neighbors, is a nonlinear activation function.
[0052] Then, the next step is to concatenate the outputs of all heads to form the embedding of the th layer, as follows:
[0053] To capture the detailed influence of each geospatially related pair on the individual node features, we apply parallel graph attention networks (GATs) to the graphs in . In addition, each GAT layer used in this section adopts a dropout rate of 0.5, followed by a batch normalization layer to avoid overfitting and improve the robustness of this study. The batch normalization here prevents gradient vanishing and accelerates training. Specifically, we input the th graph (with adjacency matrix and edge weight matrix ) and shared feature matrix into the th GAT to generate the output feature matrix . Finally, all An output is obtained to obtain the overall node representation, as follows:
[0054] Traffic connection encoder: Traffic mode is an important factor that cannot be ignored in population flow and is the carrier of OD flow. In urban areas, subway and bus are two main public transport modes, and people can also travel by walking, cycling or driving on the road. Therefore, we project the real traffic network onto the grid and construct three traffic graphs, i.e. , and . We project the traffic network onto the grid cells and then use the adjacent edges to simulate the traffic connection, which is very similar to the driving mode of various traffic modes on the actual route. We are more concerned about the actual association between grids in each traffic network, so is an undirected and unweighted graph, while and are directed and unweighted graphs. The subway runs in both directions, some bus lines are one-way or loop lines, and some roads are one-way. Similarly, with three parallel GATs, we can update and embed the features of all nodes according to each traffic connection network. Unlike the land use complementary encoder, the attention weight is calculated as follows:
[0055] where denotes the learnable linear transformation of the layer, the head, denotes the attention vector of a specific mode (subway, bus or road).
[0056] It is worth noting that a GAT layer can only capture first-order spatial correlation, while multiple GAT layers can capture k-order spatial correlation. As Figure 2As shown, the input is a subway connectivity graph. The single-layer GAT model can only capture first-order spatial correlation, which means that the passenger flow through the subway is limited to directly adjacent stations. For example, in the first-order scenario, it is possible to travel from grid B to grid C through the subway, but not from grid A to grid B, as there is no direct subway connection between them. In contrast, the multi-layer GAT model can capture k-order spatial correlation (where k > 2), allowing information to propagate across multiple layers and enabling the simulation of longer-distance connections in the subway network. As a result, population flow can occur not only between adjacent stations but also between stations separated by multiple hops. For example, through multiple GAT layers, it is possible to travel from grid A to grid B via a series of connected subway stations. This enables a more comprehensive representation of spatial dependencies and travel behavior in complex urban transportation systems.
[0057] In addition, we encode the accessibility between regions by each mode of transportation according to each transportation network. For each mode of transportation (subway, bus, highway), we define a binary accessibility matrix:
[0058] The entries are:
[0059] If it is possible to travel from region to region by this mode of transportation, then
[0060] In this way, we encode for each pair of regions which modes of transportation can transport population from region to region .
[0061] Population OD flow predictor: We employ attribute graph embedding to generate region feature vectors, which represent multiple associated latent semantics through low-dimensional vectors at the node level. According to the push-pull theory proposed by Lee, the push force of the origin and the pull force of the destination have a significant impact on the formation of spatial interactions. In this study, we implement edge regression to predict the strength of spatial interactions, with the aim of predicting specific edge attributes given the features. In this module, we employ a multi-layer perceptron (MLP) to predict the strength of spatial interactions based on the feature representation of the origin and destination, various spatial correlation indicators between them, and traffic accessibility indicators between them. Specifically, the embedding representation matrix as an input to a flow intensity predictor, which is connected in the following way:
[0062] wherein, denotes the characterization vector of the origin region , denotes the characterization vector of the destination region , and contains the various spatial correlation intensities between the regions and . Specifically, these correlations include the geographical distance , the complementary intensity of land use functions, such as the interaction of residential and industrial areas , etc. Furthermore, explicitly captures the accessibility between these regions by various means of transportation, including the subway, bus, and road. Subsequently, the predicted flow intensity from region to region is calculated by inputting the constructed input feature vector into a multi-layer perceptron (MLP) predictor, specifically as follows:
[0063] In addition, each MLP layer in this module employs a dropout rate of 0.5 to enhance the performance of the model. This intuitive architecture provides a comprehensive characterization of the inter-regional features, integrating various spatial and transportation-related features, thereby facilitating robust and interpretable predictions of the OD flow of people within the city. During the training process, the model parameters are optimized by minimizing the following loss function:
[0064] wherein, denotes the total number of OD pairs, is the real OD flow, is the predicted flow.
[0065] In a preferred embodiment: The GNN-based OD flow prediction model we proposed is a “black box” model. For all spatial relation graphs, different types of spatial relations play different roles in node feature aggregation. Therefore, we use GNNExplainer to explain the contribution of different attributes and multiple spatial relations to the prediction of spatial interaction and try to clarify the logic behind the prediction made by the proposed model. After the model is constructed and trained, GNNExplainer initializes a set of soft masks applied to the graph nodes, edges and node features. These soft masks are parameters learned through an optimization process, aiming to identify the subgraph structure and feature subset that maximizes the mutual information between the model prediction and the possible explanation distribution. By optimizing these masks, GNNExplainer can highlight the most influential nodes, edges and features that are crucial to the model prediction. The masks are determined by an optimization algorithm that iteratively searches for subgraphs that maximize the mutual information objective:
[0066] wherein, represents the predicted value, represents a small subgraph of the computation graph centered at node represents a small subset of node features that are considered the most important features in all features for explaining the prediction made by the model.
[0067] Experimental verification: The present application uses mobile signaling data from a large city in China to analyze and test the effectiveness of the method for predicting OD flow of people within the city. In this experiment, the OD flow prediction model we constructed is implemented based on the PyTorch framework and trained on an NVIDIA GeForce RTX 4090 graphics processing unit (GPU) with 48 GB of memory. The entire model is trained in an end-to-end manner for 300 cycles using the Adam optimizer and mean squared error (MSE) loss function, and an early stopping strategy is used to avoid overfitting. Specifically, the hidden channel size of all modules is set to 1024. The land use complementary encoder uses one attention layer, while the traffic connection encoder uses three attention layers. The dimension of the feature vector in GAT is 64, and the number of attention heads is set to 8. In addition, a dropout rate of 0.5 is used for all modules except the geographic proximity encoder to improve generalization ability and reduce the probability of overfitting. The MLP used in this model consists of three layers. In addition, the initial learning rate is set to 0.001, and a planned decay factor of 0.1 is applied every 50 cycles. The human flow data is randomly divided into three subsets: 60% for training, 20% for validation, and 20% for testing.
[0068] To evaluate the prediction performance of all models, the following evaluation metrics are adopted in this experiment: mean squared error (MSE), mean absolute error (MAE), and R-squared (R 2 ), which are commonly used in regression tasks. They are used to measure the deviation between predicted and actual values, the lower the values of MSE and MAE, and the higher the value of R-squared, the smaller the deviation and the better the model performance. Commuter common part (CPC) is a metric specifically designed for OD flow modeling. CPC quantifies the degree of overlap between predicted and actual values, reflecting their similarity. The value of CPC is between 0 and 1, the higher the value, the greater the similarity between predicted and actual values, and thus the better the model performance. The formulas of the above metrics are as follows:
[0069]
[0070]
[0071]
[0072]
[0073] where, denotes the total number of OD pairs, and are the predicted and actual values, respectively.
[0074] To rigorously evaluate the effectiveness of the proposed crowd OD flow prediction model, we conduct a comprehensive comparison with a series of baseline models, which cover various types from classic formulas to state-of-the-art methods. Specifically, the baseline models include gravity model, radiation model, deep gravity model, multilayer perceptron without incorporating multiple relationship information (MLP-norel), and multilayer perceptron with incorporating multiple relationship information (MLP-rel).
[0075] The experimental results show that our proposed method is superior to all models, and the comparison of model performance is shown in Table 1. The radiation model performs the worst among all models on this dataset. The gravity model performs much better considering the distance between the origin and the destination. Since the deep gravity model is single-constrained, it will ignore some spatial correlations and flow data when modeling, resulting in poor performance. MLP-rel combines multiple spatial correlations and is based on the push force at the origin and the pull force at the destination, and its performance is better than MLP-norel, with a 58.21% reduction in MSE, a 35.55% reduction in MAE, a 36.56% reduction in MAPE, and a 0.06 increase in R 2The model performance is improved by 170.74%, and the CPC is improved by 9.95%. In addition, the model shows better performance on the basis of the MLP-rel by adding a graph convolution framework, and the performance is improved by 62.87%, 38.26% and 31.35% in terms of MSE, MAE and MAPE respectively, and the R 2 The model performance is improved by 170.74%, and the CPC is improved by 9.95%. In addition, the model shows better performance on the basis of the MLP-rel by adding a graph convolution framework, and the performance is improved by 62.87%, 38.26% and 31.35% in terms of MSE, MAE and MAPE respectively, and the R
[0076] Table 1 Comparison of model performance
[0077] As Figure 5 shown, another embodiment of the present application provides a city population OD flow prediction system, comprising: A data acquisition module is configured to acquire target city data, divide a target city area into a plurality of non-overlapping geographic units according to the target city data, and extract information attributes of the geographic units. An adjacency graph establishment module is configured to establish a geographic adjacency graph according to the information attributes of each geographic unit. A prediction module is configured to input the geographic adjacency graph into a trained city population flow prediction model and output a prediction result. The city population flow prediction model comprises a spatial adjacency encoder, a land use complementary encoder, a traffic connection encoder and a population OD flow predictor. The spatial adjacency encoder outputs a node feature matrix according to the geographic adjacency graph, the land use complementary encoder outputs a land use complementary graph and a geographic spatial distance graph according to the node feature matrix, the traffic connection encoder outputs a traffic connectivity graph according to the node feature matrix, and the population OD flow predictor completes population OD flow prediction according to the land use complementary graph, the geographic spatial distance graph and the traffic connectivity graph.
[0078] An embodiment of the present application provides a computer device. The computer device of the embodiment comprises a processor, a memory and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the steps in each of the above method embodiments. Alternatively, the processor executes the computer program to implement the functions of each module / unit in each of the above device embodiments.
[0079] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application.
[0080] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The computer device can include, but is not limited to, a processor and a memory.
[0081] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0082] The memory can be used to store the computer program and / or modules. The processor realizes various functions of the computer device by running or executing the computer program and / or modules stored in the memory, and calling data stored in the memory.
[0083] The modules / units integrated in the computer device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can realize the steps of the above-mentioned various method embodiments when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier wave signal, electric signal and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electric carrier wave signal and electric signal.
[0084] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0085] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be appropriately combined to form other embodiments that can be understood by those skilled in the art. The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for predicting urban population origin-destination flow, characterized in that, include: Acquire target city data, divide the target city area into multiple non-overlapping geographical units based on the target city data, and extract the information attributes of the geographical units; A geographic adjacency graph is created based on the information attributes of each geographic unit; Input the geographic adjacency graph into the trained urban population flow prediction model and output the prediction results; The urban population flow prediction model includes a spatial adjacency encoder, a land use complementarity encoder, a traffic connection encoder, and a population OD flow predictor. The spatial adjacency encoder outputs a node feature matrix based on the geographic adjacency map, the land use complementarity encoder outputs a land use complementarity map and a geographic spatial distance map based on the node feature matrix, the traffic connectivity encoder outputs a traffic connectivity map based on the node feature matrix, and the crowd OD flow predictor completes crowd OD flow prediction based on the land use complementarity map, the geographic spatial distance map, and the traffic connectivity map.
2. The method for predicting urban population OD flow according to claim 1, characterized in that, The specific steps of the spatial adjacency encoder in outputting the node feature matrix based on the geographic adjacency graph are as follows: The spatial adjacency encoder uses the GraphSAGE algorithm based on the geographic adjacency graph. It uses the mean as the aggregation function to aggregate the features of adjacent nodes into a neighborhood vector. The CONCAT function is used to concatenate the node's own features with the aggregated neighborhood vector. After processing by the ReLU activation function and a trainable weight matrix, the node feature matrix is output.
3. The method for predicting urban population OD flow according to claim 1, characterized in that, The specific steps of the land use complementary encoder to output a land use complementary map and a geospatial distance map based on the node feature matrix are as follows: Based on the information attributes of each geographic unit, construct a geospatial distance map, calculate the land use function coefficient or functional complementarity index, construct a land use complementarity atlas based on the land use function coefficient or functional complementarity index, and provide the land use complementarity atlas; The geospatial distance map, land use complement atlas, and node feature matrix are input into a parallel graph attention network. Attention coefficients are calculated by combining the edge weight matrix of the geospatial distance map and the edge weight matrix of the land use complement map. After normalization, attention weights are obtained. Node features are aggregated to generate feature matrices corresponding to each map, thus completing the construction of the geospatial distance map and the land use complement map.
4. The method for predicting urban population OD flow according to claim 1, characterized in that, The specific steps of the traffic connectivity encoder in outputting the traffic connectivity graph based on the node feature matrix are as follows: Based on the information attributes of geographical units, a traffic connectivity atlas is constructed according to the mode of transportation. The traffic connectivity atlas and node feature matrices are input into a parallel graph attention network. Attention weights are calculated by combining the adjacency matrices of each traffic map. Node features are aggregated to generate feature matrices corresponding to each traffic map. A multi-layer graph attention network is used to capture k-order spatial correlations. Then, the accessibility matrices of each mode of transportation are constructed. The traffic connectivity map is obtained by fusing the accessibility matrices of each mode of transportation.
5. The method for predicting urban population OD flow according to claim 1, characterized in that, The specific steps by which the population OD flow predictor completes population OD flow prediction based on land use complementarity maps, geospatial distance maps, and transportation connectivity maps are as follows: Based on the node feature matrix, the origin region representation vector and the destination region representation vector are extracted. The geospatial distance map and the land use complementary map are integrated to form a spatial correlation strength matrix. A comprehensive accessibility matrix is constructed based on the traffic connectivity map. The input feature vector is constructed by splicing the origin region representation vector, the spatial correlation strength matrix, the comprehensive accessibility matrix, and the destination region representation vector. The input feature vector is input into a multilayer perceptron, and the edge regression calculation is used to output the predicted OD flow of people from the corresponding origin region to the destination region.
6. The method for predicting urban population OD flow according to claim 1, characterized in that, During training, the urban population flow prediction model optimizes its parameters using a loss function, which is: in, This represents the total number of OD pairs. For actual OD traffic, For predicting traffic flow.
7. A system for predicting urban population origin-destination flow, characterized in that, include: Data acquisition module: Used to acquire target city data, divide the target city area into multiple non-overlapping geographical units based on the target city data, and extract the information attributes of the geographical units; Adjacency Graph Building Module: Used to build a geographic adjacency graph based on the information attributes of each geographic unit; Prediction module: Used to input the geographic adjacency map into the trained urban population flow prediction model and output the prediction results; The urban population flow prediction model includes a spatial adjacency encoder, a land use complementarity encoder, a traffic connection encoder, and a population OD flow predictor. The spatial adjacency encoder outputs a node feature matrix based on the geographic adjacency map, the land use complementarity encoder outputs a land use complementarity map and a geographic spatial distance map based on the node feature matrix, the traffic connectivity encoder outputs a traffic connectivity map based on the node feature matrix, and the crowd OD flow predictor completes crowd OD flow prediction based on the land use complementarity map, the geographic spatial distance map, and the traffic connectivity map.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the crowd OD flow prediction method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of a crowd OD flow prediction method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of a crowd OD flow prediction method according to any one of claims 1-6.