A micro-terrain identification method, device, equipment and storage medium
Patent Information
- Application Number
- CN202411037434.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-07-31
AI Technical Summary
而微地形相较于宏观地形能够更加细致地表达地形变化,现阶段输电线路微地形识别的研究多是基于规则知识和经验进行的,识别精度和识别效率有待进一步提升,目前还未形成一套应用于大范围内输电线路微地形快速识别的有效方法
[0064]本发明实施例的技术方案,通过基于均值变点分析法寻找地形位置指数的最佳计算窗口,以最佳计算窗口获取目标样本的地形位置指数特征;以目标样本中高程点邻域窗口内统计的平均高程偏差,获取平均高程偏差达到预设阈值时的邻域窗口大小,计算剖面曲率特征;再由优化计算得到的地形位置指数特征和剖面曲率特征构建样本特征数据集来作为微地形识别模型训练样本,本发明优化后的特征因子及其组合能够实现微地形地有效区分,使各类地形的边界更加清晰,并能快速对微地形进行识别。
Smart Images

Figure CN119066531B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of topographic mapping technology, and in particular to a micro-topography identification method, apparatus, equipment, and storage medium. Background Technology
[0002] Meteorological disasters are often closely related to the terrain where power transmission lines are located. Complex local terrain can alter meteorological factors such as air humidity and airflow patterns within a given area. Under the combined influence of terrain and meteorological changes, strong winds, low temperatures, and high humidity generated in micro-topographical areas can easily damage power transmission lines, leading to accidents such as wind deflection, icing, and line breaks. Therefore, micro-topography identification can provide a reference for the planning, layout, daily maintenance, and disaster prevention of power transmission lines, ensuring the stable operation of the power transmission system. While micro-topography can express terrain changes in greater detail than macro-topography, current research on micro-topography identification for power transmission lines is mostly based on rule-based knowledge and experience. The accuracy and efficiency of identification need further improvement, and an effective method for rapid identification of micro-topography for power transmission lines over large areas has not yet been developed.
[0003] In addition, since power transmission lines span multiple regions and the surrounding terrain is quite complex, it is often necessary to use large-scale DEM (Digital Elevation Model) data for micro-topography identification. Efficiency is one of the difficulties currently faced in micro-topography identification of power transmission lines, and traditional processing methods are difficult to meet the needs of massive data processing. Summary of the Invention
[0004] This invention provides a micro-topography identification method, apparatus, device, and storage medium for achieving efficient and accurate identification of micro-topography in power transmission line corridors.
[0005] According to one aspect of the present invention, a micro-terrain identification method is provided, comprising:
[0006] The optimal calculation window for the terrain location index is found based on the mean change point analysis method, and the terrain location index features of the target sample are obtained based on the optimal calculation window.
[0007] Based on the average elevation deviation statistically analyzed within the neighborhood window of elevation points in the target sample, the size of the neighborhood window when the average elevation deviation reaches a preset threshold is obtained, and the profile curvature feature is calculated based on the obtained neighborhood window size.
[0008] A micro-topography classification decision table is constructed based on the topographic location index, the profile curvature, the elevation variation coefficient, the topographic slope, and the undulation characteristics.
[0009] Construct a sample feature dataset at least based on the topographic position index feature, the profile curvature feature and the micro-topography classification decision table;
[0010] Train a micro-topography recognition model based on the sample feature data;
[0011] Input the elevation data of the to-be-tested area into the trained micro-topography recognition model, so as to identify the micro-topography of the to-be-tested area.
[0012] Optionally, the searching for the optimal calculation window of the topographic position index based on the mean change point analysis method, and obtaining the topographic position index feature of the target sample based on the optimal calculation window comprises:
[0013] The calculation formula for the topographic position index TPI is:
[0014]
[0015] Z i is the elevation value of point i, is the average value of all elevation points in the neighborhood range of point i;
[0016] Calculate the range value of the topographic position index under each of the windows;
[0017] Based on the range value of the topographic position index and the window size, obtain the range value of the topographic position index per unit area;
[0018] Construct a data sequence based on the range values of the topographic position index corresponding to each of the windows;
[0019] Calculate the variance of the data sequence, and the calculation formula is:
[0020]
[0021] In the formula, is the average value of the data sequence {x i}, i=1, 2, 3, ..., N, where N is the number of windows adopted;
[0022] Select x in sequence i as a truncation point to divide the data sequence into two subsequences, and 1<t<N; calculate the sum S of the variances of the two subsequences i :
[0023]
[0024] In the formula, and are respectively the subsequence and The arithmetic mean;
[0025] The difference between S and Si is calculated to obtain the resulting sequence {SS}. i The cutoff point x selected for the maximum value in the resulting sequence. i The corresponding window is the optimal calculation window;
[0026] The terrain location index features of the target sample are obtained based on the optimal calculation window.
[0027] Optionally, the step of obtaining the size of the neighborhood window when the average elevation deviation reaches a preset threshold based on the statistical average elevation deviation within the neighborhood window of elevation points in the target sample, and calculating the profile curvature feature based on the obtained neighborhood window size, includes:
[0028] Calculate the average elevation deviation (DEV) within each neighborhood window of the elevation point sequentially:
[0029]
[0030]
[0031] In the formula, z0 is the elevation value of a certain point; It is the average elevation within the neighborhood; SD is the standard deviation of elevation within the neighborhood; n is the number of grid points in the neighborhood; z i These are grid points within the neighborhood;
[0032] When the average elevation deviation (DEV) reaches a preset threshold, the profile curvature feature is calculated based on the neighborhood window size corresponding to the threshold.
[0033] Optionally, before constructing the sample feature dataset based at least on the topographic location index features and the profile curvature features, the method further includes:
[0034] Calculate the slope characteristics, undulation characteristics, and elevation variation coefficient characteristics of the target sample respectively;
[0035] The construction of the sample feature dataset based at least on the terrain location index features and the profile curvature features includes:
[0036] A micro-topography classification decision table is constructed based on the topographic location index features, the profile curvature features, the elevation variation coefficient features, the slope features, and the undulation features.
[0037] Based on the feature values of the topographic location index feature, profile curvature feature, slope feature, undulation feature and elevation variation coefficient feature of the target sample, the classification label of the target sample is obtained according to the micro-topography classification decision table;
[0038] A sample point is constructed based on the feature values of the terrain location index feature, the profile curvature feature, the slope feature, the undulation feature, the elevation variation coefficient feature corresponding to the target sample, and the classification label. A sample feature dataset is constructed from several sample points.
[0039] Optionally, the method also includes:
[0040] Construct a parallelized random forest model;
[0041] The construction of the parallelized random forest model includes:
[0042] Construct several parallel decision trees for self-sampling, and allocate the sample feature dataset required for training to each decision tree;
[0043] Parallel training of several decision trees, each decision tree is constructed in parallel by an allocated thread;
[0044] The classification prediction is parallelized, predicting the micro-topography category of the sample points to be classified in parallel, and obtaining the final micro-topography category of the sample points through voting.
[0045] Optionally, training the micro-terrain recognition model based on the sample feature data includes:
[0046] Select a training set from the sample feature dataset;
[0047] Samples are randomly drawn with replacement from the training set to construct multiple sub-training sets;
[0048] Features are randomly selected from each sub-training set to train each decision tree.
[0049] Optional, also includes:
[0050] Evaluate the recognition performance of the parallel random forest model;
[0051] The evaluation of the recognition performance of the parallel random forest model includes:
[0052] The recognition performance of the parallel random forest model is evaluated based on the recognition metrics of the parallel random forest model; the recognition metrics include one or more of the following: confusion matrix, classification accuracy, Kappa coefficient, precision for a single class, and recall.
[0053] According to another aspect of the present invention, a micro-terrain recognition device is provided, comprising:
[0054] The first feature acquisition unit is used to find the optimal calculation window for the terrain location index based on the mean change point analysis method, and to acquire the terrain location index features of the target sample based on the optimal calculation window.
[0055] The second feature acquisition unit is used to acquire the size of the neighborhood window when the average elevation deviation reaches a preset threshold based on the average elevation deviation statistically counted within the neighborhood window of the elevation points in the target sample, and to calculate the profile curvature feature based on the acquired neighborhood window size.
[0056] A dataset construction unit is used to construct a sample feature dataset based at least on the terrain location index features and the profile curvature features;
[0057] The training unit is used to train a micro-terrain recognition model based on the sample feature data;
[0058] The identification unit is used to input the elevation data of the area to be measured into the trained micro-topography identification model in order to identify the micro-topography of the area to be measured.
[0059] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0060] At least one processor; and
[0061] A memory communicatively connected to the at least one processor; wherein,
[0062] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the micro-terrain recognition method according to any embodiment of the present invention.
[0063] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the micro-terrain recognition method according to any embodiment of the present invention.
[0064] The technical solution of this invention finds the optimal calculation window for the terrain location index based on the mean change point analysis method, and obtains the terrain location index features of the target sample using the optimal calculation window; it obtains the size of the neighborhood window when the average elevation deviation reaches a preset threshold by statistically analyzing the average elevation deviation within the neighborhood window of the elevation points in the target sample, and calculates the profile curvature features; then, it constructs a sample feature dataset using the optimized terrain location index features and profile curvature features as training samples for the micro-terrain recognition model. The optimized feature factors and their combinations in this invention can effectively distinguish micro-terrain, make the boundaries of various terrains clearer, and quickly identify micro-terrain.
[0065] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a flowchart of a micro-terrain recognition method provided in an embodiment of the present invention;
[0068] Figure 2 This is a schematic diagram of a sub-process of a micro-terrain recognition method provided in an embodiment of the present invention;
[0069] Figure 3 This is a schematic diagram of another sub-process of a micro-terrain recognition method provided in an embodiment of the present invention;
[0070] Figure 4 A schematic diagram of the architecture of a parallel random forest model for a micro-terrain recognition method provided in an embodiment of the present invention;
[0071] Figure 5 This is a schematic diagram of another sub-process of a micro-terrain recognition method provided in an embodiment of the present invention;
[0072] Figure 6 This is a schematic diagram illustrating the effect of the method of this invention in identifying two types of micro-topography: mountain passes and canyons.
[0073] Figure 7 This is a schematic diagram illustrating the micro-terrain recognition effect obtained using the model of the present invention;
[0074] Figure 8 This is a schematic diagram of the structure of a micro-terrain recognition device provided in an embodiment of the present invention;
[0075] Figure 9 This is a schematic diagram of the structure of an electronic device that implements the micro-terrain recognition method of this invention. Detailed Implementation
[0076] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.
[0077] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0078] The terms used in this invention are explained below:
[0079] Topographic Position Index (TPI).
[0080] Digital Elevation Model (DEM).
[0081] Figure 1 A flowchart of a micro-terrain identification method is provided for an embodiment of the present invention. For example... Figure 1 As shown, the method includes:
[0082] S101. Find the optimal calculation window for the terrain location index based on the mean change point analysis method, and obtain the terrain location index features of the target sample based on the optimal calculation window.
[0083] The Terrain Position Index (TPI) is the difference between the elevation value of a point in a digital elevation model and the average elevation values of other points in its neighborhood. It is used to reflect the relative position of a point with other points in its neighborhood on the terrain, and thus can be used for terrain morphology analysis. For example, TPI can be used to distinguish between ridges, valleys, uphill and downhill slopes, and flat slopes.
[0084] In one embodiment, large TPI and small TPI are defined based on the window radius. The calculation window radius of small TPI is generally less than 600 meters. When the window radius exceeds 600 meters, TPI can still capture relatively detailed micro-topographic features, suitable for describing local topographic changes. However, when the window radius exceeds 2000 meters, TPI gradually loses its sensitivity to elevation changes, thus ignoring detailed micro-topographic information. TPI calculated when the window radius is set to 600-2000 meters is called large TPI. In this embodiment, the resolution of the DEM raster data is 30 meters, and the optimal calculation window radius for large TPI can be set within the range of 20 to 70 pixels.
[0085] This embodiment can use different window sizes, such as 20x20 pixels, 21x21 pixels, ..., 69x69 pixels, and 70x70 pixels, to calculate the range of TPI values under each window. The mean-variable point analysis method is then used to find the optimal calculation window for the topographic location index, and the topographic location index features of the target sample are obtained based on the optimal calculation window. The target sample can be DEM data of a transmission line crossing an area.
[0086] S102. Based on the average elevation deviation statistically analyzed within the neighborhood window of elevation points in the target sample, obtain the size of the neighborhood window when the average elevation deviation reaches a preset threshold, and calculate the profile curvature feature based on the obtained neighborhood window size.
[0087] The calculation window for profile curvature is generally set to 3 pixels × 3 pixels. A smaller window provides sufficient resolution to analyze micro-topographic features, which helps to accurately calculate local profile curvature. Considering the accuracy requirements of micro-topography, a maximum calculation window size of 500 meters × 500 meters is more appropriate. Exceeding this maximum value may lead to excessive smoothing of elevation data, causing important terrain details to be ignored or blurred. Therefore, the minimum neighborhood window size in the adaptive neighborhood method can be set to 3 pixels × 3 pixels, and the maximum neighborhood window can be set to 15 pixels × 15 pixels (450 meters × 450 meters). The average elevation deviation (DEV) within the neighborhood windows from 15 pixels × 15 pixels to 3 pixels × 3 pixels is calculated in descending order. This metric is used to evaluate the complexity of the terrain within the window. The neighborhood window size at which the average elevation deviation reaches a preset threshold is used to calculate the profile curvature feature.
[0088] In this embodiment, the preset threshold can be obtained based on experimental data and empirical data. When the average elevation deviation (DEV) reaches the preset threshold, the size of the neighborhood window corresponding to the preset threshold can be selected to calculate the profile curvature feature. When the average elevation deviation (DEV) is greater than the preset threshold, the size of the neighborhood window corresponding to the DEV that is greater than the preset threshold can also be used to calculate the profile curvature feature.
[0089] S103. Construct a sample feature dataset based at least on the terrain location index features and the profile curvature features.
[0090] This invention can construct a sample feature dataset using optimized terrain location index features and profile curvature features. For example, a sample named P can be constructed. i =(F1,F2,..F n ,L), where F1,F2,...F n Let F1, F2, ..., F be the feature values of this sample point. n The sample point includes at least the optimized topographic location index features and profile curvature features, where L is the micro-topographic label for that sample point.
[0091] S104. Train a micro-terrain recognition model based on the sample feature data.
[0092] The embodiments of the present invention can combine neural network models to identify micro-topography. For example, this application can use random forest trees as a micro-topography identification model. Of course, other neural network architectures can also be used for micro-topography identification.
[0093] S105. Input the elevation data of the area to be measured into the trained micro-topography recognition model to identify the micro-topography of the area to be measured.
[0094] After training the micro-topography recognition model, the large-scale digital elevation model of the transmission line to be measured can be input into the recognition model, thereby quickly identifying the micro-topography in the large-scale digital elevation model of the transmission line and classifying and mapping it.
[0095] The technical solution of this invention finds the optimal calculation window for the terrain location index based on the mean change point analysis method, and obtains the terrain location index features of the target sample using the optimal calculation window; it obtains the size of the neighborhood window when the average elevation deviation reaches a preset threshold by statistically analyzing the average elevation deviation within the neighborhood window of the elevation points in the target sample, and calculates the profile curvature features; then, it constructs a sample feature dataset using the optimized terrain location index features and profile curvature features as training samples for the micro-terrain recognition model. The optimized feature factors and their combinations in this invention can effectively distinguish micro-terrain, make the boundaries of various terrains clearer, and quickly identify micro-terrain.
[0096] In one embodiment, step S101, finding the optimal calculation window for the topographic position index based on the mean change point analysis method, and obtaining the topographic position index feature of the target sample based on the optimal calculation window, specifically includes:
[0097] The calculation formula of the topographic position index TPI is:
[0098]
[0099] Z i is the elevation value of point i, is the average value of all elevation points in the neighborhood range of point i.
[0100] Calculate the range value of the topographic position index under each of the windows.
[0101] Based on the range value of the topographic position index and the window size, the range value of the topographic position index per unit area is obtained.
[0102] A data sequence is formed based on the range values of the topographic position index corresponding to each of the windows; the window can be selected from 20 pixels × 20 pixels to 70 pixels × 70 pixels.
[0103] Calculate the variance of the data sequence, and the calculation formula is:
[0104]
[0105] In the formula, is the average value of the data sequence {x i}, i=1, 2, 3, ..., N, where N is the number of windows used.
[0106] Select x in sequence i , as a truncation point to divide the data sequence into two subsequences, and 1<t<N; calculate the sum S of the variances of the two subsequences i .
[0107]
[0108] In the formula, and are respectively the arithmetic mean values of the subsequence and .
[0109] Calculate the difference between S and Si in this way, to obtain the result sequence {S-S i}; the window corresponding to the truncation point x selected by the maximum value in the result sequence i is the optimal calculation window.
[0110] The terrain location index features of the target sample are obtained based on the optimal calculation window.
[0111] In this embodiment, the range of the terrain location index can be the difference between the maximum and minimum TPI values within the window. Dividing the TPI range by the corresponding window area yields the TPI range per unit area. A data sequence can be constructed by taking the logarithm of the range values of the terrain location index for each window.
[0112] In one embodiment, step S102, based on the average elevation deviation statistically analyzed within the neighborhood window of elevation points in the target sample, obtains the size of the neighborhood window when the average elevation deviation reaches a preset threshold, and calculates the profile curvature feature based on the obtained neighborhood window size, including:
[0113] Calculate the average elevation deviation (DEV) within each neighboring window sequentially:
[0114]
[0115]
[0116] In the formula, z0 is the elevation value of a certain point; It is the average elevation within the neighborhood; SD is the standard deviation of elevation within the neighborhood; n is the number of grid points in the neighborhood; z i These are grid points within the neighborhood;
[0117] When the average elevation deviation (DEV) reaches a preset threshold, the profile curvature feature is calculated based on the neighborhood window size corresponding to the threshold.
[0118] The mean elevation deviation (DEV) can be calculated by sequentially calculating neighborhood window sizes from 15×15 pixels to 3×3 pixels, in descending order. In this embodiment, the preset threshold can be obtained based on experimental and empirical data. When the mean elevation deviation (DEV) reaches this preset threshold, the neighborhood window size corresponding to the preset threshold can be used to calculate the profile curvature feature. When the mean elevation deviation (DEV) is greater than the preset threshold, the neighborhood window size corresponding to the DEV values greater than the preset threshold can also be used to calculate the profile curvature feature.
[0119] In one embodiment, the method further includes: calculating the slope characteristics, undulation characteristics, and elevation variation coefficient characteristics of the target sample, respectively.
[0120] It should be noted that the slope characteristics, undulation characteristics, and elevation variation coefficient characteristics of the target sample calculated in this invention can be obtained based on existing methods for calculating slope, undulation, and elevation variation coefficients. Other feature data can also be calculated; this embodiment is merely an illustrative example.
[0121] In one embodiment, the method further includes: constructing a micro-topography classification decision table based on the topographic location index feature, the profile curvature feature, the elevation variation coefficient feature, the slope feature, and the undulation feature.
[0122] In this embodiment, a micro-topography classification decision table can be constructed based on topographic location index features, profile curvature features, elevation variation coefficient features, slope features, and undulation features. There are several ways to construct the micro-topography classification decision table. For example, it can be set manually, and the decision method for different micro-topography can be set based on experience; or it can be determined by selecting the decision method with the best classification effect through a large number of experiments to determine the final micro-topography classification decision table.
[0123] In this embodiment, the optimal large TPI feature, profile curvature feature, and elevation variation coefficient were selected as classification decision feature factors for two types of micro-topography: mountain pass type and canyon wind tunnel type. The optimal large TPI feature, profile curvature feature, slope feature, and undulation feature were selected as classification decision feature factors for three types of micro-topography: high mountain watershed type, topographic uplift type, and atypical micro-topography. Specifically, taking the optimal large TPI classification threshold as an example, standardized TPI typically uses -1 and 1 as classification thresholds. These thresholds are commonly used for identifying mountain micro-topography. Setting the TPI classification thresholds to -0.8 and 0.8 is more suitable for the transmission line micro-topography identification of this invention, and the identification results are more accurate. The thresholds for other feature factors can also be set based on experiments and personal experience. The classification decision tables for feature extraction of mountain pass type and canyon wind tunnel type are shown in Table 1, and the decision tables for high mountain watershed type, topographic uplift type, and atypical micro-topography are shown in Table 2, as follows:
[0124] Table 1 Classification Decision Table for Pass Type and Canyon Windway Type
[0125]
[0126] Table 2 Classification Decision Table for Other Types of Micro-topography
[0127]
[0128] Step S103: Construct a sample feature dataset based at least on the terrain location index features and the profile curvature features, including:
[0129] S1031. Based on the feature values of the topographic location index feature, profile curvature feature, slope feature, undulation feature and elevation variation coefficient feature of the target sample, obtain the classification label of the target sample according to the micro-topography classification decision table.
[0130] S1032. Based on the feature values of the terrain location index feature, the profile curvature feature, the slope feature, the undulation feature, the elevation variation coefficient feature corresponding to the target sample, and the classification label, a sample point is constructed, and a sample feature dataset is constructed from several sample points.
[0131] In one embodiment, sample data can be constructed as follows:
[0132] P = (large TPI, slope, undulation, profile curvature, elevation variation coefficient, classification label), where the sample labels can be divided into 5 types: 4 typical micro-topography types and 1 atypical micro-topography type. The 4 typical micro-topography types are: high mountain watershed type, mountain pass type, canyon wind tunnel type and topographic lifting type.
[0133] In this embodiment, the classification label of the target sample can be obtained based on the constructed classification decision table. For example, the classification label of the target sample can be obtained based on the feature values of terrain location index features, profile curvature features, slope features, undulation features, and elevation variation coefficient features, according to the micro-topography classification decision tables in Tables 1 and 2 above.
[0134] If the obtained sample feature dataset is imbalanced, downsampling methods can be used to ensure class balance. Table 3 shows a portion of the sample points in the feature sample set. When splitting the dataset, 70% of the data is used as the training set to train the model, and 30% of the data is used as the test set to evaluate the model.
[0135] Table 3 Sample Point Example Table
[0136]
[0137] In one embodiment, the method further includes: constructing a parallelized random forest model, comprising:
[0138] S201. Construct several parallel decision trees for self-sampling and allocate the sample feature dataset required for training to each decision tree.
[0139] This embodiment can construct kernel functions to achieve GPU parallelization of the random forest model, and achieve GPU parallelization of the model through three CUDA kernel functions.
[0140] The kernel-1 function can be used to parallelize bootstrap sampling, allocating training set sample data required for training to each decision tree. Bootstrap sampling is a fundamental step in generating training sets for each decision tree in a random forest model.
[0141] Specifically, the original training set data can first be copied from the host memory to the GPU's global memory to ensure the GPU can quickly access this data. Then, a thread block can be allocated to each decision tree, and the threads within each block collectively generate the training set for one decision tree, allowing for simultaneous generation of training sets for multiple decision trees. Additionally, within each thread block, threads perform parallel sampling with replacement, randomly selecting samples from the original training set to construct a bootstrap sample set. These sample sets are used for subsequent decision tree training.
[0142] S202. Parallel training of several decision trees, each decision tree being constructed in parallel by an allocated thread.
[0143] This embodiment uses kernel-2 functions to achieve parallel training of decision trees, with each decision tree being built in parallel by its own allocated thread. Decision tree construction is the core part of training a random forest model. Since the training process of each decision tree is independent, it is suitable for parallel processing.
[0144] Specifically, for each thread block, the root node of the decision tree can be initialized based on the assigned bootstrap sample set. This process includes calculating the initial sample distribution and determining the initial state of the root node. At each node of the decision tree, multiple threads compute all possible split points in parallel and select the optimal split point. The selection of the split point is based on certain criteria (such as the Gini index or information gain), which measure the improvement in the purity of the node after the split. Child nodes can be generated based on the optimal split point, and the tree structure of each child node can be recursively constructed. This process continues until all nodes become leaf nodes or a preset stopping condition is reached.
[0145] S203. Parallelization of classification prediction: Parallel prediction of the micro-topography category of the sample points to be classified, and obtaining the final micro-topography category of the sample points through voting.
[0146] This embodiment uses a kernel-3 function to parallelize the classification prediction, allowing parallel prediction of the micro-topography category of the points to be classified. Finally, the final micro-topography category of the transmission line is obtained through voting. A schematic diagram of the parallel random forest model in this embodiment is shown below. Figure 4 As shown.
[0147] Specifically, a thread can be assigned to each sample to be predicted, and each thread is independently responsible for predicting one sample. This allocation method ensures that all samples can be processed simultaneously. Furthermore, each thread traverses all decision trees and summarizes the prediction results of each tree. Through parallel execution, each thread completes the prediction of all trees in a short time. A vote is held based on the prediction results of all trees, and the classification category of each sample is finally determined by the voting results. The majority voting method selects the category with the most votes as the final prediction result by counting the number of votes for each category.
[0148] In one embodiment, step S105, training a micro-terrain recognition model based on the sample feature data, includes:
[0149] S1051. Select a training set from the sample feature dataset;
[0150] S1052. Randomly draw samples with replacement from the training set to construct multiple sub-training sets;
[0151] A portion of the samples can be selected from the sample feature set as the training set and another portion as the test set for training and testing the micro-terrain recognition model.
[0152] For the parallelized random forest model that needs to be trained in this embodiment, samples can be randomly drawn with replacement from the training set (Bootstrap Sampling) to construct multiple sub-training sets, which are used to train each decision tree separately. Some samples may appear multiple times in a certain sub-training set, while some samples may be ignored.
[0153] S1053. Randomly select features from each sub-training set to train each decision tree.
[0154] It should be noted that a subset of features can be randomly selected from the sub-training set to construct the decision tree, instead of using all features, in order to increase the diversity of the model and reduce the risk of overfitting.
[0155] Alternatively, features can be randomly selected from each sub-training set to train the decision tree separately. During the decision tree construction process, the Gini impurity metric is used to select the best features for node splitting until a stopping condition is met (such as reaching the maximum depth max_depth or the minimum number of samples per node min_samples_leaf). The Gini impurity of a node can be calculated using the following formula:
[0156]
[0157] Where, p i is the proportion of samples in the i-th category, and C is the number of categories.
[0158] In this embodiment, the number of decision trees n_estimators in the parallel random forest model is set to 300.
[0159] In one embodiment, the method further includes: evaluating the recognition performance of the parallel random forest model.
[0160] The evaluation of the recognition performance of the parallel random forest model includes:
[0161] The recognition performance of the parallel random forest model is evaluated based on the recognition metrics of the parallel random forest model; the recognition metrics include one or more of the following: confusion matrix, classification accuracy, Kappa coefficient, precision for a single class, and recall.
[0162] This embodiment can evaluate the recognition performance of the parallel random forest model using one or more of the following: confusion matrix, classification accuracy, Kappa coefficient, single-class precision, and recall.
[0163] The confusion matrix is a two-dimensional matrix that analyzes the classification results predicted by the model. It is an intuitive representation of the difference between the true category and the category predicted by the classification model.
[0164] The classification accuracy of the model can be expressed as:
[0165]
[0166] In the formula, C ii This represents the total number of samples correctly classified for each category; there are N categories in total. This represents the total number of samples.
[0167] The Kappa coefficient is a statistical metric used to measure the consistency and accuracy of a classification task. It evaluates the performance of a classification model by comparing the consistency between the model's predictions and the actual observations. The Kappa coefficient can be expressed as:
[0168]
[0169] In the formula, r is the number of micro-topography categories; M is the total number of sample points involved in the calculation; x ii x represents the number of pixels in the i-th row and i-th column of the confusion matrix (i.e., the number of correctly classified pixels); i+ x +i These represent the total number of pixels in the i-th row and the i-th column, respectively.
[0170] Precision and Recall for a single class can be calculated as follows:
[0171]
[0172]
[0173] For a specific category i, TP is the number of samples correctly classified in that category, FP is the number of samples from other categories that are misclassified as that category, and FN is the number of samples from that category that are misclassified as other categories.
[0174] In this embodiment, a total of 40,960 sample points were selected to form the sample feature dataset, with 8,192 samples in each category. 70% of the sample feature dataset was selected as the training set, and the remaining 30% was selected as the test set. The evaluation results of the parallel random forest model are shown in Tables 4 and 5.
[0175] Table 4 Classification Confusion Matrix for Test Set
[0176]
[0177] Table 5 Classification Performance Evaluation
[0178]
[0179] In addition, the recognition efficiency of the parallel random forest model can be evaluated. Specifically, a large number of points to be identified can be selected from a large area of transmission lines, and these points can be identified using current methods (CPU) and parallel random forest models respectively. The recognition efficiency of the parallel random forest model can be evaluated by comparing the time consumption of the two methods. The results show that the recognition efficiency of the GPU parallel random forest model is significantly improved.
[0180] In this embodiment, 49 routes in the study area were selected for the experiment, with a total length of 1224.53 km. Then, 5×10 routes were selected sequentially from these routes. 5 1×10 6 5×10 6 1×10 7 5×10 7 The current methods (CPU) and GPU parallel random forest models are used to identify the points to be classified. The time taken (in seconds) for the two methods to identify the points to be classified is shown in Table 6 below.
[0181] Table 6 Comparison of recognition efficiency between CPU serial and GPU parallel random forest models
[0182]
[0183] The method based on embodiments of the present invention can obtain a parallel random forest model for large-scale transmission line micro-topography identification. For areas where transmission line micro-topography needs to be identified, various feature values of samples are calculated based on raster DEM data to form a dataset. The corresponding dataset is then input into the model to quickly achieve intelligent identification of transmission line micro-topography over a large area.
[0184] In the embodiments, the effectiveness of traditional methods and the method of the present invention in identifying two types of micro-topography, namely mountain passes and canyons, was compared. Figure 6 As shown, Figure 6The left-hand view in the middle is a schematic diagram illustrating the effect of traditional methods in identifying the micro-topography of mountain passes and canyons. Figure 6 The right-hand view shows the micro-topography effect obtained using the method of this invention. Six transmission lines were selected from the 49 transmission lines in the study area. The micro-topography identification results based on the model of this invention are shown in Table 7 below, and their classification results are as follows: Figure 7 As shown.
[0185] Table 7 Statistical analysis of micro-topography extraction results for transmission lines
[0186]
[0187] The micro-topography recognition model used in the embodiments of the present invention can effectively solve the problem of incomplete classification and greatly improve the recognition efficiency of micro-topography; and by optimizing the topographic location index features and profile curvature features, and through the decision table, it can quickly and effectively identify mountain pass type and canyon wind passage type micro-topography, and make the category boundary contour clearer.
[0188] Figure 8 A micro-terrain recognition device provided in an embodiment of the present invention includes:
[0189] The first feature acquisition unit 301 is used to find the optimal calculation window for the terrain location index based on the mean change point analysis method, and to acquire the terrain location index features of the target sample based on the optimal calculation window.
[0190] The second feature acquisition unit 302 is used to acquire the size of the neighborhood window when the average elevation deviation reaches a preset threshold based on the average elevation deviation statistically counted within the neighborhood window of the elevation points in the target sample, and to calculate the profile curvature feature based on the acquired neighborhood window size.
[0191] Data set construction unit 303 is used to construct a sample feature dataset based at least on the terrain location index features and the profile curvature features;
[0192] Training unit 304 is used to train a micro-terrain recognition model based on the sample feature data;
[0193] The identification unit 305 is used to input the elevation data of the area to be measured into the trained micro-topography identification model in order to identify the micro-topography of the area to be measured.
[0194] The message data processing resource scheduling device provided in the embodiments of the present invention can execute the message data processing resource scheduling device method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0195] Figure 9A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0196] like Figure 9 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0197] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0198] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a micro-terrain recognition method.
[0199] In some embodiments, a micro-topography identification method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the micro-topography identification method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a micro-topography identification method by any other suitable means (e.g., by means of firmware).
[0200] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0201] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0202] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0203] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0204] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0205] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0206] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0207] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A micro-topography identification method, characterized in that, include: The optimal calculation window for the terrain location index is found based on the mean change point analysis method, and the terrain location index features of the target sample are obtained based on the optimal calculation window. The method of finding the optimal calculation window for the terrain location index based on mean change point analysis, and obtaining the terrain location index features of the target sample based on the optimal calculation window, includes: The formula for calculating the Terrain Location Index (TPI) is as follows: Let i be the elevation value. The average elevation value is the value of all elevation points within the neighborhood of point i. Calculate the range values of the terrain location index under each window; Based on the range value of the terrain location index and the window size, the range value of the terrain location index per unit area is obtained; A data sequence is constructed based on the range values of the terrain location index corresponding to each window; The variance of the data sequence is calculated using the following formula: In the formula, For the data sequence The average value, i = 1, 2, 3, ..., N, where N is the number of windows used; Select in sequence The data sequence is divided into two subsequences by using this as a cutoff point. and , ; Calculate the sum of the variances of the two subsequences : In the formula, and Subsequences and The arithmetic mean; The difference between S and Si is calculated to obtain the resulting sequence. The cutoff point selected for the maximum value in the result sequence. The corresponding window is the optimal calculation window; The terrain location index features of the target sample are obtained based on the optimal calculation window; Based on the average elevation deviation statistically analyzed within the neighborhood window of elevation points in the target sample, the size of the neighborhood window when the average elevation deviation reaches a preset threshold is obtained, and the profile curvature feature is calculated based on the obtained neighborhood window size. Calculate the slope characteristics, undulation characteristics, and elevation variation coefficient characteristics of the target sample respectively; A micro-topography classification decision table is constructed based on the topographic location index features, the profile curvature features, the elevation variation coefficient features, the slope features, and the undulation features. Based on the feature values of the topographic location index feature, profile curvature feature, slope feature, undulation feature and elevation variation coefficient feature of the target sample, the classification label of the target sample is obtained according to the micro-topography classification decision table; A sample point is constructed based on the feature values of the terrain location index feature, the profile curvature feature, the slope feature, the undulation feature, and the elevation variation coefficient feature corresponding to the target sample, as well as the classification label. A sample feature dataset is constructed from several sample points. A micro-terrain recognition model is trained based on the sample feature data; The elevation data of the area to be measured is input into the trained micro-topography recognition model to identify the micro-topography of the area to be measured.
2. The micro-topography identification method according to claim 1, characterized in that, The step involves calculating the profile curvature feature based on the average elevation deviation statistically analyzed within a neighborhood window of elevation points in the target sample, obtaining the size of the neighborhood window when the average elevation deviation reaches a preset threshold, and calculating the profile curvature feature based on the obtained neighborhood window size, including: Calculate the average elevation deviation (DEV) within each neighborhood window of the elevation point sequentially: In the formula, It is the elevation value of a certain point; is the average elevation within the neighborhood; SD is the standard deviation of elevation within the neighborhood; n is the number of grid points within the neighborhood; These are grid points within the neighborhood; When the average elevation deviation (DEV) reaches a preset threshold, the profile curvature feature is calculated based on the neighborhood window size corresponding to the threshold.
3. The micro-topography identification method according to claim 1, characterized in that, The method also includes: Construct a parallelized random forest model; The construction of the parallelized random forest model includes: Construct several parallel decision trees for self-sampling, and allocate the sample feature dataset required for training to each decision tree; Parallel training of several decision trees, each decision tree is constructed in parallel by an allocated thread; The classification prediction is parallelized, predicting the micro-topography category of the sample points to be classified in parallel, and obtaining the final micro-topography category of the sample points through voting.
4. The micro-topography identification method according to claim 1, characterized in that, The training of the micro-terrain recognition model based on the sample feature data includes: Select a training set from the sample feature dataset; Samples are randomly drawn with replacement from the training set to construct multiple sub-training sets; Features are randomly selected from each sub-training set to train each decision tree.
5. The micro-topography identification method according to claim 3, characterized in that, Also includes: Evaluate the recognition performance of the parallelized random forest model; The evaluation of the recognition performance of the parallelized random forest model includes: The recognition performance of the parallelized random forest model is evaluated based on the recognition metrics of the parallelized random forest model. The identification metrics include one or more of the following: confusion matrix, classification accuracy, Kappa coefficient, precision for a single class, and recall for the parallelized random forest model.
6. A micro-terrain recognition device, characterized in that, include: The first feature acquisition unit is used to find the optimal calculation window for the terrain location index based on the mean change point analysis method, and to acquire the terrain location index features of the target sample based on the optimal calculation window. The first feature acquisition unit specifically includes: the calculation formula for the Terrain Location Index (TPI) is as follows: Let i be the elevation value. The average elevation value is the value of all elevation points within the neighborhood of point i. Calculate the range values of the terrain location index under each window; Based on the range value of the terrain location index and the window size, the range value of the terrain location index per unit area is obtained; A data sequence is constructed based on the range values of the terrain location index corresponding to each window; The variance of the data sequence is calculated using the following formula: In the formula, For the data sequence The average value, i = 1, 2, 3, ..., N, where N is the number of windows used; Select in sequence The data sequence is divided into two subsequences by using this as a cutoff point. and , ; Calculate the sum of the variances of the two subsequences : In the formula, and Subsequences and The arithmetic mean; The difference between S and Si is calculated to obtain the resulting sequence. The cutoff point selected for the maximum value in the result sequence. The corresponding window is the optimal calculation window; The terrain location index features of the target sample are obtained based on the optimal calculation window; The second feature acquisition unit is used to acquire the size of the neighborhood window when the average elevation deviation reaches a preset threshold based on the average elevation deviation statistically counted within the neighborhood window of the elevation points in the target sample, and to calculate the profile curvature feature based on the acquired neighborhood window size. The decision table construction unit is used to calculate the slope characteristics, undulation characteristics, and elevation variation coefficient characteristics of the target sample respectively; and to construct a micro-topography classification decision table based on the terrain location index characteristics, the profile curvature characteristics, the elevation variation coefficient characteristics, the slope characteristics, and the undulation characteristics. The dataset construction unit is used to obtain the classification label of the target sample based on the feature values of the topographic location index feature, the profile curvature feature, the slope feature, the undulation feature, and the elevation coefficient of variation feature of the target sample, according to the micro-topography classification decision table; and to construct a sample point based on the feature values of the topographic location index feature, the profile curvature feature, the slope feature, the undulation feature, and the elevation coefficient of variation feature corresponding to the target sample, as well as the classification label, and to construct a sample feature dataset from several sample points; The training unit is used to train a micro-terrain recognition model based on the sample feature data; The identification unit is used to input the elevation data of the area to be measured into the trained micro-topography identification model in order to identify the micro-topography of the area to be measured.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the micro-terrain recognition method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the micro-terrain recognition method according to any one of claims 1-5.
Citation Information
Patent Citations
Terrainfeature point extraction method based on double TPI parameters
CN109840447A
Special dangerous terrain recognition method and apparatus for forest fire
US20230342962A1