Identification model training method, identification method, electronic device, and storage medium
By improving the Douglas-Puk algorithm and probabilistic neural network model, and combining multi-scale feature parameters, the problem of poor grid pattern recognition accuracy in traditional methods was solved, and higher accuracy urban road grid pattern recognition was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional methods cannot simultaneously take into account the three scale features of the mesh itself, internal structure, and contextual environment in urban road network grid pattern recognition, resulting in poor recognition accuracy.
An improved Douglas-Puk algorithm is used to simplify the road network, calculate the orthogonality index of the mesh, and use a probabilistic neural network model combined with multi-scale feature parameters for grid pattern recognition.
It improves the accuracy and reliability of grid pattern recognition, overcomes the limitations of rule-based reasoning and statistical analysis, and achieves consistency with human judgment results.
Smart Images

Figure CN116524531B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of geographic information technology, and in particular relates to a training method, recognition method, electronic device and storage medium for a grid pattern recognition model of urban road network. Background Technology
[0002] Road networks are a core element of basic geographic information, serving as the skeletal structure connecting various functional areas within a city. Through long-term evolution, urban road networks have developed specific spatial structure patterns. Automatic identification of road network spatial structure patterns has been a popular research area in fields such as automatic map generalization, geographic visualization, and urban structure analysis. Among these, grid patterns are a typical and ubiquitous explicit pattern in road networks, containing a wealth of information about urban spatial patterns. Identifying and extracting road network grid patterns helps in understanding urban morphology, analyzing urban spatial phenomena, and predicting future urban development.
[0003] Standard grids are shaped like rectangles or concave hexagons with adjacent sides perpendicular to each other. Due to the influence of urban planning, grid distribution often shows a clustering trend. In actual analysis, some irregular grid patterns that have degenerated are also the focus of attention. Identifying such irregular grid patterns is a difficult point in grid pattern recognition.
[0004] Currently, road network pattern recognition methods are mainly divided into line-based recognition methods and surface-based recognition methods.
[0005] Line-based identification methods fully consider the geometry and topology of road segments, aiming to select mutually perpendicular and adjacent roads from the road network. These methods identify the grid solely by calculating the linear characteristics of road segments, potentially neglecting the overall morphology of the mesh and the structural features of the surrounding environment. However, according to Gestalt principles, in the process of recognizing road network grid patterns, people pay more attention to the morphology and distribution of the mesh, and influenced by urban planning, the distribution of urban road grid patterns often exhibits a clustering trend. Therefore, the contextual environment is a crucial factor in identifying urban road network grid patterns.
[0006] While surface-based recognition methods fully consider the morphological features and contextual environment of the mesh, they lack descriptions of the detailed shapes within the mesh, resulting in room for improvement in the accuracy and reliability of mesh pattern recognition. In the process of mesh pattern recognition, three scales of features should be fully considered: the mesh's own shape, internal structure, and contextual environment. Traditional methods cannot simultaneously address these three scales, thus hindering accuracy improvement. Therefore, utilizing features at all three scales simultaneously for mesh pattern recognition has significant innovative value.
[0007] Definitions:
[0008] A grid pattern refers to the shape or arrangement of a spatial element set that can be clearly named and identified in its spatial distribution. Summary of the Invention
[0009] The purpose of this invention is to provide a road network grid pattern recognition model training method, recognition method, electronic device and storage medium to solve the problem that traditional methods cannot simultaneously take into account the three scale features of the grid itself, internal structure and context environment, resulting in poor grid pattern recognition accuracy.
[0010] This invention solves the above-mentioned technical problems through the following technical solution: a road network grid pattern recognition model training method, the training method comprising the following steps:
[0011] Select road networks from urban road network data, and label each mesh sample in the road network with either grid or non-grid labels;
[0012] The roads in the road network are simplified to obtain a simplified road network.
[0013] Calculate the orthogonality index of each mesh sample in the simplified road network;
[0014] Based on the orthogonality index of the mesh samples, the feature parameters of each mesh sample for grid pattern recognition are defined and calculated to obtain the feature vector of each mesh sample;
[0015] A pattern recognition model is constructed, with the feature vector of each mesh sample as the input vector and the corresponding label as the output vector, and the pattern recognition model is trained.
[0016] Furthermore, the improved Douglas-Puk algorithm is used to simplify the roads in the road network. The specific implementation process is as follows:
[0017] Step 1.1: Construct a seed sequence for each road in the road network between two adjacent nodes with a connectivity greater than 3. Among them, P ij Let n be the j-th node on the i-th road. i Let be the number of nodes on the i-th road; the i-th road refers to the road between two adjacent nodes with a connectivity greater than 3.
[0018] Step 1.2: Calculate the straightness ST of the road. If ST ≥ T, then the road retains only the first and last nodes, and the seed sequence of the road is updated. If ST < T, then proceed to step 1.3; where T is the simplification threshold.
[0019] Step 1.3: In the seed sequence Seed i Find the line in the middle The node P with the largest distance io , with node P io Seed sequence as segmentation point i Divided into subsequences Seed i1 ={P i1 ,P i2 ,…,P io} and subsequences Update Seed i ={Seed i1 Seed i2};
[0020] Step 1.4: Process the seed sequence Seed i Repeat steps 1.2 to 1.3 for each subsequence corresponding to the road until each subsequence contains only the first and last nodes, and extract the seed sequence. i The included nodes form the simplified road;
[0021] Step 1.5: Repeat steps 1.2 to 1.4 for each road until the simplification of all roads in the road network is completed.
[0022] Preferably, the formula for calculating the straightness ST of the road is:
[0023] ST = L / S
[0024] Where L is the total length of the road, and S is the straight-line distance between the beginning and end of the road.
[0025] Preferably, the simplification threshold T is 0.956.
[0026] Furthermore, the specific calculation process for the orthogonality index of the mesh samples is as follows:
[0027] Step 2.1: Map each interior angle of the mesh sample to the range of 0 to 1 using a normalization function. The specific expression of the normalization function is as follows:
[0028]
[0029] Where, α k ' is the mapping value of the k-th interior angle, α k Let Φ be the k-th interior angle before mapping, and θ be the normalization function f(α). k ) parameters;
[0030] Step 2.2: Based on the changes in the side length of the mesh samples before and after simplification, assign each mapping value α... k Set a penalty factor;
[0031] Step 2.3: Based on the penalty factor and normalization function f(α) k Calculate the orthogonality index of the mesh samples, using the following formula:
[0032]
[0033] Where OI is the orthogonality index of mesh samples, w k For the mapping value α k The corresponding penalty factor, m1, is an interior angle α less than 135°. k The quantity, m2 is the interior angle α greater than or equal to 135°. k The sum() function sums the two parts within the curly braces.
[0034] Furthermore, the normalization function f(α) k The specific method for determining the parameters Φ and θ is as follows:
[0035] Set the mapping values of the first interior angle and the second interior angle of the mesh sample, wherein the first interior angle and the second interior angle are any two different interior angles of the mesh sample;
[0036] Substituting the first interior angle and its mapping value, and the second interior angle and its mapping value into the normalization function respectively, we obtain a system of nonlinear equations.
[0037] Solve the nonlinear equations to obtain the values of parameters Φ and θ.
[0038] Furthermore, the specific calculation expression for the penalty factor is as follows:
[0039]
[0040] Among them, w k For the mapping value α k 'Corresponding penalty factor, L' k1 L' k2 These are the simplified i-th interior angles α and β. k The lengths of the two sides, L k1 L k2 These are the k-th interior angles α before the last simplification. k The lengths of the two sides.
[0041] Furthermore, the feature parameters of each mesh sample include compactness, orthogonality strength, edge count condition, average orthogonality strength of first-order neighbors, and maximum orthogonality strength of first-order neighbor fusion;
[0042] The specific formula for calculating the compactness is as follows:
[0043]
[0044] Among them, C i Let A be the compactness of the i-th mesh sample. origini Let A be the area of the i-th mesh sample before simplification. Ci The minimum circumcircle area of the i-th mesh sample before simplification;
[0045] The specific formula for calculating the orthogonal intensity is as follows:
[0046]
[0047] Among them, OS i Let OI be the orthogonal intensity of the i-th mesh sample. i Let A be the orthogonal index of the i-th mesh sample. finali Let be the simplified area of the i-th mesh sample;
[0048] The specific formula for calculating the number of sides is as follows:
[0049]
[0050] Among them, SC i The edge number condition for the i-th mesh sample is edge i This represents the number of edges contained in the simplified i-th mesh sample;
[0051] The specific formula for calculating the average orthogonality strength of the first-order neighbor is as follows:
[0052]
[0053] Among them, 1stOSmean i OS is the average orthogonal intensity of the first-order neighbors of the i-th mesh sample. ir R represents the orthogonality intensity of the r-th first-order neighbor mesh of the i-th mesh sample, and R represents the number of first-order neighbor meshes of the i-th mesh sample. The first-order neighbor meshes of a mesh refer to all meshes that share a common edge or a common node with the mesh.
[0054] The specific formula for calculating the maximum orthogonality strength of the first-order neighbor fusion is as follows:
[0055] 1stmerge OS max i =max(mergeOS) i1 mergeOS i2 ,…,mergeOS ir ,…,mergeOS iR )
[0056] Among them, 1stmerge OS max iFor the first-order neighbor fusion of the i-th mesh sample, mergeOS is the maximum orthogonal intensity. ir Let be the orthogonal intensity of the i-th mesh sample after it is fused with its r-th first-order neighbor mesh.
[0057] Furthermore, the pattern recognition model employs a probabilistic neural network, which includes an input layer, a hidden layer, a summation layer, and an output layer connected in sequence.
[0058] The number of neurons in the input layer is equal to the length of the input vector; the number of neurons in the hidden layer is equal to the number of input training samples; the number of neurons in the summation layer is equal to the number of categories of the mesh samples; and the number of neurons in the output layer is equal to the number of neurons in the summation layer.
[0059] Based on the same inventive concept, the present invention also provides a method for road network grid pattern recognition, the recognition method comprising:
[0060] Obtain the road network to be identified;
[0061] The roads in the road network to be identified are simplified to obtain the simplified road network to be identified.
[0062] Calculate the orthogonality index of each mesh in the simplified road network to be identified;
[0063] Based on the orthogonality index of the mesh, the feature parameters of each mesh for mesh pattern recognition are defined and calculated to obtain the feature vector of each mesh.
[0064] The pattern recognition model was trained according to the road network grid pattern recognition model training method described above.
[0065] The pattern recognition model is used to perform pattern recognition on each of the meshes.
[0066] Based on the same inventive concept, the present invention also provides an electronic device, which includes:
[0067] At least one processor; and,
[0068] A memory communicatively connected to the at least one processor; wherein,
[0069] The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor performs the steps in the road network grid pattern recognition model training method as described above, or performs the steps in the road network grid pattern recognition method as described above.
[0070] Based on the same inventive concept, the present invention also provides a non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, cause the at least one processor to perform the steps in the road network grid pattern recognition model training method as described above, or to perform the steps in the road network grid pattern recognition method as described above.
[0071] Beneficial effects
[0072] Compared with the prior art, the advantages of the present invention are as follows:
[0073] This invention provides a road network grid pattern recognition model training method, recognition method, electronic device, and storage medium. This method utilizes multi-scale features such as the grid's own morphology, internal structure, and contextual environment to recognize urban road network grid patterns. It simplifies the grid by improving the Douglas-Puk algorithm and constructs basic morphological metrics (i.e., orthogonality metrics) based on the relationship between the internal structures of the grid before and after simplification. This addresses the sensitivity issues based on local line and surface features to some extent. Simultaneously, it considers the overall morphology of the grid and the contextual environment to define five grid feature parameters. It uses a PNN (Probabilistic Neural Network) model with excellent classification capabilities for grid pattern recognition, overcoming the limitations of previous recognition methods based on rule-based reasoning and statistical analysis, which struggle to achieve consistency with human judgment results. Attached Figure Description
[0074] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a flowchart of the recognition model training method in an embodiment of the present invention;
[0076] Figure 2 This is an example diagram of road simplification using the improved Douglas-Puk algorithm in an embodiment of the present invention;
[0077] Figure 3 This is an example diagram of penalty factor calculation in an embodiment of the present invention;
[0078] Figure 4 This is an example diagram of compactness feature calculation in an embodiment of the present invention;
[0079] Figure 5 This is an example diagram of the first-order neighbor mesh of the mesh in an embodiment of the present invention;
[0080] Figure 6This is an example diagram of the fusion of the target mesh and the first-order neighbor mesh in an embodiment of the present invention;
[0081] Figure 7 This is an example diagram of the PNN model structure in an embodiment of the present invention;
[0082] Figure 8 This is an example diagram of ten-fold cross-validation in an embodiment of the present invention;
[0083] Figure 9 This is a schematic diagram of the training sample input to the model input layer in an embodiment of the present invention;
[0084] Figure 10 This is a schematic diagram illustrating the connection relationship between the hidden layer and the summation layer in an embodiment of the present invention;
[0085] Figure 11 This is a schematic diagram illustrating the connection relationship between the model output layer and the summation layer in an embodiment of the present invention. Detailed Implementation
[0086] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0087] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0088] like Figure 1 As shown in this embodiment, a road network grid pattern recognition model training method is provided, the training method including the following steps:
[0089] Step 1: Selection and labeling of sample data.
[0090] Select road networks from urban road network data, and label each mesh sample in the road network with either grid or non-grid labels.
[0091] In practice, a new "type" field is created for each mesh sample. The "type" attribute of grid samples is manually labeled as 1, and the "type" attribute of non-grid samples is manually labeled as 2. Each mesh sample refers to a mesh selected from the road network that is labeled as either grid or non-grid. The sample dataset consists of all mesh samples selected from the road network.
[0092] Step 2: Simplify the roads in the road network to obtain the simplified road network.
[0093] In road network data, a complete road can be regarded as a multi-node line segment. When multiple such roads form a mesh, the different undulations of the roads are not conducive to directly calculating the directional distribution between roads. Therefore, the improved Douglas-Puk algorithm is used to process roads with different degrees of undulation. For example, when the road undulation is very small, the algorithm simplifies it into a straight line segment. When the road undulation is large, the algorithm divides it into multiple segments.
[0094] In the specific implementation, the dimensional threshold in the traditional Douglas-Puk algorithm is improved to a dimensionless threshold to adapt to roads of different lengths; then the simplification object is selected as the road between two adjacent nodes with a connectivity greater than 3, so as to maintain the adjacency and topological relationship between the meshes before and after simplification.
[0095] The road network is simplified using an improved Douglas-Puk algorithm. The specific implementation process is as follows:
[0096] Step 1.1: Construct a seed sequence for each road in the road network between any two adjacent nodes with a connectivity greater than 3. Among them, P ij Let n be the j-th node on the i-th road. i Let be the number of nodes on the i-th road; the i-th road refers to the road between two adjacent nodes with a connectivity greater than 3.
[0097] In the specific implementation process, a set road_save is constructed to store all roads between any two adjacent nodes in the road network with a connectivity greater than 3. The set road_save is traversed to complete the construction of the seed sequence for each road.
[0098] In a road network, the connectivity of a node represents the number of roads directly connected to it. Roads are stored in an attribute table as line features, each line feature including n. i A target road can be viewed as a new line feature composed of one or more line features. The `shaperead` function in MATLAB can be used to read the projected coordinates of the point features contained within each line feature in the attribute table. Therefore, once the target road is found, the projected coordinates of the point features contained within it can be determined. A node on the target road refers to the set of all point features that constitute the line feature corresponding to the target road.
[0099] like Figure 2 As shown, the black solid line represents the target road, and P1 to P7 are the point features contained in the target road. Therefore, the initial Seed is set to {P1, P2, P3, P4, P5, P6, P7}, n i =7.
[0100] Step 1.2: Calculate the straightness ST of the road. If ST ≥ T, then the road retains only the first and last nodes, and the seed sequence of the road is updated. If ST < T, then proceed to step 1.3; where T is the simplification threshold.
[0101] In this embodiment, the formula for calculating the straightness ST of the road is:
[0102] ST = L / S (1)
[0103] Where L is the total length of the road, and S is the straight-line distance between the beginning and end points of the road. When ST ≥ T, it indicates that the road has a significant degree of undulation and needs simplification. For example... Figure 2 As shown in (a), the seed sequence Seed={P1,P7} for updating the road is simplified to P1P7.
[0104] The simplification threshold T needs to meet two conditions: 1. Ensure that the main shape of the simplified road is preserved; 2. Ensure that the simplification result has a certain degree of resistance to road undulations. In this embodiment, the simplification threshold T is determined to be 0.956 based on experience and experiments.
[0105] Step 1.3: In the seed sequence Seed i Find the line in the middle The node P with the largest distance io , with node P io Seed sequence as segmentation point i Divided into subsequences Seed i1 ={P i1 ,P i2 ,…,P io} and subsequences Update Seed i ={Seed i1 Seed i2}
[0106] like Figure 2 As shown in (b), if ST < T, then find the point P4 in Seed that has the largest distance from P1P7. Divide Seed into two parts using P4 as the segmentation point: Seed1 = {P1, P2, P3, P4} and Seed2 = {P4, P5, P6, P7}. Update Seed = {Seed1, Seed2}. The distance from point P4 to line P1P7 refers to the perpendicular distance, that is, the vertical distance from point P4 to line P1P7.
[0107] Step 1.4: Process the seed sequence Seed iRepeat steps 1.2 to 1.3 for each subsequence corresponding to the road until each subsequence contains only the first and last nodes, and extract the seed sequence. i The included nodes form the simplified road.
[0108] For Seed1 = {P1, P2, P3, P4} and Seed2 = {P4, P5, P6, P7}, repeat steps 1.2 to 1.3, as follows: Figure 2 As shown in (b), the road represented by the black solid line is simplified by removing points P2 and P3, resulting in the simplified road {P1, P4, P5, P6, P7}.
[0109] Step 1.5: Traverse all roads in the set road_save, repeating steps 1.2 to 1.4 until the simplification of all roads in the road network is completed.
[0110] Step 3: Calculate the orthogonality index of each mesh sample in the simplified road network.
[0111] Basic Mesh Morphology Measurement Index – Orthogonality Index: A normalized function is designed to quantitatively describe the directional distribution between roads within the simplified mesh. Combining this with the changes in road lengths before and after simplification, the basic mesh morphology measurement index – the orthogonality index – is constructed. The smallest closed surface region in the road network is the mesh. In practical implementation, the specific calculation process for the orthogonality index of each mesh sample or mesh is as follows:
[0112] Step 2.1: Use a normalization function to map each interior angle of the mesh sample to the range of 0 to 1. The specific expression of the normalization function is:
[0113]
[0114] Where, α k ' is the mapping value of the k-th interior angle, α k Let Φ be the k-th interior angle before mapping, and θ be the normalization function f(α). k The parameters of compactness are as follows. Since the compactness range is 0 to 1, in order to make the distribution range of the five feature parameters of the subsequent mesh consistent, we choose to map each interior angle to the range of 0 to 1.
[0115] The parameters Φ and θ determine the gradient change. By setting mapping values, a specific angle mapping value is artificially obtained. Then, a system of nonlinear equations is constructed using the interior angles and their corresponding mapping values. The values of parameters Φ and θ are obtained by solving the system of nonlinear equations. In this embodiment, the normalization function f(α) k The specific method for determining the parameters Φ and θ is as follows:
[0116] Step 2.11: Set the mapping values of the first and second interior angles of the mesh sample, where the first and second interior angles are any two different interior angles of the mesh sample;
[0117] Step 2.12: Substitute the first interior angle and its mapping value, the second interior angle and its mapping value into the normalized function (2) respectively to obtain the nonlinear equation system;
[0118] Step 2.13: Solve the nonlinear equation system to obtain the values of parameters Φ and θ.
[0119] For example, let the interior angle α k The mapping value when α = 85° is 0.9, and the interior angle α k The mapping value at =80° is 0.8, thus the nonlinear equation system is obtained as follows:
[0120]
[0121] Solving equation (3) yields the values of parameters Φ and θ. The values of parameters Φ and θ can be obtained using the `fsolve` function in MATLAB for solving nonlinear equation systems. Since f(α) k Since it is symmetrical, we only need to consider the mapping values of interior angles within the range of 0 to 90°. The mapping values are flexible rules, and the mapping values of interior angles can be set arbitrarily as long as they are reasonable. The default mapping value is 1 when the interior angle is 90° or 180°.
[0122] Step 2.2: Based on the changes in the side length of the mesh samples before and after simplification, assign each mapping value α... k Set a penalty factor.
[0123] Construct a set `road_former` to store the state of each edge of the simplified mesh before the last simplification; initialize a set `road_final` to store all edges that make up the simplified mesh. For example, ... Figure 3 As shown, road_former = {M 1-2 M 2-3 M 3-4 M 4-1}, road_final={m 1-2 ,m 2-3 ,m 3-4 ,m 4-1}
[0124] Based on the changes in the internal roads of the mesh before and after simplification, for each mapping value α... k 'Set the penalty factor, and the specific calculation expression for the penalty factor:'
[0125]
[0126] Among them, w k For the mapping value α k 'Corresponding penalty factor, L' k1 L' k2 These are the simplified i-th interior angles α and β. k The lengths of the two sides, L k1 L k2 These are the k-th interior angles α before the last simplification. k The lengths of the two sides. Interior angles correspond one-to-one with mapping values, and mapping values correspond one-to-one with penalty factors.
[0127] like Figure 3 As shown, the mesh has 4 interior angles. Taking α1 as an example, the penalty factor is... in Let be the lengths of the two sides of the simplified interior angle α1. These are the lengths of the two sides of interior angle α1 before the last simplification.
[0128] Step 2.3: Based on the penalty factor and the normalization function f(α) k The orthogonality index of the mesh samples is calculated using the following formula:
[0129]
[0130] Where OI is the orthogonality index of mesh samples, w k For the mapping value α k The corresponding penalty factor, m1, is an interior angle α less than 135°. k The quantity, m2 is the interior angle α greater than or equal to 135°. k The quantity, sum() sums the two parts within the curly braces, that is:
[0131]
[0132] By traversing all the meshes, the orthogonality index of each mesh in the road network can be obtained.
[0133] Step 4: Based on the orthogonality index of the mesh samples, define and calculate the feature parameters of each mesh sample for grid pattern recognition, and obtain the feature vector of each mesh sample.
[0134] The feature parameters of each mesh sample or mesh include compactness, orthogonality strength (OS), edge number condition (SC), first-order neighbor mean orthogonality strength (1stOSmean), and first-order neighbor fusion maximum orthogonality strength (1stmerge). OS max).
[0135] The compactness of a mesh is defined as the ratio of the mesh area to the area of its smallest circumscribed circle. The specific formula for calculating compactness is as follows:
[0136]
[0137] Among them, C i Let A be the compactness of the i-th mesh sample. origini Let A be the area of the i-th mesh sample before simplification. Ci Let be the minimum circumcircle area of the i-th mesh sample before simplification.
[0138] Construct a set `origin_save` to store the point features contained in each mesh of the road network before simplification. `origin_save = {origin1, origin2, origin3, ..., origin...}` n}, origin i Let represent the i-th mesh, where i = 1, 2, 3, ..., n, and n is the number of meshes in the road network. Let h represent the h-th point element contained in the i-th mesh, where h = 1, 2, 3, ..., m, and m is the number of point elements contained in the i-th mesh.
[0139] Iterate through the collection origin_save, and for each origin i Find its smallest circumcircle. For example... Figure 4 As shown, the closed shape formed by dashed lines represents the mesh, the gray solid dots represent the point elements contained in the mesh, and the black circle represents the smallest circumcircle of the mesh. The compactness of the i-th mesh is shown in Equation (7).
[0140] The orthogonality index (OS) of a mesh is defined as the ratio of the orthogonality index of the mesh to the area of the mesh before and after simplification (smaller ratio to larger ratio). The specific calculation formula is as follows:
[0141]
[0142] Among them, OS i Let OI be the orthogonal intensity of the i-th mesh sample. i Let A be the orthogonal index of the i-th mesh sample. finali Let be the simplified area of the i-th mesh sample.
[0143] Construct a set `final_save` to store the point features contained in each simplified mesh. `final_save = {final_polyg1, final_polyg2, final_polyg3, ..., final_polyg...}` n}, final_polygi Let i represent the i-th simplified mesh, where i = 1, 2, 3, ..., n; and Let h represent the h-th point element contained in the i-th simplified mesh, where h = 1, 2, 3, ..., m. Iterate through the elements in the two sets `origin_save` and `final_save`, and use the "polyarea" function in MATLAB to calculate the area of each element. Then the orthogonal strength of the i-th mesh is:
[0144]
[0145] The edge count of a mesh is defined as the reciprocal of the total edge count of the simplified mesh. Iterating through each simplified mesh, we initialize the set `edge_save`, which stores the edge count of each simplified mesh. The specific calculation formula is as follows:
[0146]
[0147] Among them, SC i The edge number condition for the i-th mesh sample is edge i Let represent the number of edges contained in the simplified i-th mesh sample.
[0148] The first-order neighbor mean orthogonal strength (1stOSmean) of a mesh is defined as the average orthogonal strength of its first-order neighbor meshes. First-order neighbor meshes are all meshes that share a common edge or point with the mesh. The specific formula for calculating the first-order neighbor mean orthogonal strength is as follows:
[0149]
[0150] Among them, 1stOSmean i OS is the average orthogonal intensity of the first-order neighbors of the i-th mesh sample. ir Let R be the orthogonal intensity of the r-th first-order neighbor mesh of the i-th mesh sample, and R be the number of first-order neighbor meshes of the i-th mesh sample.
[0151] In the specific implementation, the set OS_save is initialized. The set OS_save is used to store the orthogonal strength of each mesh, OS_save = {OS1, OS2, OS3, ..., OS...} n OS iThis represents the orthogonality strength of the i-th mesh. Based on the FNODE_ and TNODE_ fields in the road network data attribute table, find the first-order neighbor meshes for each mesh. Initialize the set `neighbor_index`, which stores the indices of the first-order neighbor meshes for each mesh: `neighbor_index = {index1, index2, index3, ..., index...}`. R}, index i This represents the index of the first-order neighbor mesh of the i-th mesh, and the 1stOSmean of the i-th mesh is:
[0152] 1stOSmean i =mean(OS_save(neighbor_index(i)))(12)
[0153] like Figure 5 As shown, based on the FNODE_ and TNODE_ fields in the road network attribute table, the first-order neighbor meshes of mesh M are found to be meshes M1 to M4. The orthogonal strength of meshes M1 to M4 is calculated according to formula (8). The average orthogonal strength of the first-order neighbor meshes M1 to M4 is obtained by averaging the orthogonal strengths of these four first-order neighbor meshes M1 to M4.
[0154] The maximum orthogonality intensity of a mesh's first-order neighbor fusion is defined as the maximum value among the orthogonality intensities calculated after the target mesh is fused with all its first-order neighbor meshes. An initial set `mergeOS_save` is initialized to store the orthogonality intensities of each mesh after fusion with all its first-order neighbor meshes. `mergeOS_save = {neighbormergeOS1, neighbormergeOS2, neighbormergeOS3, ..., neighbormergeOS}` n}, neighbormergeOS i Let represent the set of orthogonal intensities obtained after fusing the i-th mesh with each of its first-order neighbor meshes. Let r represent the orthogonality strength of the ith mesh and its r-th first-order neighbor mesh after fusion, where r = 1, 2, 3, ..., R. The maximum orthogonality strength of the ith mesh after fusion of its first-order neighbors is:
[0155] 1stmerge OS max i =max(mergeOS_save(i)(13)
[0156] That is, 1stmerge OS max i =max(mergeOS)i1 mergeOS i2 ,…,mergeOS ir ,…,mergeOS iR )
[0157] Among them, 1stmerge OS max i For the first-order neighbor fusion of the i-th mesh sample, mergeOS is the maximum orthogonal intensity. ir Let be the orthogonal intensity of the ith mesh sample fused with its r-th first-order neighbor mesh. The surface region resulting from the fusion of the ith mesh sample with its r-th first-order neighbor mesh can be considered as a single mesh, then mergeOS ir It can be calculated according to equation (8).
[0158] like Figure 6 As shown, mesh M is the target mesh, and meshes M1 to M3 are the first-order neighbor meshes of M. Figure 6 (a) Figure 6 (b) Figure 6 (c) are the results of M and M1 to M3 respectively. The orthogonal intensity of each fusion result is calculated according to Equation (8), and the maximum value is the maximum orthogonal intensity of the first-order neighbor fusion of mesh M.
[0159] The five-dimensional feature vector of the mesh is composed of five feature parameters.
[0160] Step 5: Build a pattern recognition model, using the feature vector of each mesh sample as the input vector and the corresponding label as the output vector, and train the pattern recognition model.
[0161] In this embodiment, the pattern recognition model employs a probabilistic neural network. For example... Figure 7 The basic structure diagram of the model shown is a probabilistic neural network consisting of an input layer, a hidden layer, a summation layer, and an output layer connected in sequence. The number of neurons in the input layer is equal to the length of the input vector; the number of neurons in the hidden layer is equal to the number of input training samples; the number of neurons in the summation layer is equal to the number of categories of mesh samples; and the number of neurons in the output layer is equal to the number of neurons in the summation layer.
[0162] The sample dataset, consisting of all mesh samples in the road network, is divided into a training set and a validation set. For example... Figure 8 As shown, the sample dataset D is divided into 10 parts. Nine parts are taken as the training set, and the remaining part is used as the validation set. The smoothing factor is uniformly selected from 0 to 1 with a step size of 0.001, resulting in 1000 values. For each different smoothing factor, 10-fold cross-validation is performed, and the average precision is calculated. The smoothing factor that achieves the maximum average precision is taken as the optimal hyperparameter.
[0163] Step 5.1: Input the sample into the model.
[0164] PNN does not have a traditional training process that learns weights and biases. Training samples are input into neurons in the hidden layers, serving as the centers of these neurons and providing an initial prior probability for classification decisions. Therefore, the number of neurons in the hidden layers equals the number of training samples. Figure 9 As shown, the training process has ended.
[0165] Step 5.2: The feature vector of the sample is passed from the input layer to the hidden layer, and the output is calculated in the hidden layer.
[0166] After training, each hidden layer contains one training sample. Therefore, neurons in the hidden layers can be classified into class A and class B based on the labels of the training samples. The number of neurons in the summation layer is the same as the number of classes, and they are also classified into class A and class B. Furthermore, neurons in the summation layer will only connect to neurons of the same class in the hidden layers. Figure 10 As shown.
[0167] The output of each neuron in the hidden layer is:
[0168]
[0169] in, It is the output of the j-th neuron of category i, where P is the dimension of the input vector X, and X is the output of the j-th neuron of category i. ij It is the j-th training sample of the i-th category, and δ is the smoothing factor. In this embodiment, the category of the mesh sample is "1" or "2", where "1" represents a mesh and "2" represents a non-mesh. The input vector has a dimension of 5.
[0170] Step 5.3: The output of the hidden layer is passed to the summing layer.
[0171] The output of each neuron in the summation layer is:
[0172]
[0173] Among them, v i To calculate the output of the i-th type of neuron in the summation layer, where N is the number of the i-th type of neuron in the hidden layer, w ij Let J be the weight corresponding to the j-th neuron in the i-th category. Unless otherwise specified, w ij =1 / N, therefore, the only adjustable parameter is the δ smoothing factor. By continuously adjusting the value of the smoothing factor, the model can achieve better performance on the validation set.
[0174] Step 5.4: The output of the summation layer is passed to the output layer.
[0175] The output layer receives the output of the summation layer, classifies the input vectors of the validation set into the category of the neuron with the largest output, and calculates the accuracy of the model by comparing the category output by the model with the manually labeled category in the validation set.
[0176] like Figure 11 As shown, the neurons in the output layer only need to perform simple discrimination; the sample to be classified is assigned to the category of the neuron whose output is larger in the summation layer. Accuracy and recall can be obtained by comparing the predicted categories of the validation set samples output by the model with the original categories of the validation set samples, thus evaluating the model performance. In addition to adjusting δ, the corresponding predicted categories of the validation set are output and statistically analyzed. When the model achieves better performance, δ can be saved.
[0177] Step 5.5: For the sample dataset D, which is divided into 10 training and validation sets, repeat steps 5.1 to 5.4 and calculate the average precision.
[0178] Step 5.6: For 1000 different smoothing factors, repeat steps 5.1 to 5.5, take the smoothing factor that reaches the maximum value of average accuracy as the optimal hyperparameter, and use the finally obtained PNN model for grid pattern recognition. The PNN model can identify the meshes that belong to the grid in the road network.
[0179] Based on the same inventive concept, this invention also provides a method for road network grid pattern recognition, the recognition method comprising the following steps:
[0180] Step 1: Obtain the road network to be identified.
[0181] Step 2: Simplify the roads in the road network to be identified to obtain the simplified road network to be identified. For the specific simplification process, please refer to steps 1.1 to 1.5 in the training method.
[0182] Step 3: Calculate the orthogonality index of each mesh in the simplified road network to be identified. See steps 2.1 to 2.3 in the training method for details.
[0183] Step 4: Based on the orthogonality index of the mesh, define and calculate the feature parameters of each mesh for grid pattern recognition to obtain the feature vector of each mesh. See Step 4 in the training method for details.
[0184] Step 5: Train the pattern recognition model according to the road network grid pattern recognition model training method described above.
[0185] Step 6: Perform pattern recognition on each mesh using the pattern recognition model.
[0186] The above description only discloses specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or modifications that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A road network grid pattern recognition model training method, characterized in that, The training method comprises the following steps: selecting a road network from urban road network data, and performing grid labeling or non-grid labeling on each mesh sample in the road network; simplifying the roads in the road network to obtain a simplified road network; calculating the orthogonal index of each mesh sample in the simplified road network; defining and calculating the characteristic parameters of each mesh sample for grid pattern recognition based on the orthogonal index of the mesh sample, to obtain the feature vector of each mesh sample; constructing a pattern recognition model, taking the feature vector of each mesh sample as an input vector, and taking the corresponding label as an output vector, and training the pattern recognition model; wherein the specific calculation process of the orthogonal index of the mesh sample is as follows: Step 2.1: mapping each internal angle of the mesh sample to the range of 0-1 using a normalization function, and the specific expression of the normalization function is as follows: wherein α k is the mapping value of the kth interior angle, α k is the kth interior angle before mapping, and Φ, Θ are parameters of the normalized function f(α k ). Step 2.2: According to the change of the side length of the mesh sample before and after the simplification, the mapping value a of each mesh sample is calculated k ' Set the penalty factor; Step 2.3: Calculate the orthogonal index of the mesh sample according to the penalty factor and the normalization function f(a k ), the specific formula is: where OI is the orthogonal index of the mesh sample, w k is the mapping value a k corresponding to the penalty factor, m1 is the number of inner angles a k less than 135°, m2 is the number of inner angles a k greater than or equal to 135°, and sum() is the sum of the two parts within the curly brackets. 2.The method of claim 1, wherein, simplifying the roads in the road network using an improved Douglas-Peucker algorithm, and the specific implementation process is as follows: Step 1.1: constructing a seed sequence for each road between two adjacent nodes with connectivity greater than 3 in the road network where P ij is the jth node on the ith road, n i is the number of nodes on the ith road; the ith road refers to the road between the ith two adjacent nodes with connectivity greater than 3. Step 1.2: Calculate the straightness ST of the road, if ST≥T, only keep the first and last nodes of the road, and update the seed sequence of the road If ST<T, go to step 1.3; wherein T is a simplification threshold Step 1.3: In the seed sequence Seed i Find the line in the middle The node P with the largest distance io , with node P io Seed sequence as segmentation point i Divided into subsequences Seed i1 ={P i1 ,P i2 ,…,P io } and subsequences Update Seed i ={Seed i1 Seed i2 }; Step 1.4: Extracting the seed sequence Seed from the sequence of nodes i Step 1.2-1.3 are repeated for each sub-sequence of Seed until each sub-sequence contains only two nodes, and the seed sequence Seed is extracted i The nodes contained in Seed form the simplified road. Step 1.5: repeating steps 1.2-1.4 for each road until the simplification of all roads in the road network is completed. 3.The method of claim 2, wherein, The calculation formula of the straightness ST of the road is as follows: ST = L / S wherein L is the total length of the road, and S is the straight-line distance between the two points at the beginning and end of the road. 4.The method of claim 2, wherein, The simplification threshold T is 0.
956. 5.The method of claim 1, wherein, The normalization function f(a k ) is determined by the parameters Φ, θ as follows: Setting the mapping values of the first internal angle and the second internal angle of the mesh sample, wherein the first internal angle and the second internal angle are any two different internal angles of the mesh sample; substituting the first internal angle and its mapping value, and the second internal angle and its mapping value into the normalization function respectively to obtain a system of nonlinear equations; solving the system of nonlinear equations to obtain the values of parameters Φ and θ. 6.The method of claim 1, wherein, The specific calculation expression of the penalty factor is as follows: wherein w k is the mapping value a k corresponding to the penalty factor L k1 , L k2 are the lengths of the two sides of the i-th internal angle a k after simplification, respectively k1 L k2 are the lengths of the two sides of the k-th internal angle a k before the last simplification, respectively. 7.The method of claim 1, wherein, The characteristic parameters of each mesh sample include compactness, orthogonal intensity, edge number condition, first-order neighbor average orthogonal intensity, and first-order neighbor fusion maximum orthogonal intensity; The specific calculation formula of the compactness is as follows: wherein C i is the compactness of the ith mesh sample, A origini is the area of the ith mesh sample before simplification, is the minimum circumscribed circle area of the ith mesh sample before simplification; The specific calculation formula of the orthogonal intensity is as follows: wherein OS i is the orthogonal intensity of the i-th mesh sample, OI i is the orthogonal index of the i-th mesh sample, A finali is the area of the i-th mesh sample after simplification; The specific calculation formula of the edge number condition is as follows: wherein SC i is the number of edges of the ith mesh sample, edge i is the number of edges contained in the simplified ith mesh sample; The specific calculation formula of the first-order neighbor average orthogonal intensity is as follows: wherein 1st OS mean i is the first order neighbor average orthogonal intensity of the ith mesh sample, OS ir is the orthogonal intensity of the rth first order neighbor mesh of the ith mesh sample, R is the number of first order neighbor meshes of the ith mesh sample, and the first order neighbor meshes of a mesh are all meshes that share a common edge or common node with the mesh. The specific calculation formula of the first-order neighbor fusion maximum orthogonal intensity is as follows: 1stmerge OS max i = max(mergeOS i1 , mergeOS i2 ,..., mergeOS ir ,..., mergeOS iR ) wherein 1stmerge OS max i is the first-order neighbor fusion maximum orthogonal intensity of the ith mesh sample, mergeOS ir is the orthogonal intensity of the ith mesh sample and its rth first-order neighbor mesh after fusion. 8.The method of any one of claims 1-7, wherein, The pattern recognition model uses a probabilistic neural network, which comprises an input layer, a hidden layer, a summation layer, and an output layer linked in sequence; The number of neurons in the input layer is equal to the length of the input vector; the number of neurons in the hidden layer is equal to the number of input training samples; the number of neurons in the summation layer is equal to the number of categories of the mesh sample; and the number of neurons in the output layer is equal to the number of neurons in the summation layer.
9. A road network mesh pattern recognition method, characterized by, The recognition method comprises: obtaining a road network to be recognized; simplifying the roads in the road network to be recognized to obtain a simplified road network to be recognized; calculating the orthogonal index of each mesh in the simplified road network to be recognized; defining and calculating the characteristic parameters of each mesh for grid pattern recognition based on the orthogonal index of the mesh, to obtain the feature vector of each mesh; The road network grid pattern recognition model training method according to any one of claims 1-8 is used to train a pattern recognition model; Each of the meshes is subjected to pattern recognition by using the pattern recognition model.
10. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein The memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, cause the at least one processor to perform the steps in the road network grid pattern recognition model training method according to any one of claims 1-8 or the steps in the road network grid pattern recognition method according to claim 9.
11. A non-transitory computer-readable storage medium, comprising: The non-transitory computer-readable storage medium stores computer instructions that, when executed by at least one processor, cause the at least one processor to perform the steps in the road network grid pattern recognition model training method according to any one of claims 1-8 or the steps in the road network grid pattern recognition method according to claim 9.
Citation Information
Patent Citations
Convolutional neural network image recognition method based on dynamic adjustment of training targets
CN104268524A
Target identification method for radar one-dimensional range profile on the basis of deep own-coding network
CN107194433A