A OD flow prediction method considering spatial heterogeneity
By constructing the initial relationship graph, obtaining the optimization relationship graph and node feature vectors, establishing a smooth weighted loss function, and training the graph attention network, solving the problems of complex correlation and long-tail effects in OD flow prediction, significantly improving the OD flow Prediction accuracy and efficiency.
Patent Information
- Application Number
- CN202410655219.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Existing OD flow prediction methods are difficult to effectively express the complex correlation between geographic units, and fail to fully consider the heterogeneous spatial organization and long-tail effects of OD flow, which affects the prediction accuracy and efficiency.
By constructing an initial relationship graph, calculate the connection strength between nodes and perform graph pruning, obtain optimization relationship graph, obtain community indicators and socio-economic and geographical indicators to form node feature vectors, establish a smooth weighted loss function to train the graph attention network, and use Graph Attention Network and LGBM models for prediction.
The accuracy and efficiency of OD flow prediction are improved, the learning ability of spatial heterogeneous distribution of OD flow is enhanced, and the robustness of the model is improved, especially when dealing with unbalanced flow distribution.
Smart Images

Figure CN118504762B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of population and material OD flow analysis, and in particular to an OD flow prediction method taking into account spatial heterogeneity. Background Art
[0002] The movement of population and materials in geographic space not only reflects the interaction between geographic units, but also has important significance for in-depth understanding of regional spatial structure, promoting regional coordinated development, and optimizing transportation planning and management. Origin-destination (OD) flow prediction, that is, using historical OD flow data and the attribute characteristics of geographic units and their mutual relationships to infer the flow between geographic units, plays a key role in predicting the future pattern of urban mobility, formulating effective urban development strategies, guiding traffic flow diversion, sensing abnormal events, optimizing transportation networks, and configuring transportation infrastructure. In addition, OD flow prediction also plays an auxiliary role in dealing with public issues such as traffic pollution and epidemic spread.
[0003] Existing OD flow prediction methods include knowledge-driven empirical models and data-driven machine learning models. Empirical models are derived from physical laws or optimization theories. With the advantages of being easy to use and highly interpretable, they are widely used to explore the movement patterns and operation mechanisms of groups. Typical empirical models include gravity models, radiation models, and intervention opportunity models. Machine learning models mainly include two categories: classical machine learning models and deep learning models. The former uses kernel or tree-structured models as base models, such as support vector machines, gradient boosting regression trees, and random forests. The latter usually uses graph-structured neural networks as base models, such as GMEL, SI-GCN, SpatialGAT, ConvGCN RF, GODDAG, etc. Graph neural network models have become the mainstream method for OD flow prediction because they can capture complex correlations between geographic units and perform nonlinear fitting. However, in the existing prediction methods, there are the following problems: the complex correlations between geographic units are difficult to express, the heterogeneous spatial organization of OD flows is difficult to take into account, and the long-tail effect is difficult to be fully captured; these problems will affect the accuracy and efficiency of OD flow prediction. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide an OD flow prediction method taking into account spatial heterogeneity, and the technical solution adopted is as follows:
[0005] An embodiment of the present invention provides an OD flow prediction method taking into account spatial heterogeneity, and the method is specifically:
[0006] Based on historical data, each sub-region in the study area is used as a node to construct an initial relationship graph; the connection strength between nodes is calculated based on the actual flow and expected flow between any two nodes; the initial relationship graph is pruned according to the connection strength to obtain an optimized relationship graph;
[0007] Obtaining the community index of each node in the optimization relationship graph; the community index, socioeconomic index and geographic index constitute the initial feature vector of the node;
[0008] Establish a smooth weighted loss function to train the graph attention network; input the initial feature vector into the trained graph attention network to obtain the final feature vector of the node;
[0009] Prediction is performed based on the final feature vector, actual distance, and community relationship of two nodes to obtain the predicted OD flow between the nodes.
[0010] Preferably, an initial relationship graph is constructed based on historical data using each sub-region in the study area as a node, including:
[0011] The sub-regions are taken as nodes, and the nodes with OD flows are connected to obtain the initial relationship graph.
[0012] Preferably, the connection strength is:
[0013]
[0014] Among them, q ij Represents node v i and node v j The connection strength between ij Represents node v i To node v j OD flow between; f ji Represents node v j To node v i OD flow between; f i Indicates the generation and arrival of node v i The sum of the traffic; N represents the number of nodes.
[0015] Preferably, pruning the initial relationship graph according to the connection strength to obtain an optimized relationship graph includes:
[0016] When the connection strength between nodes is less than 0, the edges between nodes are pruned; when the connection strength between nodes is greater than or equal to 0, the edges between nodes are retained to obtain an optimized relationship graph.
[0017] Preferably, obtaining the community index of each node in the optimization relationship graph includes:
[0018] The Louvain algorithm is used to process each node in the optimization relationship graph to obtain the community index of each node.
[0019] Preferably, a smooth weighted loss function is established to train the graph attention network, including:
[0020] According to the probability of OD flow between nodes in the training set, the smooth distribution probability corresponding to the OD flow between nodes is obtained;
[0021] A smooth weighted loss function is constructed based on the smooth distribution probability, specifically:
[0022]
[0023] Where L represents the smooth weighted loss function; δ represents the control parameter; f ij Represents node V i To Node V j OD flow, that is, the true value of OD flow; represents the predicted value; represents the true value of the OD flow f ij The corresponding smooth distribution probability;
[0024] The graph attention network is trained using the training set combined with the smoothed weighted loss function until the smoothed weighted loss function converges and the training is completed.
[0025] Preferably, the calculation formula for obtaining the smooth distribution probability corresponding to the OD flow between each node according to the probability of the OD flow between each node in the training set is:
[0026]
[0027]
[0028] Among them, p(f ij ) represents the true value of OD flow f ij The probability of appearing in the training set; k(f ij ,f i ′ j ) represents the Gaussian kernel, f ij ′ represents the target value, f ij Represents node V i To Node V j OD flow, that is, the OD flow between nodes in the training set; ‖f ij ,f ij ′‖ represents the target value f ij ′ and the true value f ij The Euclidean distance of ; ε is the parameter that controls the bandwidth of the kernel function; represents the true value of the OD flow f ij The corresponding smooth distribution probability.
[0029] Preferably, prediction is performed based on the final feature vectors, actual distances, and community relationships of two nodes to obtain the predicted OD flow between the nodes, including:
[0030] The final feature vectors of the two nodes, the actual distance between the nodes and the community relationship constitute an input vector; the input vector is input into the LGBM model to train the LGBM model; after the training is completed, the input vector is input into the trained LGBM model to output the predicted OD flow between the two nodes.
[0031] The embodiments of the present invention have at least the following beneficial effects: the present invention constructs an initial relationship graph based on the sub-regions in the study area, calculates the connection strength between nodes with connection relationships, and obtains an optimized relationship graph based on the connection strength, and enhances the correlation expression between sub-regions (nodes) by pruning weak connections, so that the features of geographic units are more effectively shared in the graph neural network, thereby improving the training efficiency and prediction quality of the model;
[0032] At the same time, the community index of each node in the optimization relationship graph is obtained, and the initial feature vector of the node is formed with the socioeconomic index and the geographic index, which can identify and focus on the differences in spatial organization patterns within and between different communities (or subgraphs), thereby enhancing the learning ability of the spatial heterogeneous distribution of OD flows;
[0033] A smooth weighted loss function is also established to train the graph attention network, taking into account the characteristics of adjacent distribution probability traffic, optimizing the model's learning ability for low distribution probability traffic events, and significantly improving the robustness of the model in dealing with unbalanced traffic distribution. In summary, the present invention can significantly improve the efficiency and accuracy of OD flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A method flow chart of an OD flow prediction method taking into account spatial heterogeneity provided by an embodiment of the present invention;
[0036] Figure 2 A convolution diagram of an OD flow prediction method taking into account spatial heterogeneity provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of an OD flow prediction method taking into account spatial heterogeneity proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.
[0038] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0039] A specific solution of an OD flow prediction method taking into account spatial heterogeneity provided by the present invention is described in detail below with reference to the accompanying drawings.
[0040] Example:
[0041] The main application scenarios of the present invention: For the prediction of OD flow, due to the differences in resource allocation of geographical units and the imbalance of group mobility demand, the flow pattern of OD flow generally has heterogeneity, which is mainly reflected in the heterogeneity of numerical distribution and spatial distribution. The heterogeneity of numerical distribution is manifested in the long-tail distribution of traffic in a statistical sense, that is, the traffic between most geographical units is small or even non-existent, while the traffic between a few geographical units is extremely high. Spatial distribution heterogeneity refers to the uneven distribution of OD flow in a region, which is usually manifested as a local aggregation pattern of flow. Existing OD flow prediction methods do not take into account the characteristics of numerical distribution and spatial distribution, which affects their prediction results.
[0042] See also Figure 1 , which shows a method flow chart of an OD flow prediction method taking into account spatial heterogeneity provided by an embodiment of the present invention, the method comprising the following steps:
[0043] Step S1, based on historical data, each sub-area in the study area is used as a node to construct an initial relationship graph; the connection strength between nodes is calculated according to the actual flow and expected flow between any two nodes; the initial relationship graph is pruned according to the connection strength to obtain an optimized relationship graph.
[0044] Determine the study area R. The study area R is the spatial location of flow activities, often represented by a city, province or country. A study area R contains many sub-areas, and then obtain the historical data of OD flow in the study area. The flow elements move between these areas to form OD flow. In a large study area, there are multiple sub-areas, that is, multiple geographical units; a sub-area is taken as a node, and the nodes are connected by edges with OD flow to obtain the initial relationship graph;
[0045] The initial relationship graph G = (V, E) represents the connection relationship between sub-regions in the study area R, where V = {v1,…,v N} represents the set of sub-regions (i.e., graph nodes), and the number of nodes is |V|=N. E={e ij |1≤i,j≤N} is the set of edges between nodes. An edge represents whether there is a connection between two nodes. The method to determine whether an edge exists can be based on the adjacency relationship between nodes or whether there is a flow between nodes. This paper is based on the latter. ij =1 refers to node v i and node v j There is OD flow between them, otherwise e ij =0.
[0046] The relationships between geographic units are complex and diverse, such as attribute relationships, spatial adjacency relationships, and semantic relationships. These relationships are crucial for accurately learning and predicting flow patterns. Existing graph structure generation methods are usually based on historical flow data and regard any non-zero flow as a connection between geographic units. However, due to the long-tail characteristics of the flow value distribution, the flow between a large number of geographic units is low or even close to zero, resulting in a large number of weak connections in the graph. These weak connections increase the structural complexity and scale of the graph, which has a negative impact on the effective expression of geographic unit relationships and the prediction performance of the model.
[0047] In graph neural networks, accurately constructing graph structures is crucial because it determines how the model captures and understands complex relationships between nodes, such as spatial relationships, attribute relationships, and semantic relationships. Although there are many methods for constructing graph structures, the historical flow-based construction method is widely used because it can comprehensively capture the actual interactions between nodes and integrate different types of relationships. This method mainly determines the connection between nodes based on whether there is historical flow between them. However, the inherent heterogeneity of OD flows causes the historical flow between many nodes to be close to zero, resulting in a large number of weak connections. These weak connections increase the complexity and scale of the graph, which not only affects the accurate expression of node relationships, but also may lead to over-smoothing problems during model training.
[0048] To address the above problems, this paper proposes a new graph reconstruction strategy, which aims to simplify the graph structure and enhance its expressiveness by carefully checking the connection strength between nodes and pruning weak connections that are not tight enough based on historical traffic data.
[0049] After obtaining the initial relationship graph, the closeness of the relationship between nodes is measured by comparing the actual traffic between nodes with the expected traffic in the random network to optimize the initial relationship graph. Specifically, the historical OD flow set F is first added to the initial relationship graph, that is, the traffic between two nodes is obtained, and then the node v is calculated. i and node v j The difference between the actual flow and the expected flow is recorded as the connection strength q ij ; Specifically, the connection strength q ij for:
[0050]
[0051] Among them, q ij Represents node v i and node v j The connection strength between ij Represents node v i To node v j OD flow between; f ji Represents node v j To node v i OD flow between; f i Indicates the generation and arrival of node v i The sum of the flow rates, f i =∑ j≤N (f ij +f ij ), N represents the number of nodes.
[0052] When the actual flow is less than the expected flow, the edge is pruned, that is, When the connection strength is less than 0, the edges between nodes are pruned; when it is greater than or equal to 0, the edges between nodes are retained, and the optimized relationship graph is obtained, which is expressed as in, represents the edge set of the reconstructed graph, is the pruned edge, representing the closely connected node relationship. Reconstructing the graph not only reduces the structural complexity, but also enhances the expression of node correlation, thus helping the graph neural network model to more effectively integrate node relationship features and train higher quality node representations.
[0053] Step S2, obtaining the community index of each node in the optimization relationship graph; the community index, socio-economic index and geographic index constitute the initial feature vector of the node.
[0054] When predicting OD flows, it is necessary to determine the initial features of each node and then form its feature vector. These features are then used to learn the features of each node. The heterogeneous spatial organization of OD flows is usually manifested as the graph structure being divided into several relatively independent and internally clustered subgraphs, which is one of the most common forms of spatial heterogeneity of OD flows. This spatial distribution heterogeneity means that there may be significant differences in flow patterns within different subgraphs (or communities). These differences are affected by the socioeconomic characteristics and spatial relationships of the geographic units within the subgraphs, such as resource endowments and policies. Existing methods mostly use global models to learn the flow patterns of the entire region, but fail to consider the differences in flow patterns between subgraphs caused by the characteristics of the geographic units, resulting in limited prediction performance.
[0055] The local aggregation of flows is one of the main manifestations of heterogeneity in flow patterns and is ubiquitous in the real world. Locally aggregated flows are called communities (or subgraphs), which have relatively independent spatial organization mechanisms within the community, and the interactions between communities are sparse. In the field of complex network science, community detection algorithms are specifically used to discover community structures. The algorithm determines a community label for each node, and the nodes in the same community form an isomorphic spatial organization. Therefore, the community detection results provide a feasible solution for the heterogeneous spatial organization of coded flows. The present invention needs to determine the community index of each node as a feature of each node. Preferably, the present invention uses the Louvain algorithm, which is the most widely used in the field of urban mobility, to detect the community structure, and uses the Louvain algorithm to process each node in the optimization relationship graph. This method is implemented based on modularity, and the calculation formula of modularity is as follows:
[0056]
[0057] Where Q represents modularity, and Q∈[-0.5,1]; S i Represents node v i The strength of node v i The sum of the traffic of all connected edges; S j Represents node v j The strength of node v j The sum of the flow of all connected edges; f ji Represents node v j To node v i OD flow between; c i and c j Respectively represent the node v i and node v j The community to which he belongs; σ(c i ,c j ) represents node v i and node v jWhether they are in the same community, if yes, it is 1, otherwise it is 0. When the traffic within the community exceeds the expected traffic obtained by random allocation, Q is positive. The higher Q is, the better the quality of community division.
[0058] Then, the community index of each node is obtained according to the modularity. The present invention uses the community label as part of the node feature, so that the differences in flow space organization can be paid attention to in the subsequent training process. Furthermore, considering that the formation of flow space organization is closely related to the socio-economic characteristics and spatial configuration of the geographical unit, the present invention also introduces the node socio-economic indicators and geographic indicators, which together with the node community indicators constitute the initial feature vector of the node; wherein, the socio-economic indicators come from the data related to cargo transportation in the China Statistical Yearbook, specifically including gross national product, the proportion of the primary, secondary and tertiary industries in GDP, the import and export volume of goods, the number of industrial enterprises, the total retail sales of social consumer goods, the number of employees in each industry, and the road freight volume. The geographical indicator is the spatial distance between nodes, which is calculated by the Haversine distance based on the longitude and latitude of the nodes.
[0059] Step S3, establish a smooth weighted loss function and train the graph attention network; input the initial feature vector into the trained graph attention network to obtain the final feature vector of the node.
[0060] After obtaining the initial feature vector of each node, it is necessary to use the graph attention network to process it to obtain the final feature vector of each node. The graph attention network can aggregate the neighborhood information of the node. When encoding the node representation, it not only considers the characteristics of the node itself, but also the correlation between nodes. Therefore, it can more accurately depict the complex connections between geographical units and the operating mechanism of the flow pattern.
[0061] A graph attention network (GAT) is established to learn the operating mechanism of flow patterns through model training. During the training process, a bilinear function is used to calculate the flow between nodes, and the node representation is iteratively updated based on the weighted Huber loss function with a distribution smoothing paradigm to obtain the final node feature vector.
[0062] The capture of the long-tail effect is completed during model training, using an end-to-end training method. This means that the model learns the flow pattern directly from the raw data and focuses the optimization target on the loss function, so that the original data information can be fully utilized and the manual design of the intermediate process can be avoided. In particular, the loss function is improved in a targeted manner to improve the model's ability to handle long-tail distribution data.
[0063] This paper designs a smooth weighted loss function. On the basis of the traditional loss function, the inverse of the OD flow value distribution probability is used as the loss weight of the corresponding flow value to increase the model's attention to low distribution probability flow values. However, since the density distribution of unbalanced data is highly discrete, directly using the inverse of the distribution probability as the loss weight will ignore the learning of certain flow events, especially those with a probability close to zero, such as Figure 2 The flow rate shown is f ij ∈[10,11].
[0064] The graph attention network can aggregate the neighborhood information of nodes. When encoding the representation of nodes, it not only considers the characteristics of the node itself, but also the correlation between nodes. Therefore, it can more accurately depict the complex connections between geographical units and the operating mechanism of flow patterns. Specifically, the graph attention network is implemented through the graph attention layer. The attention layer assigns different attention weights to the neighbors of the node. The calculation formula is as follows:
[0065]
[0066] In the formula, is the node v in layer l j For node v i The attention weight, For node v i In the hidden representation at layer l, a l and Θ are trainable parameters, ∥ represents the concatenation operation, T is the transpose operation of the vector, and l ij is the feature of the edge, which is represented by the node distance to integrate the geographical information of the node. This is based on the previously widely confirmed distance decay law of flow, that is, distance is an important factor affecting flow intensity. N(v i ) is the node v i The set of neighbor nodes of . It should be noted that due to the asymmetry of the flow,
[0067] Based on attention weight The node features are weighted and summed to obtain a node representation that aggregates both neighborhood information and its own information, that is, the final feature vector of the node.
[0068] During the training process, we first need to obtain the training set, in which the OD flow between nodes in the training set is known. The final feature vector of the output node of the graph attention network is passed through a bilinear function to calculate the flow between nodes. The formula is as follows:
[0069]
[0070] in, is the inter-node traffic calculated by the bilinear function, W is a trainable parameter matrix with dimension N, which is used to model the interaction between the origin and the destination; For node v i Hidden expression at the lth layer. It should be noted that the flow from node 1 to node 2 is different from the flow from node 2 to node 1. When obtaining the flow between nodes, if there is a mutual OD flow between two nodes, the flow obtained by bilinear function calculation is two.
[0071] Considering the similarity between the probability distribution of flow values in a certain interval and the probability distribution of flow values in its adjacent intervals, this paper introduces the Gaussian distribution smoothing paradigm and solves this problem by converting the distribution probability of flow values from discrete to continuous through the Gaussian kernel function. Specifically, the Gaussian kernel is convolved with the original data density distribution to obtain the smoothed data distribution as follows: Figure 2 (b) In the new data distribution, the distribution probability of the flow value is not only related to itself, but also affected by its adjacent flow values. This paper defines the new data distribution as a smoothed density distribution. The convolution smoothing process is as follows: Figure 2 As shown in the figure, according to the probability of OD flow between nodes in the training set, the smooth distribution probability corresponding to the actual value of the flow between any two nodes in the optimization relationship diagram composed of the training set data is obtained. The formula is as follows:
[0072]
[0073]
[0074] Among them, p(f ij ) is the true value of OD flow f ij The probability of appearing in the training set, k(f ij ,f′ ij ) is the Gaussian kernel, which describes the target value f ij ′ and any f ij The similarity of ||f ij ,f ij ′|| represents the target value f ij ′ and any f ij The Euclidean distance of ||f ij ,f ij As ′|| increases, the value of the Gaussian kernel decreases, and the similarity between flow values decreases. ε is the parameter that controls the bandwidth of the kernel function, that is, the rate at which the similarity between flow values decays with distance. Yes ij ′ is the smooth distribution probability in the smooth density distribution, and its reciprocal is the weight of the corresponding flow value in the loss. Then the smooth weighted loss function is obtained, which is:
[0075]
[0076] Where L represents the smooth weighted loss function; f ij Represents node V i To Node V j OD flow, that is, the true value of OD flow; represents the predicted value; represents the true value of the OD flow f ij The corresponding smooth distribution probability; δ represents the control parameter, which is used to control when the loss function switches from mean square error (MSE) to absolute error (MAE). When , L is equivalent to MSE, otherwise, L is equivalent to MAE. The balance between MSE and MAE makes the smooth loss function more robust to outliers and alleviates the potential impact of OD flow extreme values on model training. In addition, the training process uses stochastic gradient descent (Adam) to update parameters.
[0077] When the smooth loss function converges, the graph attention network training is completed, and the initial feature vector of the node is input into the trained graph attention network to obtain the final feature vector of the node.
[0078] Step S4, predicting based on the final feature vectors, actual distances, and community relationships of the two nodes to obtain the predicted OD flow between the nodes.
[0079] To predict the node v i to v j OD flow, the present invention uses gradient boosting machine (GBM) as a predictor. GBM integrates multiple weak learners to complete the regression task, which can well capture complex relationships and reduce the risk of overfitting, and is suitable for OD flow modeling problems. This paper uses Light Gradient Boosting Machine (LGBM) as a predictor. Compared with other GBMs such as GBRT, the advantage of this framework lies in the processing of large-scale data sets and high-dimensional features, which is more in line with the actual application needs of large-scale data sets in the real world.
[0080] After obtaining the final feature vectors of the two nodes, it is also necessary to obtain the actual distance between the nodes and the community relationship between the nodes to form an input vector. The community relationship between the nodes is whether the two nodes belong to the same community. If they belong to the same community, they are encoded as 1, and if they do not belong to the same community, they are encoded as 0.
[0081] The input vector is input into the LGBM model to train the LGBM model; after the training is completed, the input vector is input into the trained LGBM model to output the predicted OD flow between the two nodes.
[0082] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0083] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0084] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting OD flow taking into account spatial heterogeneity, characterized in that: The method includes: Based on historical data, each sub-region in the study area is used as a node to construct an initial relationship graph; the connection strength between nodes is calculated based on the actual flow and expected flow between any two nodes; the initial relationship graph is pruned according to the connection strength to obtain an optimized relationship graph; Obtaining the community index of each node in the optimization relationship graph; the community index, socioeconomic index and geographic index constitute the initial feature vector of the node; Establish a smooth weighted loss function to train the graph attention network; input the initial feature vector into the trained graph attention network to obtain the final feature vector of the node; According to the final feature vector, actual distance and community relationship of two nodes, prediction is made to obtain the predicted OD flow between nodes; The connection strength is: , in, Representation Node and nodes The strength of the connection between Representation Node To Node OD flow between; Representation Node To Node OD flow between; Indicates the generation and arrival nodes The sum of the traffic; The smooth weighted loss function is established to train the graph attention network, including: According to the probability of OD flow between nodes in the training set, the smooth distribution probability corresponding to the OD flow between nodes is obtained; A smooth weighted loss function is constructed based on the smooth distribution probability, specifically: , in, represents the smoothed weighted loss function; Indicates control parameters; Representation Node To Node OD flow, that is, the true value of OD flow; represents the predicted value; Indicates the true value of the OD flow The corresponding smooth distribution probability; The graph attention network is trained using the training set combined with the smoothed weighted loss function until the smoothed weighted loss function converges and the training is completed.
2. The OD flow prediction method according to claim 1, characterized in that: The initial relationship diagram is constructed based on historical data by taking each sub-region in the study area as a node, including: The sub-regions are taken as nodes, and the nodes with OD flows are connected to obtain the initial relationship graph.
3. The OD flow prediction method according to claim 1, characterized in that: The step of pruning the initial relationship graph according to the connection strength to obtain the optimized relationship graph includes: When the connection strength between nodes is less than 0, the edges between nodes are pruned; when the connection strength between nodes is greater than or equal to 0, the edges between nodes are retained to obtain an optimized relationship graph.
4. The OD flow prediction method according to claim 1, characterized in that: The obtaining of the community index of each node in the optimization relationship graph includes: The Louvain algorithm is used to process each node in the optimization relationship graph to obtain the community index of each node.
5. The OD flow prediction method considering spatial heterogeneity according to claim 1, characterized in that: The calculation formula for obtaining the smooth distribution probability corresponding to the OD flow between each node according to the probability of the OD flow between each node in the training set is: , , in, Indicates the true value of the OD flow The probability of appearing in the training set; represents the Gaussian kernel, represents the target value, Representation Node To Node OD flow, that is, the OD flow between nodes in the training set; Indicates the target value With the true value The Euclidean distance of Parameters to control the bandwidth of the kernel function; Indicates the true value of the OD flow The corresponding smooth distribution probability.
6. The OD flow prediction method considering spatial heterogeneity according to claim 1, characterized in that: The method of performing prediction based on the final feature vectors, actual distances, and community relationships of two nodes to obtain the predicted OD flow between the nodes includes: The final feature vectors of the two nodes, the actual distance between the nodes and the community relationship constitute an input vector; the input vector is input into the LGBM model to train the LGBM model; after the training is completed, the input vector is input into the trained LGBM model to output the predicted OD flow between the two nodes.
