A map inference method embedding near neighbor road behavior differences
By combining convolutional neural networks with graph attention networks, and utilizing the U-Net decoder and grid affinity loss function, the problem of inaccurate parallel road identification was solved, achieving higher-precision map inference and improving the accuracy of navigation and route planning.
Patent Information
- Application Number
- CN202510489549.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Existing technologies struggle to accurately identify and distinguish parallel roads, resulting in low accuracy inferences from electronic maps, especially when parallel roads are in similar directions in urban traffic.
A combined model of convolutional neural network and graph attention network is adopted. By constructing a grid co-occurrence graph and graph attention network, the differences between neighboring roads of parallel roads are extracted. Combined with U-Net decoder and heuristic graph generation method, the grid representation and road topology tensor are optimized. A grid affinity loss function to enhance the differences between parallel roads is designed to improve the recognition ability.
It significantly improves the ability to identify and distinguish parallel roads, enhances the accuracy of map inference, and provides more precise decision support for navigation and route planning.
Smart Images

Figure CN120411908B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of trajectory mining technology and relates to a map inference method that embeds differences in the behavior of neighboring roads. Background Technology
[0002] Accurate electronic maps are crucial for applications such as navigation and autonomous driving, and need to be updated in real time according to changes in the road network. In recent years, the tracks generated by motor vehicles have spread across most of the city's roads, providing a data foundation for electronic map inference. To alleviate the various adverse effects of urban traffic congestion, many cities have constructed parallel roads to divert traffic, such as main and auxiliary roads and grade-separated roads. These parallel roads are adjacent to each other and have similar directions, and the trajectory data of passing vehicles are mixed together, making them difficult to accurately identify and even easily mistakenly merged into one road, thus hindering accurate map inference.
[0003] Currently, methods for inferring maps based on trajectory data can be categorized into five types. The first type is clustering-based methods, which first use spatial clustering algorithms to infer nodes and edges. If a sufficient number of trajectories pass through any two nodes or edges, they are linked to generate a map. The second type is incremental branching-based methods, which start with an empty map and iteratively fit trajectories into roads and insert them to expand the current map, thus generating the final map. The third type is cross-linking-based methods, which first extract intersections from the trajectory data based on the characteristics of directional diversity and speed variability, and then link them to form a map. The fourth type is density-based methods, which first convert the trajectory data into a discretized density image and extract the road skeleton map from it using kernel density estimation, and then use a heuristic graph extraction algorithm to convert it into a map. The last type is deep learning-based methods, which treat road skeleton extraction as a semantic segmentation task. Road skeletons are extracted from the density image using a U-Net-based segmentation model, and then a heuristic graph extraction algorithm is used to generate a map. The first four types of methods all use heuristic algorithms to infer maps, heavily relying on the setting of distance thresholds, such as the bandwidth in kernel density estimation and the search radius in DBSCAN. Inappropriate threshold settings easily lead to low accuracy in parallel road identification, specifically manifested as missing one road or even mistakenly merging multiple parallel roads into a single road. Although the last type of method proposes introducing the direction of trajectory points to distinguish parallel roads in opposite directions, they still cannot accurately identify and differentiate these parallel roads because some parallel roads also have similar directions. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to provide a map inference method that embeds behavioral differences of neighboring roads. This method can effectively and accurately identify parallel roads using trajectory data, thereby improving the accuracy of map inference and providing effective decision support for navigation services and route planning.
[0005] To achieve the above-mentioned technical objectives, the technical solution adopted by the present invention is as follows:
[0006] A map inference method embedding differences in the behavior of neighboring roads includes the following steps:
[0007] Step S1: Divide the road network area to be tested into uniformly sized grids, extract the behavioral features corresponding to each grid based on the trajectory data within the grid, and obtain the grid feature matrix corresponding to the road network area. Then, extract trajectory-image slices of the same size and non-overlapping from the grid feature matrix.
[0008] Step S2: Use a combined model of convolutional neural network and graph attention network to represent the behavioral differences of neighboring roads of parallel roads into a grid representation.
[0009] Step S3: Infer the road topology tensor from the grid representation obtained in step S2 using a U-Net-based road topology decoder, and convert the road topology tensor into a map using a heuristic graph generation method.
[0010] In a specific implementation, the grid representation and road topology tensor inference model can also be optimized through a grid affinity learning strategy based on the enhanced differences of neighboring roads.
[0011] To optimize the above technical solution, the specific measures also include:
[0012] The above step S1 specifically includes:
[0013] Step 1.1) Divide the road network area to be tested into a grid of uniform size with a grid side length of len. Considering that the minimum width of the lane is about 2m, set len to 2m.
[0014] Step 1.2) Based on the trajectories in the grid obtained in Step 1.1, the present invention extracts the following behavioral features for each grid:
[0015] 1) Frequency of trajectory points (f) pf ), representing the number of trajectory points within the grid; 2) turning frequency (f tf ), representing the number of turning points within the grid. A turning point is defined as follows: if the angle difference between the direction of the current trajectory point and the direction of the previous trajectory point is greater than 35 degrees, then the trajectory point is determined to be a turning point; 3) Trajectory segment frequency (f sf), representing the number of trajectory segments within the grid; a line segment connecting two consecutive trajectory points constitutes one trajectory segment; 4) Point average velocity (f) ps ), representing the average velocity of the trajectory points within the grid. The velocity of the current trajectory point is calculated as the ratio of the distance difference to the time difference between it and the previous trajectory point; 5) Point direction distribution Representing the directional distribution of trajectory points within the grid: Map the orientation of each trajectory point to eight standardized, equal-sized directional histograms (0°~45°, 45°~90°, 90°~135°, 135°~180°, 180°~225°, 225°~270°, 270°~315°, 315°~360°) to obtain the eight-directional distribution corresponding to the grid; 6) Linear average velocity (f ss ), representing the average velocity of the trajectory line segment within the grid; 7) Line direction distribution This represents the directional distribution of trajectory line segments within the grid. The line direction distribution... Distribution of points in the direction The dimension of the feature is 8, and the dimension of the other features is 1.
[0016] By combining the above seven types of features, the 21-dimensional behavioral feature vector of each grid can be represented as follows: The final result is the grid feature matrix corresponding to the entire road network area, denoted as G.
[0017] Since the road network area to be tested is usually large, it is impractical to perform map inference tasks directly over the entire road network area. Therefore, the grid feature matrix is divided into multiple non-overlapping sub-matrices of the same size, and each sub-matrix is represented as a trajectory-image piece. Thus, each trajectory-image piece corresponds to a visual image, containing H×W grids, denoted as X. f ∈R 21×H×W In one specific embodiment of the present invention, H and W are set to 256.
[0018] The above step S2 specifically includes:
[0019] Step 2.1) Considering the excellent performance of convolutional neural networks in recognizing road skeletons and their ability to effectively distinguish between road and non-road areas, this invention uses a visual feature extractor based on convolutional neural networks to extract features from X... f Generate an embedding representation for each trajectory-image piece, denoted as X. s ∈R C×H×W Where C represents the feature dimension, and in one specific embodiment of the present invention, C = 256. Each visual feature extractor contains a 3×3 convolutional layer, a batch normalization layer, and a ReLU activation function.
[0020] Step 2.2) Although many parallel roads are adjacent to each other and have similar directions, their nearest neighbor roads exhibit significant differences in location and direction. Based on this, this invention proposes encoding the differences between the nearest neighbor roads of parallel roads into a grid representation to accurately identify and distinguish parallel roads. This invention first represents the linking relationships between nearest neighbor roads by constructing a grid co-occurrence graph, where each node represents a grid; if two grids are traversed by the same trajectory, an edge is constructed between these two grids.
[0021] Considering the robustness of graph attention networks in learning node topological representations, this invention employs graph attention networks to extract grid topological representations. The execution flow of the graph attention network is as follows: First, a shared linear transformation is applied to each node using formula (1) to enhance its expressive power. Then, a feedforward neural network is used to calculate node g. i With g j The correlation degree (Formula (1)) is then used to obtain the normalized node g through the activation function LeakyReLU and the softmax function. i With g j The attention scores between nodes are calculated (Formula (2)). Finally, the attention scores are used as weights to aggregate the representations of nearest neighbors to obtain the updated node representations.
[0022] e ij =((x) i +pe i )W1+(x j +pe j )W1)W2 (1)
[0023]
[0024] Where, x i ,x j ∈R 1×C For grid g i With g j The corresponding node representation, W1∈R C×C W2∈R C×1 W3∈R C×C As learnable parameters, pe i With PE j Represents the grid g i With g j The sinusoidal positional encoding in the feature matrix X has a dimension that is the same as x. i The same dimension, α ij Represents the grid g i With g j Attention weights between N i Represents the grid g i The set of neighboring nodes.
[0025] This invention encodes the differences between neighboring roads into a grid representation using a three-layer graph attention network to obtain X. t ∈R C ×H×W , with X s After concatenation, the result is fed into a fully connected layer to obtain a new representation of the mesh, denoted as X. st ∈R C×H×W .
[0026] The above step S3 specifically includes:
[0027] Step 3.1) Considering that U-Net is widely used in the field of computer vision for road region identification, this invention uses a deep neural network similar to U-Net to infer the map from the grid representation. The U-Net neural network is an encoder-decoder architecture, where each layer of the encoder and decoder is composed of a convolutional neural network, and its input is the grid representation X corresponding to each trajectory-image piece extracted in step S2. st The output is a road network topology tensor for this trajectory-image patch. The encoder aims to progressively downsample X... st The encoder generates a depth representation of the grid, divided into four layers from top to bottom. Each layer contains two 3×3 convolutional layers and one 2×2 max-pooling layer. Conversely, the decoder aims to progressively upsample the depth representation of the grid to restore it to the original resolution, also divided into four layers from bottom to top. Each layer contains one deconvolutional layer and two 3×3 convolutional layers. For the same layers in both the encoder and decoder, information fusion is performed through skip connections to prevent feature forgetting in the deep neural network. The formulas for the above steps are as follows:
[0028] F i =DS(F i-1 ),F0=X st ,i∈[1,4]
[0029] F i =Us(F i-1 ), i∈[5,8]
[0030] Where F i Let represent the grid representation of the i-th layer, DS represent the downsampling layer, and US represent the upsampling layer.
[0031] Step 3.2) Based on the deep mesh representation F8 corresponding to each trajectory-image piece obtained from U-Net, this invention predicts the road network topology tensor of the piece from F8 using a convolutional neural network. This road network topology tensor contains the following elements: 1) Node probability, representing the probability that each mesh is a map node, with a dimension of 1; 2) Edge probability, representing the probability that each mesh contains an edge with a direction within a certain range, dividing the direction into 6 sectors: 0°~60°, 60°~120°, 120°~180°, 180°~240°, 240°~300°, and 300°~360°, with a dimension of 6; 3) Relative edge position, representing the relative position of the other node of the edge corresponding to each directional sector within the mesh to the current mesh, including x and y axis components, with a dimension of 12. The formula for this step is as follows:
[0032] F out =Conv2(Conv1(F8))
[0033] Conv1 consists of a 3×3 convolutional layer and a ReLU activation function, while Conv2 is a 3×3 convolutional layer. F out ∈R 19×H×W This is the predicted road network topology tensor.
[0034] The above steps realize the inference of the road network topology tensor from a single image patch. Subsequently, this invention splices the road network topology tensors of all trajectory-image patches in the test area to generate the road network topology tensor S corresponding to the test area. Then, a heuristic graph generation algorithm is used to convert the road network topology tensor into a map of the test area. This algorithm includes two steps: 1) Obtaining the grid with the node probability of local maximum through Gaussian filtering and local maximum filtering, as the nodes of the map; 2) Given any two map nodes v i With v j If there exists any edge with a probability greater than 0.5 and the relative position of this edge is with respect to v... j If the distance is less than 10m, then link v i With v j To generate a map.
[0035] Since many parallel roads with similar spatial locations and orientations exist in real-world road networks, this invention designs a grid affinity loss function to enhance the differentiation of parallel roads and combines it with the road network topology tensor prediction loss to jointly optimize the model. The model includes the neural network parameters of the grid representation module in step S2 and the neural network parameters of the road network topology tensor prediction module in step S3.
[0036] The calculation process for mesh affinity loss is as follows:
[0037] In the field of computer vision, the key to distinguishing different categories of pixels lies in increasing the difference in pixel representation vectors. Based on this, this invention proposes a mesh affinity loss function, which aims to increase the distance between mesh representation vectors of parallel roads and reduce the distance between mesh representation vectors of the same road.
[0038] Mesh Affinity Sample Construction: This invention assumes that meshes along parallel roads have low affinity, meaning their mesh representation vector similarity should be 0; conversely, meshes along the same road are considered to have high affinity, meaning their mesh representation vector similarity should be 1. However, the sheer number of mesh pairs makes them difficult to participate in model optimization. This invention designs a hard sample sampling strategy to improve model optimization efficiency. Given a trajectory-image slice, firstly, extract all samples with a spatial distance less than a threshold d. p The parallel road pairs, where the distance between two roads is the minimum distance between their endpoints, considering that the distance between parallel roads is usually around 10 meters, this invention will... p Set to 10 meters; subsequently, randomly sample low-affinity grid pairs (g) from parallel road pairs that satisfy the following conditions. m g n ):1)g m With g n On two parallel roads respectively; 2)g m With g n The distance is less than twice d p Next, for each g m Randomly sample grids g that satisfy the following conditions p To form high-affinity mesh pairs (g m g p ):1)g m With g p On the same road; 2)g m With g p The distance is less than d p Finally, repeat the above sampling steps until the number of high-affinity and low-affinity grid pairs reaches N. a The present invention will N a Set it to 1024.
[0039] Mesh affinity loss calculation: Based on all high-affinity mesh pairs and low-affinity sample pairs extracted in the above steps, from F... out Extract the corresponding grid representation vectors from them, measure the affinity score of the grid representations in the grid pair using cosine similarity, and calculate the minimum mean square error between the affinity scores of all grid pairs and the true value as the affinity loss L of the grid. aff :
[0040]
[0041] in and For high-affinity mesh pairs, and For low-affinity mesh pairs, and For the predicted affinity score, The affinity score label for high-affinity grid pairs is 1. The affinity score label for low affinity grid pairs is 0.
[0042] The calculation process for road network topology tensor prediction loss is as follows:
[0043] Road network topology tensor prediction loss L graph Includes node probability prediction loss, edge probability prediction loss, and edge relative position prediction loss:
[0044]
[0045] Where p v and p represents the predicted node probability and the true node probability for each grid cell. ei and Let rp be the predicted edge probability and the true edge probability of the sector in the i-th direction for each grid. ei and Let L be the predicted and true values of the relative edge positions in the i-th direction sector of each grid. ce is the cross-entropy loss function, and L2 is the L2 loss function.
[0046] Finally, the grid affinity loss and the road network topology tensor prediction loss are added together to obtain the total loss function to optimize the model:
[0047] L final =L aff +L graph
[0048] This invention offers the following advantages: It employs a graph attention network to integrate the differences between neighboring roads of parallel roads into a grid representation, thereby enhancing the recognition ability of roads that are adjacent and have similar directions. Furthermore, this invention designs a grid affinity learning strategy to enhance the differences between parallel roads, further improving the recognition and differentiation capabilities of parallel roads. Finally, this invention uses real ride-hailing trajectory data to experimentally evaluate the map inference method, and the experimental results verify the effectiveness of the proposed method. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating the framework of a map inference method that embeds differences in the behavior of neighboring roads according to the present invention.
[0051] Figure 2 This is a schematic diagram of the map visualization result generated by the existing method DeepMG in an embodiment of the present invention.
[0052] Figure 3 This is a schematic diagram of the map visualization result generated by the method of the present invention in an embodiment of the present invention. Detailed Implementation
[0053] The present invention will be further described in detail below with reference to the specific embodiments and accompanying drawings. Except for the contents specifically mentioned below, the processes, conditions, and experimental methods for implementing the present invention are all common knowledge and general knowledge in the art, and the present invention does not have any particular limitations.
[0054] This invention proposes a map inference method that embeds differences in the behavior of neighboring roads. For example... Figure 1 As shown, this invention first divides the road network to be tested into uniformly sized grids. Based on the trajectory data within each grid, behavioral features of the trajectories in each grid are extracted to obtain the grid feature matrix corresponding to the road network region. The grid feature matrix is then divided into trajectory-image slices of the same size that do not overlap. Subsequently, a combined model of convolutional neural network and graph attention network is used to encode the behavioral differences of neighboring roads of parallel roads into the grid representation. The road network is inferred from the grid representation using a road topology decoder based on U-Net. Finally, in the model optimization process, this invention employs a grid affinity learning strategy based on enhancing the differences between neighboring roads to optimize the grid representation and road topology inference model.
[0055] like Figure 1 As shown, this invention discloses a map inference method embedding differences in the behavior of neighboring roads, comprising the following steps:
[0056] Step S1: Divide the road network area to be tested into uniformly sized grids, extract the behavioral features corresponding to each grid based on the trajectory data within the grid, and obtain the grid feature matrix corresponding to the road network area. Then, extract trajectory-image slices of the same size and non-overlapping from the grid feature matrix.
[0057] In this embodiment, step S1 specifically includes:
[0058] Step 1.1) Divide the road network area to be tested into a grid of uniform size with a grid side length of len. Considering that the minimum width of the lane is about 2m, set len to 2m.
[0059] Step 1.2) Based on the trajectories in the grid obtained in Step 1.1, the present invention extracts the following behavioral features for each grid:
[0060] 1) Frequency of trajectory points (f) pf ), representing the number of trajectory points within the grid; 2) turning frequency (f tf ), representing the number of turning points within the grid. A turning point is defined as follows: if the angle difference between the direction of the current trajectory point and the direction of the previous trajectory point is greater than 35 degrees, then the trajectory point is determined to be a turning point; 3) Trajectory segment frequency (f sf ), representing the number of trajectory segments within the grid; a line segment connecting two consecutive trajectory points constitutes one trajectory segment; 4) Point average velocity (f) ps ), representing the average velocity of the trajectory points within the grid. The velocity of the current trajectory point is calculated as the ratio of the distance difference to the time difference between it and the previous trajectory point; 5) Point direction distribution Representing the directional distribution of trajectory points within the grid: Map the orientation of each trajectory point to eight standardized, equal-sized directional histograms (0°~45°, 45°~90°, 90°~135°, 135°~180°, 180°~225°, 225°~270°, 270°~315°, 315°~360°) to obtain the eight-directional distribution corresponding to the grid; 6) Linear average velocity (f ss ), representing the average velocity of the trajectory line segment within the grid; 7) Line direction distribution This indicates the directional distribution of trajectory line segments within the grid.
[0061] By combining the above seven types of features, the 21-dimensional behavioral feature vector of each grid can be represented as follows: The final result is the grid feature matrix corresponding to the entire road network area, denoted as G.
[0062] Since the road network area to be tested is usually large, it is impractical to perform map inference tasks directly over the entire road network area. Therefore, the grid feature matrix is divided into multiple non-overlapping sub-matrices of the same size, and each sub-matrix is represented as a trajectory image piece. Thus, each trajectory image piece corresponds to a visual image containing H×E grids, denoted as X. f ∈R 21×H×W .
[0063] Step S2: Use a combined model of convolutional neural network and graph attention network to incorporate the behavioral differences of neighboring roads of parallel roads into the grid representation.
[0064] In this embodiment, step S2 specifically includes:
[0065] Step 2.1) Considering the excellent performance of convolutional neural networks in recognizing road skeletons and their ability to effectively distinguish between road and non-road areas, this invention uses a visual feature extractor based on convolutional neural networks to extract features from X... f Generate an embedding representation for each image slice, denoted as X. s ∈R C×H×W Where C represents the feature dimension, and in one specific embodiment of the present invention, C = 256. Each visual feature extractor contains a 3×3 convolutional layer, a batch normalization layer, and a ReLU activation function.
[0066] Step 2.2) Although many parallel roads are adjacent to each other and have similar directions, their nearest neighbor roads exhibit significant differences in location and direction. Based on this, this invention proposes encoding the differences between the nearest neighbor roads of parallel roads into a grid representation to accurately identify and distinguish parallel roads. This invention first represents the linking relationships between nearest neighbor roads by constructing a grid co-occurrence graph, where each node represents a grid; if two grids are traversed by the same trajectory, an edge is constructed between these two grids.
[0067] Considering the robustness of graph attention networks in learning node topological representations, this invention employs graph attention networks to extract grid topological representations. The execution flow of the graph attention network is as follows: First, a shared linear transformation is applied to each node using formula (1) to enhance its expressive power. Then, a feedforward neural network is used to calculate node g. i With g j The correlation degree was then determined, and the normalized node g was obtained by applying the activation function LeakyReLU and the softmax function. i With g j The attention scores between nodes are calculated (Formula (2)). Finally, the attention scores are used as weights to aggregate the representations of nearest neighbors to obtain the updated node representations.
[0068] e ij =((x) i +pe i )W1+(x j +pe j )W1)W2 (1)
[0069]
[0070] Where x i ,x j ∈R 1×C For grid g i With g j The corresponding node representation, W1∈R C×C,W2∈R C×1 W3∈R C×C As learnable parameters, pe i With PE j Represents the grid g i With g j Sine positional encoding in feature matrix X, α ij Represents the grid g i With g j Attention weights between N i Represents the grid g i The set of neighboring nodes.
[0071] This invention encodes the differences between neighboring roads into a grid representation using a three-layer graph attention network to obtain X. t ∈R C ×H×W , with X s After concatenation, the result is fed into a fully connected layer to obtain a new representation of the mesh, denoted as X. st ∈R C×H×W .
[0072] Step S3: Infer the road topology tensor from the grid representation obtained in step S2 using a U-Net-based road topology decoder, and convert the road topology tensor into a map using a heuristic graph generation method.
[0073] In this embodiment, step S3 specifically includes:
[0074] Step 3.1) Considering that U-Net is widely used in computer vision for road region identification, this invention employs a deep neural network similar to U-Net to infer maps from grid representations. This neural network follows an encoder-decoder architecture, with its input being the grid representation X corresponding to each trajectory-image piece extracted in step S2. st The output is a road network topology tensor for this trajectory-image patch. The encoder aims to progressively downsample X... st The encoder generates a depth representation of the grid, divided into four layers from top to bottom. Each layer contains two 3×3 convolutional layers and one 2×2 max-pooling layer. Conversely, the decoder aims to progressively upsample the depth representation of the grid to restore it to the original resolution, and is divided into four layers from bottom to top. Each layer contains one deconvolutional layer and two 3×3 convolutional layers. For the same layers in both the encoder and decoder, information fusion is performed through skip connections to prevent feature forgetting in the deep neural network. The formulas for the above steps are as follows:
[0075] F i =DS(F i-1 ),F0=X st ,i∈[1,4]
[0076] F i =US(F i-1 ), i∈[5,8]
[0077] Where F i Let represent the grid representation of the i-th layer, DS represent the downsampling layer, and US represent the upsampling layer.
[0078] Step 3.2) Based on the deep mesh representation F8 corresponding to each trajectory-image piece obtained from U-Net, this invention predicts the road network topology tensor of the piece using a convolutional neural network. This road network topology tensor contains the following elements: 1) Node probability, representing the probability that each mesh is a map node, with a dimension of 1; 2) Edge probability, representing the probability that each mesh contains an edge with a direction within a certain range, dividing the direction into 6 sectors: 0°~60°, 60°~120°, 120°~180°, 180°~240°, 240°~300°, and 300°~360°, with a dimension of 6; 3) Relative edge position, representing the relative position of the other node of the edge corresponding to each directional sector within the mesh to the current mesh, including x and y axis components, with a dimension of 12. The formula for this step is as follows:
[0079] F out =Conv2(Conv1(F8))
[0080] Conv1 consists of a 3×3 convolutional layer and a ReLU activation function, while Conv2 is a 3×3 convolutional layer. F out ∈R 19×H×W This is the predicted road network topology tensor.
[0081] The above steps realize the inference of the road network topology tensor from a single image patch. Subsequently, the present invention splices the road network topology tensors of all image patches in the test area to generate the road network topology tensor S corresponding to the test area, and converts the road network topology tensor into a map of the test area through a heuristic graph generation algorithm. This algorithm includes two steps: 1) Obtaining the grid with the node probability of local maximum through Gaussian filtering and local maximum filtering, as the nodes of the map; 2) Given any two map nodes v i With v j If there exists any edge with a probability greater than 0.5 and the relative position of this edge is with respect to v... j If the distance is less than 10m, then link v i With v j To generate a map.
[0082] To better achieve map inference of differences in the behavior of neighboring roads, in a specific embodiment of the present invention, the grid representation and road topology tensor inference model are optimized by a grid affinity learning strategy based on enhanced differences in neighboring roads.
[0083] Specifically, it includes:
[0084] In real-world road networks, many adjacent roads are parallel to each other, sharing similar spatial locations and orientations. To further improve the identification accuracy of these parallel roads, this invention designs a grid affinity loss function that enhances the differences between parallel roads and combines it with the road network topology tensor prediction loss to jointly optimize the model. The model includes the neural network parameters of the grid representation module in step S2 and the neural network parameters of the road network topology tensor prediction module in step S3.
[0085] The calculation process for mesh affinity loss is as follows:
[0086] In the field of computer vision, the key to distinguishing different categories of pixels lies in increasing the difference in pixel representation vectors. Based on this, this invention proposes a mesh affinity loss function, aiming to increase the distance between mesh representation vectors of parallel roads and decrease the distance between mesh representation vectors of the same road:
[0087] Mesh Affinity Sample Construction: This invention assumes that meshes along parallel roads have low affinity, meaning their mesh representation vector similarity should be 0; conversely, meshes along the same road are considered to have high affinity, meaning their mesh representation vector similarity should be 1. However, the sheer number of mesh pairs makes them difficult to participate in model optimization. This invention designs a hard sample sampling strategy to improve model optimization efficiency. Given a trajectory-image slice, firstly, extract all samples with a spatial distance less than a threshold d. p The parallel road pairs, where the distance between two roads is the minimum distance between their endpoints, considering that the distance between parallel roads is usually around 10 meters, this invention will... p Set to 10 meters; subsequently, randomly sample low-affinity grid pairs (g) from parallel road pairs that satisfy the following conditions. m g n ):1)g m With g n On two parallel roads respectively; 2)g m With g n The distance is less than twice d p Next, for each g m Randomly sample grids g that satisfy the following conditions p To form high-affinity mesh pairs (g m g p ):1)g m With g p On the same road; 2)g m With g p The distance is less than d pFinally, repeat the above sampling steps until the number of high-affinity and low-affinity grid pairs reaches N. a The present invention will N a Set it to 1024.
[0088] Mesh affinity loss calculation: Based on all high-affinity mesh pairs and low-affinity sample pairs extracted in the above steps, from F... out Extract the corresponding grid representation vectors from them, measure the affinity score of the grid representations in the grid pair using cosine similarity, and calculate the minimum mean square error between the affinity scores of all grid pairs and the true value as the affinity loss L of the grid. af f:
[0089]
[0090]
[0091] in and For high-affinity mesh pairs, and For low-affinity mesh pairs, and For the predicted affinity score, The affinity score label for high-affinity grid pairs is 1. The affinity score label for low affinity grid pairs is 0.
[0092] The calculation process for road network topology tensor prediction loss is as follows:
[0093] Road network topology tensor prediction loss L graph Includes node probability prediction loss, edge probability prediction loss, and edge relative position prediction loss:
[0094]
[0095] Where p v and p represents the predicted node probability and the true node probability for each grid cell. ei and Let rp be the predicted edge probability and the true edge probability of the sector in the i-th direction for each grid. ei and Let L be the predicted and true values of the relative edge positions in the i-th direction sector of each grid. ce is the cross-entropy loss function, and L2 is the L2 loss function.
[0096] Finally, the grid affinity loss and the road network topology tensor prediction loss are added together to obtain the total loss function to optimize the model:
[0097] L final =L aff +L graph
[0098] Example
[0099] To verify the effectiveness of this invention, real trajectory data was selected for map inference, and a comparative evaluation was conducted based on publicly available maps and existing map inference methods. The selected methods included Cao, Biagioni, Kharita, RoadRunner, Huang, Sami, Deepmg, and Ringnet. Experiments were performed on three datasets: Beijing 23, Wuxi 20, and Shenzhen 13. Specifically, Beijing 23 is a 7-day ride-hailing trajectory dataset from the vicinity of Lianhua Pond in Beijing in 2023, with an average sampling interval of approximately 10 seconds, a region size of 20km*22km, and approximately 36.8M trajectory points; Wuxi 20 is a 14-day taxi trajectory dataset from Wuxi City in 2020, with an average sampling interval of approximately 3 seconds, a region size of 27km*31km, and approximately 3.6M trajectory points; and Shenzhen 13 is a 1-day ride-hailing trajectory dataset from Shenzhen City in 2013, with an average sampling interval of approximately 16 seconds, a region size of 24km*35km, and approximately 20.7M trajectory points. In the experimental setup, the ratio of training set, validation set, and test set was 7:2:1. The AdamW optimizer was used to train the model, and the weight decay parameter was set to 0.01. The training learning rate was initialized to 2e-4, and the learning rate was halved every 10 training epochs.
[0100] like Figure 2 The image shown is a map inference result generated by the existing method DeepMG, such as... Figure 3 The image shown is a map visualization of the same area generated using the method proposed in this invention. Experiments demonstrate that this invention can accurately identify parallel roads marked by red elliptical dashed boxes. The accuracy of the inferred map is evaluated using a graph sampling evaluation method and a path similarity-based evaluation method. The graph sampling evaluation method samples key points from both the inferred map and the real map, performing a one-to-one match between the key points. If the distance between key points is within a certain distance threshold d, the match is considered successful. The evaluation metrics selected are Precision, Recall, and F1-score, where the real location is obtained from OSM road network data. truth L represents the number of key points sampled from the real road network. detect L represents the number of keypoints sampled from the inferred map. corr This represents the number of successfully matched keypoints. A higher F1-score indicates better performance. Precision, recall, and F1-score are defined as follows:
[0101]
[0102] The path similarity-based evaluation method first randomly selects several pairs of origin-endpoint pairs and projects them into the inferred road network and the ground truth road network. For each pair of origin-endpoint pairs, the shortest path is calculated. The final evaluation result is obtained by subtracting the average distance of all shortest path pairs from 1. Higher similarity indicates a more accurate inferred road network. Given path a and path b, their distance is... length() represents the length of the path.
[0103] The comparative evaluation results of map inference are shown in Table 1. Compared with existing map inference methods, the road network generated by the present invention has significantly improved Precision, Recall and F1-score at different matching distances, demonstrating the effectiveness of the present invention.
[0104] Table 1 Comparison of Map Inference Results
[0105]
[0106] In summary, this invention comprehensively employs technologies such as convolutional neural networks, graph attention networks, and grid affinity learning to form a map inference method based on the perception of differences between neighboring roads. Through trajectory data mining, it can accurately infer digital maps, thereby providing effective assistance for navigation broadcasting and route planning.
[0107] The scope of protection of this invention is not limited to the above embodiments. Any variations and advantages that can be conceived by those skilled in the art without departing from the spirit and scope of this invention are included in this invention and are protected by the appended claims.
Claims
1. A map inference method embedding differences in the behavior of neighboring roads, characterized in that, The method includes: Step S1. Divide the road network area to be tested into grids, extract the behavioral features of each grid to generate a grid feature matrix, and extract trajectory-image slices from the grid feature matrix; Step S2. Use a combined model including convolutional neural networks and graph attention networks to represent the behavioral differences of neighboring roads of parallel roads into a grid representation; Step S3. Infer the road topology tensor from the grid representation using a road topology decoder and convert it into a map; The grid representation and road topology tensor inference model is optimized by a grid affinity learning strategy based on enhanced differences in neighboring roads: a grid affinity loss function for enhanced differences in parallel roads is designed and combined with the road network topology tensor prediction loss to jointly optimize the inference model; the inference model includes a grid representation module and a road network topology tensor prediction module. The mesh affinity loss function is expressed as follows: in, and For high-affinity mesh pairs, and For low-affinity mesh pairs, and For the predicted affinity score, The affinity score label for high-affinity grid pairs is 1. The affinity score label for low affinity grid pairs is 0. N a This indicates the number of grid pairs with high affinity and low affinity. The road network topology tensor prediction loss is expressed as follows: Where, p v and p represents the predicted node probability and the true node probability for each grid cell. ei and Let rp be the predicted edge probability and the true edge probability of the sector in the i-th direction for each grid. ei and Let L be the predicted and true values of the relative edge positions in the i-th direction sector of each grid. ce L1 is the cross-entropy loss function, and L2 is the L2 loss function; The total loss function is expressed as: L final =L aff +L graph .
2. The method as described in claim 1, characterized in that, In step S1, the obtained grids are of uniform size, and the behavioral features are extracted based on trajectory data within the grids; the trajectory-image slices are of the same size and do not overlap. The behavioral features include: trajectory point frequency, turning frequency, trajectory line segment frequency, point average velocity, point direction distribution, line average velocity, and line direction distribution; these seven types of behavioral features are combined and represented as a grid feature matrix.
3. The method as described in claim 2, characterized in that, The frequency of the trajectory points represents the number of trajectory points within the grid; The turning frequency represents the number of turning points within the grid; the turning point refers to a trajectory point whose directional angle difference from the previous trajectory point is greater than 35 degrees. The frequency of the trajectory segment represents the number of trajectory segments within the grid that are formed by connecting two consecutive trajectory points; The average velocity of a point represents the average velocity of a trajectory point within the grid; the average velocity of a trajectory point is calculated by the ratio of the distance difference between the current trajectory point and the previous trajectory point to the time difference. The point orientation distribution represents the orientation distribution of trajectory points within the grid, which is mapped to the orientation histogram; The line average velocity represents the average velocity of the trajectory line segments within the grid. The line direction distribution refers to the directional distribution of trajectory line segments within the grid.
4. The method as described in claim 1, characterized in that, In step S2, an embedding representation of each trajectory-image slice is generated by a visual feature extractor based on the convolutional neural network; By constructing a grid collinearity graph to represent the link relationship between neighboring roads, a graph attention network is used to extract the grid topology representation, and the differences between the neighboring roads of parallel roads are encoded into the grid representation. By stitching together the trajectory, embedding representation of image pieces, and identifying differences in neighboring roads, the final grid representation is obtained.
5. The method as described in claim 4, characterized in that, Each of the visual feature extractors comprises a convolutional layer, a batch normalization layer, and a ReLU activation function; And / or, In the graph attention network, each node in the collinear graph represents a grid. Apply the following shared linear transformation to each node and compute node g. i With g j Relevance: it is ij =((x i +on i )W1+(x j +on j )W1)W2, The normalized node g is obtained by using the activation functions LeakyReLU and Softmax. i With g j The attention scores between them are shown in the following formula: The attention scores are used as weights to aggregate the representations of nearest neighbors to obtain the updated node representations: Where, x i ,x j ∈R 1×C For grid g i With g j The corresponding node representation, W1∈R C×C W2∈R C×1 W3∈R C×C As learnable parameters, pe i With PE j Represents the grid g i With g j Sine positional encoding in feature matrix X, α ij Represents the grid g i With g j Attention weights between N i Represents the grid g i The set of neighboring nodes, where C represents the feature dimension.
6. The method as described in claim 1, characterized in that, In step S3, the corresponding road network topology tensor is represented by the neural network output grid of the encoder-decoder architecture; The road network topology tensor includes node probability, edge probability, and relative edge position; The road network topology tensor of the test area is generated by assembling the road network topology tensors of each trajectory-image patch in the test area, and then converted into a map of the test area through a heuristic graph generation algorithm.
7. The method as described in claim 6, characterized in that, The heuristic graph generation algorithm includes: Grids with local maxima probabilities are obtained using Gaussian filtering and local maximum filtering, and these are used as map nodes; given any two map nodes v i With v j If there exists any edge with a probability greater than 0.5 and the relative position of this edge is with respect to v... j If the distance is less than 10m, then link v i With v j To generate a map.