Urban tree species classification method, system and device
By optimizing the selection method for urban tree species classification within the red-edge spectral range, and utilizing UAV hyperspectral remote sensing imagery and machine learning models, the problem of low accuracy of classic vegetation indices in urban environments was solved, achieving high-precision vegetation extraction and tree species classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG SHUREN UNIV
- Filing Date
- 2026-03-30
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, classic vegetation indices cannot adapt to spectral interference from buildings, roads, and shadows in urban environments due to their fixed parameters, resulting in low accuracy in vegetation extraction and tree species classification.
By sampling candidate band sets within the red-edge spectral range, traversing dual-band combinations, calculating vegetation indices, and generating vegetation masks using multiple thresholds, combined with confusion matrix evaluation indicators, the optimal dual-band combination and its thresholds are selected, and urban tree species are classified using machine learning models.
It improves the accuracy of vegetation extraction and tree species classification, provides a high-quality data foundation, adapts to complex urban environments, and enables the selection of vegetation indices with high discriminative power.
Smart Images

Figure CN122049535A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tree species classification technology, specifically relating to a method, system and device for classifying urban tree species. Background Technology
[0002] With the acceleration of urbanization, urban residents are paying increasing attention to the pursuit of an ecologically livable environment, and the construction of ecological civilization is playing an increasingly prominent role in urban development. Trees in cities are located in densely populated urban areas with a high concentration of artificial landscapes, exhibiting a highly fragmented and unevenly distributed characteristic. In the fields of urban forest monitoring and tree species classification, accurate vegetation indices are crucial for effectively separating vegetated and non-vegetated areas from high-resolution remote sensing imagery, serving as a fundamental prerequisite for subsequent fine-grained classification.
[0003] Currently, existing technologies mainly rely on a series of classic, parameter-fixed vegetation indices for vegetation extraction, such as the Enhanced Vegetation Index (EVI), the Green Band Normalized Difference Vegetation Index (GNDVI), and the Soil-Adjusted Vegetation Index (SAVI). These indices are calculated using specific, empirical band combinations (such as red and near-infrared bands) and preset formulas. To improve the accuracy of vegetation extraction, existing technologies typically employ two improvement paths: one is to manually select or adjust the band combinations used to construct the indices from a limited spectral range based on expert experience; the other is to manually adjust the binarization segmentation threshold through repeated experiments on the initial results generated by the selected indices.
[0004] It is evident that classic vegetation indices (such as NDVI and EVI) using fixed band combinations in urban environments suffer from significant misclassification and omissions in vegetation extraction and tree species classification tasks due to their parameters being unable to adapt to the spectral interference from non-vegetation features such as buildings, roads, and shadows in complex urban environments. This results in low accuracy in tree species classification. Summary of the Invention
[0005] To address the problem of inaccurate classification of urban tree species using classic vegetation indices, this invention provides a method, system, and apparatus for classifying urban tree species.
[0006] A first aspect of this invention provides a method for classifying urban tree species, comprising the following steps: Acquire drone hyperspectral remote sensing images of urban research areas; Within the red-edge spectral range of the hyperspectral image, a set of candidate bands is obtained by sampling with a preset step size; Traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, generate a binary candidate vegetation mask using multiple preset candidate thresholds. Each candidate vegetation mask is compared with a pre-acquired real vegetation mask, a confusion matrix is constructed based on the comparison results, and a classification performance evaluation index for each candidate vegetation mask is calculated based on the confusion matrix. Based on the classification performance evaluation index, the optimal dual-band combination and its corresponding candidate threshold are determined from all dual-band combinations and the preset candidate threshold set; the vegetation index calculated from the optimal dual-band combination is determined as the final vegetation index. Based on the final vegetation index, urban tree species are classified and identified using a machine learning model.
[0007] Furthermore, the classification and identification of urban tree species based on the final vegetation index using a machine learning model includes the following steps: Based on the vegetation areas identified by the vegetation mask, various types of features are extracted from the hyperspectral image, including spectral features, vegetation index features, and texture features, wherein the vegetation index features include the final vegetation index. The extracted features of various types are filtered using a recursive feature elimination and cross-validation method to obtain a filtered feature subset. Based on the selected feature subset, a machine learning classification model is used to classify and identify the dominant tree species in urban forests.
[0008] Furthermore, the machine learning classification model is a random forest model.
[0009] Furthermore, the classification performance evaluation indicators include overall accuracy (OA) and the Kappa coefficient.
[0010] Furthermore, the spectral features are obtained by performing a minimum noise separation transformation on the hyperspectral image and selecting the first N bands containing the main information, where N is a positive integer; the vegetation index features include the modified normalized vegetation index, anthocyanin content index, chlorophyll index, vegetation attenuation index, ratio vegetation stress index, chlorophyll index, red-edge vegetation stress index, improved red-edge ratio vegetation index, structure-insensitive pigment index, plant pigment ratio, pigment-specific simple ratio, red-edge vegetation index ratio, and the final vegetation index; the texture features are obtained by calculating the gray-level co-occurrence matrix of the first principal component of the hyperspectral image and extracting second-order statistics including angular second moment, contrast, correlation, entropy, homogeneity, mean, difference, and variance.
[0011] Furthermore, the cross-validation method uses a random forest model as the evaluator to recursively eliminate features that contribute the least to the model, and evaluates the performance of the feature subset through cross-validation, ultimately selecting a specified number of vegetation index features and texture features.
[0012] Furthermore, after acquiring the hyperspectral image of the target area, the hyperspectral image is preprocessed. The data preprocessing includes: radiometric calibration, geometric correction, atmospheric correction, image stitching, spectral smoothing, and spatial resampling.
[0013] A second aspect of the present invention provides an urban tree species classification system, comprising: The acquisition module is used to acquire UAV hyperspectral remote sensing images of the study area and perform data preprocessing on the images; The sampling module is used to obtain a set of candidate bands by sampling within the red-edge spectral range of the hyperspectral image at a preset step size; The calculation module is used to traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, a binary candidate vegetation mask is generated using multiple preset candidate thresholds. The comparison module is used to compare each candidate vegetation mask with a pre-acquired real vegetation mask, construct a confusion matrix based on the comparison results, and calculate the classification performance evaluation index of each candidate vegetation mask based on the confusion matrix. The determination module is used to determine the optimal dual-band combination for classification performance evaluation and its corresponding candidate threshold from all dual-band combinations and the preset candidate thresholds based on the classification performance evaluation index; and to determine the vegetation index calculated from the optimal dual-band combination as the final vegetation index. The classification module is used to classify and identify urban tree species based on the final vegetation index using a machine learning model.
[0014] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0015] A fourth aspect of the present invention provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0016] The urban tree species classification method provided by this invention has the following beneficial effects: By limiting candidate bands to the red-edge spectral range, the red-edge region is identified as the key interval where vegetation spectral responses are most sensitive and distinguishable from non-vegetated areas. Limiting the optimization search space to this region ensures the method can fundamentally filter out the most indicative spectral information for complex urban environments, making it possible to obtain highly discriminative indices. Secondly, by traversing dual-band combinations and simultaneously testing multiple thresholds, a large number of candidate solutions are generated through joint optimization based on the confusion matrix index. This involves exhaustively enumerating all possible dual-band combinations and simultaneously and automatically testing a series of thresholds for each combination. Traditional methods rely on fixed index formulas and empirical thresholds, making them ill-suited to the complex spectral interference in urban scenarios. This approach transforms the selection of vegetation indices from subjective judgment based on expert experience to an objective science based on data performance, providing a high-quality data foundation for tree species classification. Attached Figure Description
[0017] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the urban tree species classification method in an embodiment of the present invention; Figure 2 This is a schematic diagram of the algorithm for obtaining the optimal vegetation index in an embodiment of the present invention. Figure 3 This is a schematic diagram of the reflectance of typical ground features in different hyperspectral bands in an embodiment of the present invention; Figure 4 This is a flowchart illustrating the tree species classification process using the final vegetation index in this embodiment of the invention. Figure 5 This is an actual vegetation mask diagram in an embodiment of the present invention; Figure 6 This is the optimal vegetation mask diagram in the embodiments of the present invention; Figure 7 This is a combined display of the actual vegetation mask and the optimal vegetation mask in an embodiment of the present invention. Figure 8 This is a schematic diagram of the tree species identification results in an embodiment of the present invention, wherein, Figure 8 (a) is a masked image of the actual tree species. Figure 8 (b) is an overlay image of the actual tree species mask and RGB bands. Figure 8 (c) shows the results for typical tree species; Figure 9 This is a schematic diagram illustrating the vegetation information extraction results under different vegetation indices in an embodiment of the present invention, wherein, Figure 9(a) is a schematic diagram showing the vegetation information extraction results under different vegetation indices in the shaded area. Figure 9 (b) is a schematic diagram showing the results of vegetation information extraction under different vegetation indices in the building area. Figure 9 (c) is a schematic diagram showing the vegetation information extraction results under different vegetation indices in areas with low light. Figure 9 (d) is a schematic diagram showing the vegetation information extraction results under different vegetation indices in the debris area. Figure 9 (e) is a schematic diagram of the vegetation information extraction results under different vegetation indices in the lawn and shrub area. Detailed Implementation
[0019] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.
[0020] Utilizing the sensitivity of red-edge regions to changes in chlorophyll content, changes in vegetation health can be detected earlier. However, obtaining the optimal "red-edge" vegetation index is a crucial foundation. This invention provides an urban tree species classification method, such as... Figure 1 As shown:
[0021] S1. Acquire UAV hyperspectral remote sensing images of the urban study area.
[0022] S2. Within the red-edge spectral range of the hyperspectral image, a set of candidate bands is obtained by sampling with a preset step size.
[0023] S3. Traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, generate a binary candidate vegetation mask using multiple preset candidate thresholds.
[0024] S4. Compare each candidate vegetation mask with the pre-acquired real vegetation mask, and calculate the classification performance evaluation index of each candidate vegetation mask based on the confusion matrix.
[0025] S5. Based on the classification performance evaluation index, select the pair with the best classification performance evaluation index from all pairs of dual-band combinations and candidate thresholds; wherein, the vegetation index defined by the dual-band combination in the best pair is the best vegetation index obtained through joint optimization of the present invention, and the candidate threshold in the best pair is the best segmentation threshold.
[0026] S6. Based on the final vegetation index, classify and identify urban tree species using a machine learning model.
[0027] Specifically, such as Figure 2 As shown, the process for obtaining the optimal vegetation index is as follows: 1) After numbering the bands within the red border sequentially, sample them with a step size of 5nm to form a set of candidate bands (from 680nm to 750nm).
[0028] 2) Exhaustively enumerate all possible dual-band combinations in the set to calculate the corresponding vegetation index.
[0029] 3) To fairly compare the performance of each vegetation index, for each vegetation index, we iterated through empirical thresholds of 0.1, 0.125, 0.15, 0.2, and 0.3, calculating the classification result mask at each threshold and the vegetation area mask labeled in the actual scene. real By comparing the results, we can obtain the maximum intersection-union ratio (IOU). best .
[0030] 4) The process is based on manually annotated truth maps. The overall accuracy and Kappa coefficient are calculated through confusion matrix to determine the accuracy and corresponding optimal threshold. The optimal threshold is determined by maximizing the overall accuracy and Kappa coefficient, thereby selecting the band combination with the best performance.
[0031] In this invention, the final vegetation index and the optimal segmentation threshold are jointly determined through a joint optimization process. The superiority of the final vegetation index lies in the fact that it achieves the highest vegetation extraction accuracy when using its corresponding optimal segmentation threshold. Together, they constitute a complete, ready-to-use vegetation extraction solution.
[0032] Based on the above-mentioned inventive concept, this invention proposes an embodiment that uses the final vegetation index for tree species classification, such as... Figure 4 As shown, the method specifically includes the following steps: S1. Data Acquisition and Preprocessing.
[0033] S1.1 Remote Sensing Data Sources and Preprocessing: This invention utilizes a drone for data acquisition. The drone is equipped with an RTK (Real-Time Kinematic) module to ensure high-precision positioning. Images are acquired using a Specim AFX10 high-resolution hyperspectral camera, capturing images across 224 bands with a spatial resolution of 0.035 meters (at a flight altitude of 50 meters). Key parameters are shown in Table 1.
[0034] Table 1: Specifications of the Specim AFX10 The UAV employs a flight path mode (automatically navigating according to pre-set waypoints / routes) and an equidistant photo-taking mode to ensure efficient image acquisition. This invention uses ENVI 6.1 to perform radiometric calibration, geometric correction, and atmospheric correction on the original hyperspectral imagery, followed by stitching and cropping. The Smooth function is used to smooth the hyperspectral data, aiming to reduce noise and make the data easier to analyze and interpret. Since the processed hyperspectral imagery still contains a large amount of data, a nearest neighbor method is used for resampling, adjusting the pixel spatial resolution to 0.10 meters. This reduces the complexity of data processing while maintaining data quality.
[0035] S1.2 Field Data Survey: The study area is rich in tree species resources, mainly evergreen broad-leaved trees, including loquat, dawn redwood, podocarpus, loropetalum, albizia, magnolia, osmanthus, pine, tallow tree, camphor tree, camellia, maple, and red-leaf plum. However, some tree species are few in number and have small crowns. Taking into account the number of each tree species and the size of the crowns, the dominant tree species for urban forests in this invention were determined to be: albizia, magnolia, osmanthus, pine, loquat, tallow tree, and camphor tree.
[0036] S1.3 Vegetation Extraction: To remove spectral interference from non-vegetated areas, this invention employs vegetation indices to extract vegetation and analyzes the spectral reflectance of typical land cover to construct suitable vegetation indices. This invention manually selects regions of interest (ROIs) on UAV hyperspectral imagery and analyzes the spectral reflectance curves of typical land cover. Considered land cover types include various vegetation types, including tree canopies, shrubs, and lawns, as well as non-vegetated types such as buildings, bare soil, basketball courts, and roads, specifically... Figure 3 As shown.
[0037] Figure 3 Significant differences exist between the spectral curves of vegetation and non-vegetation features. All vegetation types (including trees, shrubs, and lawns) exhibit typical green vegetation spectral characteristics, particularly displaying a distinct "two valleys and one peak" pattern.
[0038] 1) The first absorption valley is located around 490nm, and the reflectivity is low and changes gradually in the 400-500nm range; 2) As the wavelength increases to around 550nm, the first distinct green reflection peak forms due to the strong reflection band of chlorophyll; 3) A second absorption valley ("red valley") forms in the 670-680nm range. This region has the highest photosynthetic efficiency and the lowest reflectance due to the strong absorption of chlorophyll. 4) In the 680-750nm range, reflectivity increases sharply with wavelength, forming a distinct reflection slope, a phenomenon known as the "red edge effect." Within this range, the reflectivity of vegetation areas increases significantly more than that of non-vegetated areas, thus enabling a clear distinction between vegetation and non-vegetated areas.
[0039] In hyperspectral imaging, the traditional red-edge vegetation index formula usually refers to the Normalized Difference Red Edge Index (NDRE), which is expressed as follows: NDRE= ; in, NIR The reflectivity is in the near-infrared band; Red Edg e represents the reflectivity in the red-edge band (typically in the 700–750 nm range).
[0040] After obtaining the vegetation index, validation was performed, and the pair with the best classification performance evaluation index was selected: like Figure 5 , Figure 6 , Figure 7 As shown, green represents the actual mask, red represents the optimal vegetation index mask, and white represents the intersection. Based on the experimental results obtained from the optimal vegetation index according to this invention, the combination of 690nm and 748nm performs optimally at a threshold of 0.125, achieving an overall accuracy (OA) of 96.54% and a Kappa coefficient of 0.9407. The formula is expressed as follows: NDVI best = ; NDVI best The optimal vegetation index is represented by 748, where 748 represents the wavelength in the 748nm band and 690 represents the wavelength in the 690nm band.
[0041] S1.4, Feature Extraction and Selection of UAV Hyperspectral Data: Feature band selection: Raw hyperspectral remote sensing images are characterized by a large number of bands and a certain degree of correlation between them, resulting in information redundancy. Processing all band features is not only time-consuming, but the excessive redundant information can also affect classification accuracy. The purpose of feature band selection is to reduce the dimensionality of the raw hyperspectral data, and the reduced data should improve classification performance or maintain the same performance. This invention uses Minimum Noise Fraction (MNF) to extract the main information and minimize noise in order to select feature bands.
[0042] Experimental results: The first 9 bands after MNF transformation contain the main information (reaching 95% energy contribution).
[0043] S1.5, Feature Factor Selection: This invention uses multiple feature factors, including selected feature bands, vegetation index features, texture features, and other feature factors. After inputting these feature factors into the classification model, tree species types can be accurately distinguished. Feature factor selection plays a crucial role in tree species identification. Some studies have shown that redundant feature factors negatively impact the performance and stability of the classification model. Therefore, it is necessary to optimize and reduce the number of features by eliminating irrelevant feature factors. Recursive Feature Elimination with Cross-Validation (RFECV) is a method in machine learning used to optimize feature factor selection. It recursively removes features that contribute the least to the model and applies cross-validation at each step to evaluate the performance of the feature subset, thereby improving the model's generalization ability. Its basic principle is as follows:
[0044] (1) Initial model fitting: The algorithm first fits the model on the entire feature factor set. Record the model's performance metrics, such as accuracy, mean squared error, or other relevant metrics.
[0045] (2) Feature Factor Importance Ranking: After initial fitting, the algorithm ranks the feature factors according to their importance. The specific metric used for ranking depends on the chosen machine learning algorithm. For example, in tree-based models such as random forests, Gini impurity or information gain can be used to determine the importance of feature factors.
[0046] (3) Feature factor elimination: Remove the least important feature factors from the feature factor set.
[0047] (4) Model refitting: Refit the model using the reduced feature factors. Record the model performance metrics again.
[0048] (5) Iteration: Repeat steps (2) to (4) until the required number of feature factors is reached or the model performance tends to stabilize.
[0049] This invention uses RFECV to select feature factors, and based on their importance, identifies 9 vegetation index feature factors and 5 texture feature factors. The vegetation index feature factors include MNDVI705, ACI, CI-G, R2, CI-RE, PSSR1, PSSR2, VOG1, PPR, and the features of this algorithm. Texture feature factors include contrast, entropy, mean, variability, and variance.
[0050] Random Forest (RF) and Support Vector Machine (SVM) are existing algorithms and will not be elaborated upon here. Both methods are widely used in hyperspectral image research. Although SVM is the simplest form of binary classifier, it can act as a multi-class classifier by combining several binary SVM classifiers, i.e., using a one-to-one classification approach, designing one SVM between any two classes of samples. Therefore, for n classes of samples, n(n-1) / 2 SVMs are needed. When classifying an unknown sample, the class with the most votes is the class of the unknown sample.
[0051] S1.6 Tree species identification results and accuracy evaluation: Field-labeled tree species masks are created by manually collecting data in the field and precisely outlining the contours of individual trees or tree species on the image, forming pixel-level marked regions used to distinguish different tree species. They are primarily used to provide high-quality "ground truth" data for subsequent tree species classification model training and accuracy verification. Figure 8 As shown.
[0052] In the case of high-resolution images and mixed pixels in training samples, the ensemble learning mechanism of random forests makes them significantly better than support vector machines in adapting to complex urban environments.
[0053] Classification accuracy refers to the degree to which pixels in a classified image are correctly classified. There are two main methods for evaluating accuracy: confusion matrix and ROC curve. This invention chooses the confusion matrix method for accuracy evaluation. The confusion matrix is a statistical square matrix where each column represents the object to be classified, and the total number in each column represents the total number of objects to be classified into that category; each row represents the true category of the data, and the total number of data in each row represents the total number of true samples in that category. Specifically, the following key indicators are used.
[0054] S1.6.1. Overall Accuracy (OA): OA represents the sum of correctly classified cells divided by the total number of cells. The number of correctly classified cells is distributed along the diagonal of the confusion matrix, and the total number of cells equals the total number of cells from all true reference sources. It reflects the proportion of true classes that were not missed.
[0055] ; in represents the elements on the diagonal of the error matrix (i.e., the number of correctly classified pixels), N is the total number of pixels, and k is the number of categories.
[0056] S1.6.2. Producer's Accuracy (PA): PA refers to the ratio of the number of pixels in the entire image that the classifier correctly classifies into a certain class to the total number of true references for that class, corresponding to the omission error.
[0057] ; in Let i be the number of correctly classified elements in class i. k This represents the number of categories.
[0058] S1.6.3. User Accuracy (UA): UA refers to the ratio of the total number of pixels correctly classified into a certain class to the total number of pixels in the entire image that the classifier classifies into that class, corresponding to the misclassification error.
[0059] ; Where in the formula This represents the total number of pixels classified as class i.
[0060] UA focuses on "whether the prediction results are reliable", reflecting the credibility of the classification model's prediction results.
[0061] S1.6.4. Kappa coefficient: The Kappa coefficient is a comprehensive indicator for evaluating classification accuracy.
[0062] ; Where P is in the formula o P is the observed uniformity probability. e This represents the expected probability of consistency.
[0063] Experimental verification: The experimental procedure steps of this invention are as follows: (1) After acquiring remote sensing data, based on data preprocessing, spectral analysis is performed on the hyperspectral image, and high-precision vegetation index (NDVI) is automatically obtained through spectral analysis. (690,748) This allows for the differentiation between vegetation and non-vegetation, and comparisons with common vegetation indices.
[0064] (2) Feature extraction is performed using hyperspectral images, including feature bands, vegetation index features and texture features.
[0065] (3) Feature factor screening of the extracted features. The RFECV method is used to iteratively remove the least important feature factors based on their contribution to model performance, and then combine the extracted feature factors.
[0066] (4) Classify the trees according to the feature combination form using random forest and support vector machine models to generate accurate classification results, and analyze the impact of feature combination on the classification of urban forest tree species.
[0067] To accurately evaluate the performance of vegetation indices in extracting vegetation from UAV hyperspectral imagery, a threshold-based classification method was used to generate vegetation images, and commonly used vegetation indices EVI, GNDVI, NDVI, SVI, and NDVI were applied. (690,748) A comparison is made, as shown in Table 4. To determine the optimal classification threshold for each vegetation index, this invention selects typical empirical thresholds as a candidate threshold set. For each vegetation index, the confusion matrix under each candidate threshold is calculated, and the corresponding classification performance index is evaluated. Finally, the threshold with the highest overall accuracy is selected as the optimal threshold for that vegetation index, as shown in Table 5. In the binarized vegetation image, pixels representing vegetated areas are set to green, and non-vegetated areas are set to black to visually display the results of vegetation information extraction. Consistent with the previous analysis, five target areas within the study area were selected to represent different types of land cover for comparison. These areas include shaded areas, building areas, dimly lit areas, debris areas, and lawn / shrub areas. The vegetation information extraction results under different vegetation indices are shown in Table 5. Figure 9 As shown.
[0068] Table 4: Comparison of Vegetation Indices Table 5: Optimal Vegetation Index Thresholds Binarized images of each vegetation index provide a visual reference for assessing the accuracy of vegetation information extraction. Figure 9 In (a), neither EVI nor SVI effectively removes the interference of shadows, treating the shadowed areas as vegetation areas. Figure 9 (b) In this case, the EVI treats some building areas as vegetated areas, while other vegetation indices can effectively distinguish between buildings and vegetation. Figure 9 In (c), GNDVI fails to extract vegetation effectively in low-light areas, while SVI misclassifies green tiles as vegetation areas. Figure 9 (d) except for NDVI (680,748) Apart from vegetation indices, other vegetation indices cannot completely distinguish between debris and vegetated areas. Figure 9 In (e), EVI, GNDVI, and NDVI all distinguish vegetation under the shade as non-vegetation.
[0069] To quantitatively assess the accuracy of each vegetation index, this invention uses the confusion matrix method to evaluate its accuracy in the experimental area, as shown in Table 6.
[0070] Table 6: Accuracy Evaluation of Vegetation Index The table shows that the overall accuracy of these vegetation indices is above 90%, indicating high vegetation extraction accuracy. Compared with other vegetation indices, SVI has the highest accuracy among producers in vegetation categories, reaching 98.70%, but the lowest accuracy among users, at only 86.22%. EVI has the lowest accuracy among producers in non-vegetation categories, at only 84.98%. NDVI has an overall accuracy of 94.68% and a kappa coefficient of 0.88, indicating that it has good vegetation extraction accuracy. (690,748) It exhibits the highest vegetation extraction accuracy, with an overall accuracy of 96.54% and a kappa coefficient of 0.93, indicating that the NDVI in this study area is high. (690,748) It performed well. Overall, the NDVI in this study area... (690,748) Outperforming other vegetation indices, NDVI is superior in comparison. (690,748) It has better classification accuracy, while EVI has poorer classification accuracy.
[0071] Tree species classification experiment: In this invention, three different sets of feature variables were extracted to evaluate their effectiveness in tree species classification tasks. To systematically evaluate the impact of different features and classifiers on tree species classification performance, three schemes were designed: feature bands, feature bands + vegetation index, and feature bands + vegetation index + texture features. Random forest and support vector machine were combined for classification. The specific schemes are shown in Table 7.
[0072] Table 7: Tree Species Identification Scheme Based on the above inventive concept, the present invention also provides an urban tree species classification system, comprising: The acquisition module is used to acquire UAV hyperspectral remote sensing images of the study area and perform data preprocessing on the images.
[0073] The sampling module is used to obtain a set of candidate bands by sampling within the red-edge spectral range of the hyperspectral image at a preset step size.
[0074] The calculation module is used to traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, a binary candidate vegetation mask is generated using multiple preset candidate thresholds.
[0075] The comparison module is used to compare each candidate vegetation mask with a pre-acquired real vegetation mask, construct a confusion matrix based on the comparison results, and calculate the classification performance evaluation index of each candidate vegetation mask based on the confusion matrix.
[0076] The determination module is used to determine the optimal dual-band combination and its corresponding candidate threshold from all dual-band combinations and preset candidate thresholds based on the classification performance evaluation index; and to determine the vegetation index calculated from the optimal dual-band combination as the final vegetation index.
[0077] The classification module is used to classify and identify urban tree species based on the final vegetation index using a machine learning model.
[0078] This invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, memory, and non-volatile memory, and may also include other hardware required for various operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then executes it to achieve the above-mentioned functions. Figure 1 The steps for providing a method for classifying urban tree species.
[0079] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, etc.) containing computer-usable program code.
[0080] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, systems, and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0083] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the patent of the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for classifying urban tree species, characterized by, Includes the following steps: Acquire drone hyperspectral remote sensing images of urban research areas; Within the red-edge spectral range of the hyperspectral image, a set of candidate bands is obtained by sampling with a preset step size; Traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, generate a binary candidate vegetation mask using multiple preset candidate thresholds. Each candidate vegetation mask is compared with a pre-acquired real vegetation mask, a confusion matrix is constructed based on the comparison results, and a classification performance evaluation index for each candidate vegetation mask is calculated based on the confusion matrix. Based on the classification performance evaluation index, the optimal dual-band combination and its corresponding candidate threshold are determined from all dual-band combinations and the preset candidate threshold set; the vegetation index calculated from the optimal dual-band combination is determined as the final vegetation index. Based on the final vegetation index, urban tree species are classified and identified using a machine learning model.
2. The method of claim 1, wherein, The process of classifying and identifying urban tree species using a machine learning model based on the final vegetation index includes the following steps: Based on the vegetation areas identified by the vegetation mask, various types of features are extracted from the hyperspectral image, including spectral features, vegetation index features, and texture features, wherein the vegetation index features include the final vegetation index. The extracted features of various types are filtered using a recursive feature elimination and cross-validation method to obtain a filtered feature subset. Based on the selected feature subset, a machine learning classification model is used to classify and identify the dominant tree species in urban forests.
3. The method according to claim 1, characterized in that, The machine learning classification model is a random forest model.
4. The method according to claim 1, characterized in that, The classification performance evaluation indicators include overall accuracy (OA) and the Kappa coefficient.
5. The method according to claim 2, characterized in that, The spectral features are obtained by performing a minimum noise separation transformation on the hyperspectral image and selecting the first N bands containing the main information, where N is a positive integer. The vegetation index features include the modified normalized vegetation index, anthocyanin content index, chlorophyll index, vegetation attenuation index, ratio vegetation stress index, chlorophyll index, red-edge vegetation stress index, improved red-edge ratio vegetation index, structure-insensitive pigment index, plant pigment ratio, pigment-specific simple ratio, red-edge vegetation index ratio, and the final vegetation index. The texture features are obtained by calculating the gray-level co-occurrence matrix of the first principal component of the hyperspectral image and extracting second-order statistics including angular second moment, contrast, correlation, entropy, homogeneity, mean, difference, and variance.
6. The method according to claim 2, characterized in that, The cross-validation method uses a random forest model as the evaluator, recursively removes features that contribute the least to the model, and evaluates the performance of the feature subset through cross-validation, ultimately selecting a specified number of vegetation index features and texture features.
7. The method according to claim 1, characterized in that, After acquiring the hyperspectral image of the target area, the hyperspectral image is preprocessed. The data preprocessing includes: radiometric calibration, geometric correction, atmospheric correction, image stitching, spectral smoothing, and spatial resampling.
8. A classification system for urban tree species, characterized in that, include: The acquisition module is used to acquire UAV hyperspectral remote sensing images of the study area and perform data preprocessing on the images; The sampling module is used to obtain a set of candidate bands by sampling within the red-edge spectral range of the hyperspectral image at a preset step size; The calculation module is used to traverse all dual-band combinations in the candidate band set and calculate the vegetation index corresponding to each dual-band combination; for each dual-band combination and its calculated vegetation index value, a binary candidate vegetation mask is generated using multiple preset candidate thresholds. The comparison module is used to compare each candidate vegetation mask with a pre-acquired real vegetation mask, construct a confusion matrix based on the comparison results, and calculate the classification performance evaluation index of each candidate vegetation mask based on the confusion matrix. The determination module is used to determine the optimal dual-band combination for classification performance evaluation and its corresponding candidate threshold from all dual-band combinations and the preset candidate thresholds based on the classification performance evaluation index; and to determine the vegetation index calculated from the optimal dual-band combination as the final vegetation index. The classification module is used to classify and identify urban tree species based on the final vegetation index using a machine learning model.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7.
10. A computer device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 7.