Key road segment identification method based on two-stage feature learning
By employing a two-stage feature learning method, based on mobile phone location data and road network data, and utilizing natural language processing technology to generate static and dynamic embeddings of road segments, combined with attention pooling and differentiable clustering, key road segments that significantly impact traffic flow in urban road networks or local areas under normal road conditions are identified. This solves the problem of recognition limitations in existing technologies and improves the accuracy and comprehensiveness of the recognition results.
Patent Information
- Application Number
- CN202411349070.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Existing technologies struggle to identify critical road segments in large-scale urban road networks under normal road conditions, especially those with low traffic volume but important connecting functions in local areas. Furthermore, the high cost of deploying monitoring equipment makes it difficult to obtain real-time traffic data.
Based on mobile phone location data and road network data, a two-stage feature learning process is performed using natural language processing technology. Static and dynamic embeddings of road segments are generated, and attention pooling and differentiable clustering methods are used to identify key road segments.
It enables the identification of relatively critical road sections in localized areas with low traffic flow within a large-scale road network, improving the spatial distribution of identification results and the accuracy of evaluation indicators.
Smart Images

Figure CN119229649B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of spatial information technology, and particularly relates to a key road section identification method based on two-stage feature learning. BACKGROUND
[0002] In urban road networks, a few key road sections are often crucial to the operation efficiency of the entire road network. If the key road sections can be identified and effectively managed, the traffic pressure of the entire road network can be relieved, which is of great significance to improving the efficiency and reliability of the urban traffic system.
[0003] Currently, various perspectives and methods have been proposed for critical link identification in the existing technology. First, from the perspective of traffic flow, some studies identify the links that play an important role in the propagation of traffic states by analyzing traffic flow data. For example, the paper "Identification of Critical Links in Urban Road Networks Using GPS Data" identifies the frequently used critical links in the road network based on floating car GPS trajectory data and the Apriori algorithm. The paper "Identification of Critical Links in Urban Road Networks Using GPS Data" evaluates the critical links that have a greater impact on the propagation of traffic states by analyzing the spatiotemporal correlation between traffic flows. In addition, the paper "Identifying Critical Congested Roads Based on Traffic Flow-Aware Road Network Embedding" combines traffic flow distribution and road structure information to propose a road network embedding model for identifying congested links. Second, from the perspective of complex networks, researchers focus more on the relationship between the characteristics of road network structure and its criticality. The paper "A method of identifying critical road segment: A case study of peninsular Malaysia Road Network" identifies critical links by combining link length, betweenness centrality, and road density. The paper "Identifying the Critical Links in Road Transportation Networks: Centrality-based approach utilizing structural properties" identifies the critical links by analyzing the similarity between road network structure and complex networks, and defines a criticality index to measure the relative importance of links. The paper "A link criticality index embedded in the convex combinations solution of user equilibrium traffic assignment" proposes a new index that combines network topology and traffic flow characteristics to identify vulnerable nodes in the road network. In addition, methods such as cascading failure effect analysis and vulnerability analysis have also received much attention. These methods are usually used to evaluate the performance of links under unexpected events or network failures, and can identify critical links that have a greater impact on the overall operation of the road network under extreme conditions.
[0004] However, most of the current technologies fail to focus on identifying key road segments in large-scale urban road networks under normal traffic conditions, which may be due to the lack of real-time traffic data for each road segment. However, the high cost of deploying monitoring equipment makes it almost impossible to obtain traffic data for each road segment. In addition, these methods can only identify key road segments with large traffic flow or good connectivity in the entire road network, while ignoring relatively key road segments in local areas with small traffic flow. SUMMARY
[0005] In view of the above limitations and deficiencies of the prior art, the present application uses natural language processing technology to obtain static and dynamic embeddings of road segments based on large-scale mobile positioning data, and proposes a two-stage feature learning method to identify road segments that have a significant impact on the traffic flow of the entire urban road network or local area under normal traffic conditions. This not only includes road segments with high influence in the global, but also covers relatively key road segments that have small traffic flow but play an important connecting role in local areas.
[0006] The technical scheme specifically adopted by the present application to solve its technical problems is:
[0007] A key road segment identification method based on two-stage feature learning, based on mobile positioning data and road network data, using natural language processing technology to obtain static and dynamic embeddings of road segments, and using a two-stage feature learning method based on attention pooling and differentiable clustering to identify road segments that have a significant impact on the traffic flow of the entire urban road network or local area under normal traffic conditions. Thus, the key road segment identification result is obtained.
[0008] Further, on the basis of preprocessing the mobile positioning data and road network data, a traffic corpus is constructed: the origin-destination points of each motor vehicle trip are identified, and then the shortest path between each pair of origin-destination points is calculated, the road segments sequentially passed through the shortest path are taken as the trip route; the road segments in the road network are analogous to words, and the trip route is analogous to a sentence. Through the mapping from numbers to letters, the construction of the traffic corpus is completed.
[0009] Further, the method for preprocessing the mobile positioning data and road network data includes: removing repeated invalid, ping-pong or drift effect, and data outside the study area from the mobile positioning data; after data cropping, topology checking, etc. on the road network data, the NetworkX graph object is generated.
[0010] Further, the two-stage feature learning includes:
[0011] First stage: generate static embeddings of each road segment, and perform clustering, and take the cluster centers as the initial cluster centers of differentiable clustering in the second stage;
[0012] The second stage: after generating the dynamic embedding matrix of each section, using attention pooling and differentiable clustering for processing, and calculating the loss function; then adjusting the training parameters of the second stage according to the loss function value;
[0013] When the loss function value converges, the fusion features of each section are obtained; finally, K-Means clustering is performed on each fusion feature, and the obtained clustering center is the key section to be identified.
[0014] Further, the generating of the static embedding of each section is specifically generating the static embedding of each section based on the Skip-gram mode:
[0015] In the traffic corpus, the context of each section corresponds to the nearby section in the travel route; based on the Skip-gram mode of Word2Vec, the co-occurrence relationship and the order relationship of the section in the travel route are learned simultaneously; the traffic corpus is used to train the Skip-gram, and the formula of the loss function is defined as follows:
[0016]
[0017] In the formula, T is the total number of sections, w t represents the t-th section, c is a given context window size, p(w t+j |w t ) is the probability of predicting the occurrence of the neighboring section w t under the condition of a given target section w t+j .
[0018] Further, the dynamic embedding is specifically generated based on ELMo:
[0019] The dynamic embedding ELMo i of the i-th section is extracted using ELMo, and the formula is as follows:
[0020]
[0021] In the formula, L is the number of BiLSTM layers, γ is a learnable scaling parameter, S k is a learnable weight of each layer, k is the k-th layer LSTM, i refers to the i-th section, represents the concatenation of the forward and backward hidden states;
[0022] The traffic corpus is used to train ELMo, and the cross-entropy loss is used as the loss function to measure the difference between the probability distribution of the predicted section at the current position of the model and the one-hot distribution of the real section, and the specific calculation formula is as follows:
[0023]
[0024] where N is the number of road segments in the current processing batch; C is the total number of road segments; y ij is a binary indicator, y ij = 1 when the class with the highest probability of the probability distribution of sample i, corresponding to a certain position road segment that needs to be predicted in the current travel route sequence, belongs to the road segment j corresponding to the class, otherwise y ij = 0; p ij is the probability of the model predicting that sample i belongs to class j;
[0025] ELMo generates different dynamic embeddings according to the number of occurrences of the same road segment in different travel routes, and forms a dynamic embedding matrix by vertical stacking to include all dynamic embeddings of the road segment.
[0026] Further, the second stage training process is specifically:
[0027] First, generate a dynamic embedding matrix for each road segment by ELMo, and form a fixed-dimensional feature vector for each road segment by attention pooling processing; then, perform differentiable clustering on each road segment feature vector, calculate the distance from each road segment feature vector to each initial cluster center obtained in the first stage, and assign it to the nearest cluster, thereby obtaining the clustering result; finally, calculate the loss function value according to the clustering result, which is used to optimize the parameters of attention pooling and differentiable clustering in the next round of training;
[0028] The loss function consists of two parts, the first part is to minimize the ratio of intra-cluster distance to inter-cluster distance, and the second part is the moving distance of the current cluster center from the initial cluster center, and the calculation formula is as follows:
[0029]
[0030] where K represents the number of clusters, x i represents the feature vector of the i-th road segment, c k and are the cluster center and its initial cluster center of the k-th cluster respectively, D k is the sample set in the k-th cluster, and a, β and γ are weight coefficients of the three loss terms respectively.
[0031] Further, the attention pooling first calculates the input attention score of each dynamic embedding in the dynamic embedding matrix of each road segment by linear transformation and activation function, then normalizes these scores using the Softmax function, and finally uses the normalized weights to weighted sum the dynamic embedding matrix to obtain the final representation.
[0032]
[0033] In formula (4), ai represents the attention score of the i-th embedding in the dynamic embedding matrix, x i represents the i-th embedding in the dynamic embedding matrix, w x is used to linearly transform the input x i b is a bias vector, tanh is an activation function, w x is a bias vector, tanh is an activation function, w T is used to linearly transform the result after tanh processing, represents the softmax normalization of the attention score; in equation (5), z is the road segment feature vector obtained after pooling;
[0034] The differentiable clustering uses a softmax function to achieve soft assignment, and calculates the belonging probability of each road segment feature vector after attention pooling to each cluster, which is as follows:
[0035]
[0036] In the formula, r ik is the feature vector x i of the road segment i, k is the probability of the road segment i belonging to cluster k, K represents the number of clusters, c
[0037] After soft assignment, the cluster center is updated according to the result, and each cluster center c k_center is the weighted average of all samples in the cluster, and the specific formula is as follows:
[0038]
[0039] and a key road segment identification system based on two-stage feature learning, comprising:
[0040] A traffic corpus construction module: based on mobile positioning data and road network data, the travel route set is calculated, and the traffic corpus is constructed through letter mapping.
[0041] A road segment embedding extraction module: static embedding and dynamic embedding matrices of each road segment are extracted using natural language processing technology.
[0042] and an identification module: a two-stage feature learning method based on attention pooling and differentiable clustering is used to identify road segments that have a significant impact on the overall urban road network or local area traffic flow under normal road conditions; thereby obtaining the key road segment identification result.
[0043] An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the key road segment identification method based on two-stage feature learning as described above.
[0044] Compared with the prior art, the present application and its preferred schemes have at least the following outstanding advantages: (1) the static and dynamic embeddings of the road section are well fused through two-stage feature learning; (2) the relatively key road sections in the local area with small traffic flow in the large-scale road network are identified; and (3) the identification results show certain advantages in the spatial distribution and various evaluation indexes. BRIEF DESCRIPTION OF DRAWINGS
[0045] The present application will be further described in detail below in combination with the drawings and specific embodiments:
[0046] Figure 1 The figure is a technical framework diagram of the key road section identification technology based on two-stage feature learning for the embodiments of the present application.
[0047] Figure 2 The figure is a Skip-gram mode example diagram for the embodiments of the present application.
[0048] Figure 3 The figure is an ELMo model example diagram for the embodiments of the present application.
[0049] Figure 4 The figure is an attention pooling mechanism example diagram for the embodiments of the present application.
[0050] Figure 5 The figure is a top 3% key road section identification result diagram for the embodiments of the present application.
[0051] Figure 6 The figure is a key road section identification result diagram for the embodiments of the present application.
[0052] Figure 7 The figure is a regional geographic location distribution diagram for the embodiments of the present application.
[0053] Figure 8 The figure is a relatively key road section distribution diagram for the embodiments of the present application. DETAILED DESCRIPTION
[0054] In order to make the features and advantages of the present patent more obvious and easy to understand, the following embodiments are specifically described as follows:
[0055] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present description have the same meaning as generally understood by those skilled in the art to which the present application belongs.
[0056] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, devices, components and / or combinations thereof, but do not preclude the presence or addition of one or more other features, steps, operations, devices, components and / or combinations thereof.
[0057] The application is based on mobile positioning data and road network data, introduces natural language processing technology, attention pooling and differentiable clustering to process static and dynamic embedding of each road segment, and uses it as a feature to identify key road segments, and finally verifies the results through three evaluation indexes. The main content includes:
[0058] (1) preprocessing mobile positioning data and road network data;
[0059] (2) constructing and verifying traffic corpus;
[0060] (3) two-stage feature learning;
[0061] (4) obtaining key road segment identification results.
[0062] The embodiment of the application proposes a key road segment identification method based on two-stage feature learning. The basic architecture of the scheme is as shown in Figure 1 , including the following steps:
[0063] First, preprocessing mobile positioning data and road network data;
[0064] (1) Remove repeated invalid, ping-pong or drift effect, and data outside the study area in mobile positioning data. (2) After data pruning, topological checking and other work on road network data, generate its NetworkX graph object.
[0065] Second, construct and verify traffic corpus;
[0066] (1) Identify the origin and destination of each motor vehicle trip, then calculate the shortest path between each pair of origin and destination, which is the travel route of the trip. (2) Analogize the road segments in the road network as words, and the travel route as sentences, and complete the construction of the traffic corpus through the mapping from numbers to letters (i.e. 0-a, 1-b,..., 9-j). (3) Verify the rationality of the traffic corpus through the "80-20 law" of traffic flow distribution and average speed.
[0067] Third, two-stage feature learning;
[0068] (1) The first stage: generating static embeddings of each road segment, clustering them, and taking the cluster centers as the initial cluster centers of the differentiable clustering in the second stage. (2) The second stage: after generating the dynamic embedding matrix of each road segment, processing it using attention pooling and differentiable clustering, and calculating the related loss function. (3) According to the loss function value, the training parameters of the second stage are constantly adjusted.
[0069] Fourthly, the key road segment recognition result is obtained.
[0070] (1) After the loss function value converges, the fusion features of each road segment are obtained; (2) the K-Means clustering is performed on each fusion feature; and (3) the cluster centers are the key road segments to be recognized.
[0071] In the above steps, the generation of road segment static and dynamic embeddings and the training process of the second stage are the focus of the present application, which will be discussed in detail below.
[0072] (1) Generation of road segment static and dynamic embeddings
[0073] (a) Generation of static embeddings of each road segment based on the Skip-gram mode
[0074] In the traffic corpus, the context of each road segment is the nearby road segments in the travel route in which it is located. Based on the Skip-gram mode of Word2Vec, the co-occurrence relationship and the order relationship of road segments in the travel route can be learned at the same time. If the traffic corpus is used to train Skip-gram, the formula definition of its loss function is as follows.
[0075]
[0076] In the formula, T is the total number of road segments, w t represents the tth road segment, c is the given context window size, p(w t+j |w t ) is the probability of predicting the occurrence of the neighboring road segment w t under the condition of the given target road segment w t+j .
[0077] (b) Generation of road segment dynamic embeddings based on ELMo
[0078] ELMo (Embedded Language Model) can dynamically adjust the word embedding according to the use of the word in a specific context, thereby effectively processing the problem of polysemy. Similarly, the same road segment may also exhibit different characteristics in different travel routes (different context environments). Therefore, the present application uses ELMo to extract the dynamic embedding ELMo i of the ith road segment, and the formula is as follows.
[0079]
[0080] where L is the number of BiLSTM layers, γ is a learnable scaling parameter, S k is the learnable weight of each layer, k is the k-th layer of LSTM, i refers to the i-th segment, denotes the concatenation of the forward and backward hidden states.
[0081] The traffic corpus is used to train ELMo, and the Cross-Entropy Loss is used as its loss function to measure the difference between the probability distribution of the predicted segment by the model at the current position and the one-hot distribution of the true segment, and the specific calculation formula is as follows:
[0082]
[0083] where N is the number of segments in the current batch; C is the total number of segments; y ij is a binary indicator, y ij = 1 when the class with the highest probability of sample i (i.e. the probability distribution of a certain position segment to be predicted in the current travel route sequence) belongs to class j (i.e. segment j), otherwise y ij = 0; p ij is the probability of the model predicting that sample i belongs to class j.
[0084] ELMo will generate different dynamic embeddings according to the number of occurrences of the same segment in different travel routes, and can form a dynamic embedding matrix through vertical stacking, which contains all the dynamic embeddings of the segment.
[0085] (2) Second stage training process
[0086] (a) Attention pooling
[0087] Attention pooling is a method for extracting important information from sequence data. It assigns an attention weight to each time step and uses these weights to perform weighted summation on the sequence, thereby generating a fixed-dimensional representation for each unequal-length sequence.
[0088] In the present application, attention pooling first calculates the input attention scores of each dynamic embedding in the dynamic embedding matrix of each segment through linear transformation and activation function, then normalizes these scores using the Softmax function, and finally performs weighted summation on the dynamic embedding matrix using the normalized weights to obtain the final representation. The above process is as follows.
[0089]
[0090] In formula (4), α idenotes the attention score of the i-th embedding in the dynamic embedding matrix, x i denotes the i-th embedding in the dynamic embedding matrix, w x is used to linearly transform the input x i is a bias vector, tanh is an activation function, w x is used to linearly transform the result after tanh processing, T denotes the softmax normalization of the attention scores. In equation (5), z is the road segment feature vector obtained after pooling.
[0091] (b) Differentiable clustering
[0092] Differentiable clustering is a method that combines clustering algorithms with deep learning frameworks, allowing the clustering process to be trained in an end-to-end differentiable neural network. Traditional clustering algorithms such as K-means are usually not differentiable, which means they cannot be directly trained with neural networks, as the optimization of neural networks usually relies on gradient descent and backpropagation.
[0093] In this invention, differentiable clustering is achieved using a softmax function to calculate the probability of each attention-pooled road segment feature vector belonging to each cluster. The formula is as follows:
[0094]
[0095] In the formula, r ik is the feature vector x i of road segment i, K represents the number of clusters, c is the k-th cluster of clustering, and β is a parameter used to control the softness of the assignment.
[0096] After soft assignment, the cluster centers are updated according to the results, and each cluster center c k_center is the weighted average of all samples in the cluster. The specific formula is as follows.
[0097]
[0098] (c) Complete process of the second stage training
[0099] First, generate the dynamic embedding matrix of each road segment through ELMo, and process it through attention pooling to form a fixed-dimensional feature vector for each road segment. Then, perform differentiable clustering on each road segment feature vector, i.e. calculate the distance from each road segment feature vector to each initial cluster center (obtained from the first stage), and assign it to the nearest cluster to obtain the clustering result. Finally, calculate the loss function value according to the clustering result, which is used to optimize the parameters of attention pooling and differentiable clustering in the next round of training.
[0100] The loss function is composed of two parts, the first part is to minimize the ratio of intra-cluster distance and inter-cluster distance, and the second part is the moving distance of the current cluster center and the initial cluster center, and the calculation formula is as follows:
[0101]
[0102] In the formula, K represents the number of clusters, x i represents the feature vector of the i-th road section, c k and are the cluster center and its initial cluster center of the k-th cluster respectively, D k is the sample set in the k-th cluster, and α, β and γ are weight coefficients of the three loss terms respectively.
[0103] When the loss function value converges, the fusion features of each road section after two-stage learning are obtained, and K-Means clustering is performed on the fusion features, and the cluster center is the key road section to be identified.
[0104] The efficacy of the scheme provided by the application is further demonstrated and described below through specific test examples:
[0105] Based on the mobile positioning data and POI data of a certain large city in China, the two-stage feature learning method provided by the application is used to identify the key road sections at the city road network level. The experimental results of identifying 3% key road sections are shown in Figure 5 It can be found that the key road sections are mainly distributed in the areas with large traffic flow, and there are also a certain number of relatively key road sections in the local areas with small traffic flow. Further, the application uses Apriori, Node2Vec and Word2Vec as a comparison, and the experimental results are shown in Figure 6 , wherein (a)(b)(c)(d) correspond to the identification results of 2% key road sections, (e)(f)(g)(h) correspond to the identification results of 3% key road sections, and (i)(j)(k)(l) correspond to the identification results of 4% key road sections.
[0106] , wherein ①Apriori: an algorithm for mining frequent item sets in a corpus; the test results correspond to (a)(e)(i) ②Node2Vec: the Node2Vec vector of each road section can be obtained by depth-first search, which is used to identify key road sections; the test results correspond to (b)(f)(j) ③Word2Vec: directly using the static embedding of each road section Word2Vec to identify key road sections; the test results correspond to (a)(e)(k); the test results of the application correspond to (d)(h)(l).
[0107] Then, three self-defined link evaluation indexes of four methods are calculated. The comparison results of 2%, 3%, 4% key link identification are shown in Table 1.
[0108] Table 1 Comparison of key link identification results of four methods
[0109]
[0110] (1) Evaluation index introduction
[0111] The k-order traffic flow coverage rate, k-order local traffic flow bearing rate and k-order local traffic flow correlation designed by the application are used for evaluation. The three link evaluation indexes are introduced as follows.
[0112] Before introducing the evaluation indexes, it is assumed that the nearest neighbor and the second nearest neighbor of a link are the first-order and the second-order neighbors of the link, so that the k-order neighbors and the k-order neighbors (all the neighbors from the first order to the k order) of a link can be defined.
[0113] (a) k-order traffic flow coverage rate
[0114] k-order traffic flow coverage rate CR k The proportion of the traffic flow of the link set of each key link and all k-order neighbors in the traffic flow of the entire road network is referred to as the k-order traffic flow coverage rate, and the calculation formula is as follows:
[0115]
[0116] In the formula, N k (S) is the set of the key link set S itself and the k-order neighbors, and F(i) is the traffic flow of the link i.
[0117] If the traffic flow coverage rate of a key link set is higher, it means that the influence of the key link set on the entire road network is stronger.
[0118] (b) k-order local traffic flow bearing rate
[0119] k-order local traffic flow bearing rate LFR k The traffic flow of a link divided by the sum of the traffic flow of the link itself and the k-order neighbors is referred to as the k-order local traffic flow bearing rate, and the calculation formula is as follows:
[0120]
[0121] In the formula, F(i) is the traffic flow of the link i, N k (i) is the k-order neighbor set of the link i.
[0122] The higher the k-th order local traffic flow bearing rate of a link is, the stronger the influence of the link in the k-th order local road network region is. The average of the k-th order local traffic flow bearing rate of each link in the critical link set is the k-th order local traffic flow bearing rate of the critical link set.
[0123] (c) The k-th order local traffic flow correlation
[0124] The traffic flow data of a single link itself and its k-th order neighbor links in different time intervals can be used to calculate a Spearman correlation coefficient value, which can be regarded as the k-th order local traffic flow correlation of the link.
[0125] Assuming there are n time intervals, the specific calculation formula of the k-th order local traffic flow correlation of a single link v is as follows:
[0126]
[0127] In the formula, Nk(v) and |Nk(v)| are the k-th order neighbor link set of link v and the number thereof, and Qi and Qk(v, u) are the traffic flow of link v and its k-th order neighbor link u (u ∈ Nk(v)) in the i-th time interval. and Ri and Rk(v, u) are the rank of the traffic flow of link v and its k-th order neighbor link u in the i-th time interval.
[0128] The higher the ρ k (v) of a link is, the higher the correlation of the traffic flow change of the link and its k-th order neighbor links is, indicating that the influence of the link in its k-th order local region is stronger.
[0129] The average of the k-th order local traffic flow correlation of each link in the critical link set is the k-th order local traffic flow correlation value of the critical link set.
[0130] (2) Analysis of the identification results
[0131] The comparison results show that the critical links identified by the method are more distributed in the regions with larger traffic flow in the road network, and can also identify relatively critical links in regions with smaller traffic flow, and the overall performance in each evaluation index is also better.
[0132] In addition, in order to further prove that the method in this paper can identify a certain number of relatively critical links in the region with smaller traffic flow, several related regions in the 4% critical link identification results are displayed.
[0133] Since there is no unified standard for the division of the size of the traffic flow area, this paper draws lessons from the definition of the functional area of the city to divide it, because different functional areas correspond to different traffic demands. For example, the traffic flow of the business district is larger during the day, which can be regarded as a larger traffic flow area; while the traffic flow of residential and industrial areas is smaller in the same period, which can be regarded as a smaller traffic flow area.
[0134] The geographical distribution of each area is shown in Figure 7 The corresponding detailed relative key section distribution is shown in Figure 8
[0135] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0136] The present application is described with reference to flowcharts and / or block diagrams according to the method, equipment (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment produce a means for implementing the functions specified in the flow Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0137] These computer program instructions can also be stored in a computer readable storage medium that can guide the computer or other programmable data processing equipment to work in a specific way, so that the instructions stored in the computer readable storage medium produce a product including instruction means, which implements the functions specified in the flow Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0138] These computer program instructions can also be loaded into a computer or other programmable data processing equipment, so that a series of operation steps are performed on the computer or other programmable equipment to produce a computer implemented process, so that the instructions executed on the computer or other programmable equipment provide a means for implementing the functions specified in the flow Figure 1 one or more processes and / or blocks Figure 1 steps of the functions specified in the one or more blocks or one or more blocks.
[0139] It should be noted that the technical terms or scientific terms used in the present application should be understood as the general meaning understood by those skilled in the art in the field to which the present application belongs, unless otherwise defined. The terms "first", "second", and the like used in the present application do not represent any order, number, or importance, but are only used to distinguish different components. The terms "include" or "contain" and the like mean that the elements or objects before the terms cover the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and the like are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "up", "down", "left", "right", and the like are only used to represent relative positional relationships, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0140] The above is only the preferred embodiment of the present application, and is not intended to limit the other forms of the present application. Any skilled person in the art can use the disclosed technical content to make changes or modifications to equivalent embodiments. However, any simple modification, equivalent change, and modification of the above embodiments without departing from the technical solution of the present application, according to the technical essence of the present application, still belongs to the protection scope of the technical solution of the present application.
[0141] The present patent is not limited to the above best mode, and anyone can derive other various forms of key section recognition method based on two-stage feature learning under the inspiration of the present patent. Any equivalent change and modification made in accordance with the scope of the present patent application shall be covered by the present patent.
Claims
1. A method for key road segment identification based on two-stage feature learning, characterized in that: Based on mobile positioning data and road network data, static and dynamic embeddings of road segments are obtained by using natural language processing technology, and a two-stage feature learning method based on attention pooling and differentiable clustering is used to identify road segments that have a significant impact on the traffic flow of the entire city road network or local area under normal road conditions; thereby obtaining the key road segment identification result; The two-stage feature learning includes: The first stage: generating static embeddings of each road segment, clustering, and taking the clustering centers as the initial clustering centers of the differentiable clustering in the second stage; The second stage: after generating the dynamic embedding matrix of each road segment, using attention pooling and differentiable clustering for processing, and calculating the loss function; then adjusting the training parameters of the second stage according to the loss function value; When the loss function value converges, the fusion features of each road segment are obtained; finally, K-Means clustering is performed on each fusion feature, and the obtained clustering center is the key road segment to be identified; The static embedding of each road segment is generated based on the Skip-gram mode: In the traffic corpus, the context of each road segment corresponds to the nearby road segments in the travel route; based on the Skip-gram mode of Word2Vec, the co-occurrence relationship and sequence relationship of road segments in the travel route are learned simultaneously; the traffic corpus is used to train Skip-gram, and the formula of the loss function is defined as follows: (1) Where T is the total number of road sections, w t represents the t-th road segment, c is the given context window size, p(w t+j |w t ) is the given target road segment w t In the case of t+j Probability of occurrence; The dynamic embedding is generated based on ELMo: ELMo is used to extract the dynamic embedding ELMo of the i-th segment i , as follows; (2) where L is the number of BiLSTM layers, γ is a learnable scaling parameter, S k is a learnable weight for each layer, k is the k-th layer of LSTM, i refers to the i-th segment, denotes the concatenation of the forward and backward hidden states; The traffic corpus is used to train ELMo, and the cross-entropy loss is used as the loss function to measure the difference between the probability distribution of the current position predicted by the model and the one-hot distribution of the real road segment, and the specific calculation formula is as follows: (3) Where N is the number of road segments in the current processing batch; C is the total number of road segments; y ij It is a binary indicator. When the sample i, corresponding to a specific location segment in the current travel route sequence that needs to be predicted, has the highest probability of belonging to the segment j of the corresponding category, y ij =1, otherwise y ij =0;p ij is the probability that the model predicts that sample i belongs to category j; ELMo generates different dynamic embeddings according to the number of times the same road segment appears in different travel routes, and forms a dynamic embedding matrix through vertical stacking to contain all dynamic embeddings of the road segment; The second stage training process is as follows: First, generate the dynamic embedding matrix of each road segment by ELMo, and process it by attention pooling to form a fixed-dimensional feature vector for each road segment; then, perform differentiable clustering on each road segment feature vector, calculate the distance between each road segment feature vector and the initial clustering center obtained in the first stage, and assign it to the nearest cluster, thereby obtaining the clustering result; finally, calculate the loss function value according to the clustering result, which is used to optimize the parameters of attention pooling and differentiable clustering in the next round of training; The loss function consists of two parts: the first part is to minimize the ratio of intra-cluster distance to inter-cluster distance, and the second part is the moving distance of the current clustering center from the initial clustering center, and the calculation formula is as follows: wherein K denotes the number of clusters, the sample represents the feature vector of the i-th road segment, and are the cluster center of the k-th cluster and its initial cluster center, respectively, is the sample set in the k-th cluster, , and are the weight coefficients of the three loss terms, respectively.
2. The two-stage feature learning based key segment identification method of claim 1, wherein: On the basis of preprocessing mobile positioning data and road network data, a traffic corpus is constructed: the origin and destination of each motor vehicle trip is identified, then the shortest path between each pair of origin and destination is calculated, and the road segments sequentially passed through the shortest path are taken as the travel route; the road segments in the road network are analogous to words, and the travel route is analogous to a sentence; through the mapping of numbers to letters, the construction of the traffic corpus is completed.
3. The two-stage feature learning based key segment identification method of claim 2, wherein: The method for preprocessing mobile phone positioning data and road network data comprises: eliminating repeated invalid data, data with ping-pong or drift effect, and data outside the study area in the mobile phone positioning data; and generating a NetworkX graph object of the road network data after data cropping and topological checking of the road network data.
4. The key road segment identification method based on two-stage feature learning according to claim 1, characterized in that: The attention pooling first calculates the input attention scores of each dynamic embedding in the dynamic embedding matrix of each road segment by linear transformation and an activation function, then normalizes the scores using a Softmax function, and finally performs weighted summation on the dynamic embedding matrix using the normalized weights to obtain the final representation; (4) (5) In formula (4), represents the attention score of the i-th embedding in the dynamic embedding matrix, x i represents the i-th embedding in the dynamic embedding matrix, w x is used for linear transformation of the input x i b is a bias vector, tanh is an activation function, w x is used for linear transformation of the result after tanh processing, T represents softmax normalization of the attention score; in formula (5), z is a road segment feature vector obtained after pooling. The differentiable clustering uses a softmax function to realize soft assignment and calculate the belonging probability of each road segment feature vector processed by attention pooling to each cluster, and the formula is as follows: (6) wherein is a feature vector for link i is the probability of belonging to cluster k, K being the number of clusters, is a parameter for controlling the degree of softness of the distribution; After soft assignment, the cluster centers are updated according to their results, each cluster center is the weighted average of all samples in the cluster, and the specific formula is as follows; (7)。 5. A system employing the two-stage feature learning based critical link identification method as claimed in claim 1, characterized in that, It comprises: A traffic corpus construction module: calculating the set of travel routes based on mobile phone positioning data and road network data, and completing the construction of the traffic corpus through letter mapping; A road segment embedding extraction module: extracting the static embedding and dynamic embedding matrix of each road segment using natural language processing technology; And an identification module: using a two-stage feature learning method based on attention pooling and differentiable clustering to identify the road segments that have a significant impact on the traffic flow of the entire urban road network or local area under normal road conditions; thereby obtaining the key road segment identification result.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the key road segment identification method based on two-stage feature learning according to any one of claims 1-4 when executing the program.
Citation Information
Patent Citations
Traffic state prediction method for urban road network based on key road sections
CN109285346A
Urban short-term traffic flow prediction method, system and equipment
CN118097982A