NDVI weighted attention-based sparse forest land individual tree segmentation method and system
By constructing a single tree segmentation method in sparse woodlands based on NDVI weighted attention, and adopting the U2NET nested architecture and Manhattan self-attention mechanism, the problems of edge fuzziness and computational complexity of tree segmentation in sparse woodlands are solved, and efficient and precise tree monitoring is achieved.
Patent Information
- Application Number
- CN202511123592.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing technologies make it difficult to efficiently and precisely detect tree distribution, coverage and carbon storage in sparse woodlands. Traditional algorithms have omissions and misjudgments in spatial morphology and spectral characteristics. Deep learning models have contradictions in computational complexity and feature adaptability, and there is a lack of special labeled data for sparse woodlands.
A sparse woodland single tree segmentation method based on NDVI weighted attention is adopted. By constructing a U2NET nested architecture, Manhattan self-attention mechanism and NDVI weighted decomposition sub-module, combined with multi-scale feature fusion and residual nested structure, the model's segmentation ability for sparse woodlands is enhanced.
It effectively solves the edge fuzzy problem of tree segmentation in sparse woodlands, improves the target focusing ability and computational efficiency of the model in complex backgrounds, enhances the modeling ability of irregular tree distribution, and improves the stability and accuracy of single tree monitoring.
Smart Images

Figure CN120635467A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of remote sensing, geographic information and ecology, and in particular to a method and system for segmenting single trees in sparse woodlands based on NDVI weighted attention. Background Art
[0002] Sparse woodland resources are widely distributed in various regions of the world and are crucial for regulating terrestrial net primary productivity and the terrestrial carbon cycle. Current tree monitoring systems often overlook trees in sparse woodlands, and information on the distribution, coverage, carbon storage, and other aspects of these trees remains unclear. Because sparse woodland trees grow in isolation and vary greatly in size and density, our understanding of them is limited to small-scale sampling or field surveys, which are labor-intensive and highly uncertain, making it difficult to conduct large-scale, precise quantitative testing of sparse woodland trees. There is an urgent need for methods to segment individual trees in sparse woodlands and to re-examine the important role of sparse woodland trees in the global carbon cycle and even the entire climate system.
[0003] With continuous breakthroughs in remote sensing technology across spatial, temporal, and spectral dimensions, high-resolution imagery has provided an unprecedented data foundation for forest resource monitoring, particularly in canopy cover analysis of large-scale natural and planted forests, where a mature technical paradigm has emerged. However, this technical system faces a dual dilemma in sparse woodland scenarios: from a spatial morphological perspective, trees in sparse woodlands often exist as tiny targets (such as individual trees or low-density clusters). Their isolated and fragmented distribution contrasts sharply with the continuous canopy cover of natural forests, rendering the spatial feature extraction mechanisms such as texture and shape that traditional algorithms rely on ineffective. Furthermore, the interlaced distribution of background vegetation (such as shrubs and grasslands) in heterogeneous surface environments such as mountains and urban green belts further exacerbates target confusion, resulting in a large number of missed detections and misjudgments in classic methods based on threshold segmentation or morphological operations. From the perspective of spectral characteristics, the canopy signal of sparse woodlands is easily disturbed by the dynamics of understory vegetation (such as seasonal withering and flourishing, soil exposure). Especially in multispectral or hyperspectral images, the mixed pixel effect of exposed surface and low vegetation significantly weakens the distinguishability of tree spectral characteristics. The spectral similarity between artificial green vegetation (such as street trees and landscape shrubs) and natural sparse woodlands in the process of urbanization increases the risk of false target identification.
[0004] To address these challenges, deep learning technology, with its multi-level feature abstraction and nonlinear modeling capabilities, has gradually become a core research direction for sparse woodland information extraction. Basic semantic segmentation models (such as U-Net and DeepLab series) achieve pixel-level classification through an encoder-decoder architecture. Their multi-scale feature fusion mechanism can effectively capture the spatial contours of small targets. However, dense background noise (such as bare rock in mountains and building shadows) can easily interfere with shallow features through skip connections, resulting in blurred classification boundaries. To enhance global context perception, attention-driven methods (such as the Transformer-CNN hybrid model) use spatial attention modules to locate the spatial distribution patterns of discrete targets and combine channel attention to filter spectral discriminative features, significantly improving target focusing capabilities in complex scenes. However, the computational complexity of the multi-head self-attention mechanism conflicts with the high-resolution characteristics of remote sensing imagery, restricting its application in regional image analysis. Lightweight models (such as MobileNet and the improved GhostNet framework) reduce computational overhead through depthwise separable convolutions and feature channel pruning. However, this compression of model capacity can weaken sensitivity to small targets (e.g., individual trees with a diameter less than 5 pixels) in sparse forest scenes, and can also reduce feature adaptability when migrating across regions due to geographical differences. Self-supervised learning (e.g., contrastive learning and masked image modeling) attempts to extract intrinsic representational patterns of the canopy from unlabeled data, reducing reliance on manual labeling by constructing pre-training tasks (e.g., jigsaw puzzle restoration and spectral channel prediction). However, there remains a gap in semantic alignment between these unsupervised features and downstream tasks (e.g., forest / non-forest land classification), resulting in high misclassification rates between understory vegetation and target tree canopies in the extracted results.
[0005] The current technical route highlights three contradictions: first, the difficulty of balancing model complexity and computational efficiency. High-precision models (such as Transformer-based architectures) can hardly meet the real-time processing requirements of edge computing devices; second, the conflict between local detail preservation and global context modeling. Lightweight models are prone to lose edge information of small targets, while the global attention mechanism may weaken the discriminability of local features; third, the contradiction between the data dependence of supervised learning and the cost of labeling sparse woodlands. Existing labeled datasets (such as iNaturalist and DeepForest) mostly focus on dense forest areas and lack special labeling specifications for sparse scenes. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the present invention provides a sparse woodland single tree segmentation method based on NDVI weighted attention, comprising the following steps: Step 1: Collect high-resolution remote sensing images of the sparse woodland study area, create a dataset containing image-label-NDVI image arrays of individual trees in the sparse woodland, and divide it into training set, test set, and validation set; Step 2: Construct a single tree segmentation network model for sparse woodland based on NDVI weighted attention; Step 3: Use the training set, validation set, and test set to train, adjust hyperparameters, and evaluate the generalization ability of the sparse forest single tree segmentation network model constructed in step 2; Step 4: Use the trained sparse forest single tree segmentation network model to perform single tree segmentation.
[0007] Furthermore, the high-resolution remote sensing images collected in step 1 are cropped into Multiple image blocks of different sizes are collected and manually labeled. Each image block contains several manually labeled tree labels. The NDVI value of each image block is then calculated to create a dataset of image-label-NDVI image arrays of single trees in sparse woodlands.
[0008] Furthermore, the sparse forest single tree segmentation network model based on NDVI weighted attention in step 2 consists of 8 RSU modules and 3 RSU-4F modules. The 8 RSU modules are defined as 4 Module and 4 Module, m represents the number of downsampling times, and n represents the number of upsampling times. Each RSU module uses a progressive gradient descent method, and each RSU-4F module uses a progressive dilated convolution method. Each RSU module and RSU-4F module draws on the idea of the UNet-style encoding-decoding structure.
[0009] Remote sensing images first pass through four module, then passes through 3 RSU-4F modules in sequence, and finally passes through 4 Module, each 、 The output feature vectors of the RSU-4F module and the RSU-4F module are skip-connected to obtain 6 feature vectors composed of shallow features and deep features. The output value of the network is normalized by adding the Sigmoid function to obtain the probability of each pixel belonging to a tree. The specific processing flow is as follows: Input the remote sensing image into the first After the module, it first passes through two consecutive CBR layers (CBR layer consists of convolution layer, batch normalization layer and ReLU activation function layer), then passes through the NWD submodule, and uses m-1 consecutive mCBR layers (mCBR layer is a downsampling layer composed of a maximum pooling layer after the CBR layer, and the downsampling rate is set to 1 / 2 each time) for downsampling, and then passes through a CBRD layer (CBRD layer is a CBR layer with 2 DAfter the dilated convolution), continue to use n-1 consecutive nCBR layers (nCBR layer is an upsampling layer composed of an interpolate function after the CBR layer, and the upsampling rate is set to 2 each time) for upsampling, and finally jump connect the two CBR layers to the n-1th nCBR layer respectively, and connect the m-1th mCBR layers to the m- i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module. Four The m of the modules are 6, 5, 4, and 3, and the n are 7, 6, 5, and 4. The input of the module is the previous The module outputs the feature vector, and the four The modules have the same structure. The number of input and output channels of the module are [4,64], [64,128], [128,256], and [256,512] respectively.
[0010] Among them, the NWD submodule inputs the feature vector output by the CBR layer into three deep convolutional layers in sequence, performs attention weighting on the feature pixels output by each deep convolutional layer, and then splices the feature pixels after attention weighting to obtain the hierarchical context representation of different receptive fields as the output of the NWD submodule. The attention weighting calculation method for the three aspects of outer contour edge pixels, inner contour edge pixels and internal pixels is as follows: (2) (3) (4) Where, and are the number of outer contour and inner contour pixels considered, For the i NDVI value of the outer contour pixel, For the j NDVI value of the inner contour pixel, is the average NDVI value of the internal tree pixels, is the average NDVI value of background non-tree pixels, Softmax is the normalized exponential function, 、 、 Represent the outer contour edge, inner contour edge, and internal pixel decomposition attention weights respectively.
[0011] The fourth The feature vector output by the module is input into the first RSU-4F module, first passing through two consecutive mCBR layers, then passing through the MSA submodule, using 5 consecutive dilated convolution CBRD layers, 2 D The D values in the RSU-4F module are set to 2, 4, 8, 4, and 2, respectively. Finally, the module passes through an mCBR layer. Two consecutive mCBR layers are skip-connected to the last mCBR layer. The first CBRD layer is skip-connected to the fifth CBRD layer, and the second CBRD layer is skip-connected to the fourth CBRD layer. The final results are summed to obtain the output feature vector of the first RSU-4F module, which serves as the input to the second RSU-4F module. The structure of the MSA submodule is as follows: the feature vector output by the mCBR layer first passes through a depthwise separable convolutional layer, then a normalization layer, and then inputs into the Manhattan self-attention mechanism. Finally, it passes through a normalization layer and is input into a depthwise separable convolutional layer. The inputs of the second and third RSU-4F modules are the feature vectors output by the previous RSU-4F module. All three RSU-4F modules have the same structure. The number of input and output channels of each RSU-4F module is [512, 512], [512, 512], and [1024, 512], respectively.
[0012] The output feature vector of the third RSU-4F module and the fourth The feature vector output by the module is skipped and input into the first In the module, first, two consecutive CBR layers are passed, and then m-1 consecutive mCBR layers are used for downsampling. Then, a CBRD layer and an mCBR layer are added, and then n-1 consecutive nCBR layers are used for upsampling to restore the feature vector to the input size. Finally, the two CBR layers are skip-connected to the n-1th nCBR layer, and the m-1th in the mCBR layer are connected to the n-1th. i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module. Four The m of the modules are 3, 4, 5, and 6, and the n are 4, 5, 6, and 7. The second, third, and fourth The input of the module is the previous The feature vector output by the module is four The modules have the same structure. The number of input and output channels of the module are [1024,256], [512,128], [256,64], and [128,64] respectively.
[0013] The feature vector output by the second RSU-4F module is skipped with the feature vector output by the first RSU-4F module, and the fourth The feature vector output by the module is skipped and connected to the feature vector output by the third RSU-4F module. The feature vector output by the module and the first The feature vector output by the module is skipped and connected to the second The feature vector output by the module and the second The feature vector output by the module is skipped and the first The feature vector output by the module and the third The feature vector output by the module is skipped and connected, and the feature vector obtained by the five skip connections, which is a combination of shallow features and deep features, is combined with the fourth After the feature vectors output by the modules are concatenated, a Sigmoid function is added to normalize the network output value to obtain the probability that each pixel belongs to a tree.
[0014] The present invention also provides a sparse woodland single tree segmentation system based on NDVI weighted attention, which is used to implement the sparse woodland single tree segmentation method based on NDVI weighted attention as described above.
[0015] Moreover, it includes a processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute the sparse forest single tree segmentation method based on NDVI weighted attention as described above.
[0016] Alternatively, it includes a readable storage medium having a computer program stored thereon, and when the computer program is executed, it implements the sparse woodland single tree segmentation method based on NDVI weighted attention as described above.
[0017] Compared with the prior art, the present invention has the following advantages: 1) Based on the UNet concept, this paper adopts the U2NET nested architecture as the segmentation backbone network. It retains feature information through skip connections and captures the multi-level details and contours of the target. By deeply fusing the multi-scale feature extraction module with the residual nested structure, it effectively solves the edge blurring problem of traditional segmentation networks in scenes with overlapping tree canopies, uneven lighting, and complex backgrounds. 2) This paper designs a Manhattan Spatial Attention (MSA) mechanism based on the Manhattan distance. By introducing a non-Euclidean distance metric instead of the traditional cosine similarity calculation, this reduces computational complexity while enhancing the model's ability to model irregular tree distribution patterns. The MSA submodule combines the Manhattan distance matrix with a learnable positional encoding, enabling the network to effectively capture long-range spatial dependencies. 3) The present invention adds an NWD submodule after two consecutive CBR submodules, introduces the NDVI value before downsampling, eliminates background non-target interference before feature extraction, and takes into account the edge pixel weights in a weighted decomposition channel attention method; 4) The NWD submodule designed in this paper achieves spectral-spatial joint optimization through multimodal feature fusion technology. The NWD submodule embeds the Normalized Difference Vegetation Index (NDVI) as prior knowledge into the channel attention mechanism and designs a differentiable vegetation feature weighting layer, enabling the network to adaptively enhance the response of vegetation-related features. In the spatial dimension, spatial recalibration of feature maps is achieved through cascaded attention gating units, improving the stability of single tree monitoring in areas with low vegetation coverage. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is a flow chart of a method for segmenting single trees in sparse woodlands based on NDVI weighted attention according to an embodiment of the present invention.
[0020] Figure 2 This is a structural diagram of a sparse woodland single tree segmentation network model based on NDVI weighted attention in an embodiment of the present invention.
[0021] Figure 3 This is a structural diagram of the NWD submodule in the sparse woodland single tree segmentation network model based on NDVI weighted attention in an embodiment of the present invention.
[0022] Figure 4 This is a single tree segmentation result diagram obtained by processing the NWD submodule in an embodiment of the present invention.
[0023] Figure 5 This is a structural diagram of the MSA submodule in the sparse woodland single tree segmentation network model based on NDVI weighted attention in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention are further described below with reference to the accompanying drawings and embodiments. It is obvious that the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0025] Example 1 like Figure 1 As shown, the embodiment of the present invention provides a sparse woodland single tree segmentation method based on NDVI weighted attention, which includes the following steps: Step 1: Collect high-resolution remote sensing images of the sparse woodland study area, create a dataset containing the image-label-NDVI image array of individual trees in the sparse woodland, and divide it into training set, test set and validation set. The study area in this case study is a typical sparse woodland area. Data from the SuperView-1 satellite (SV01-SV04) were acquired for the study area at a spatial resolution of 0.5 m. The original four-band high-resolution remote sensing images were cropped into 512×512 blocks. Labelme was used to manually annotate each block, with 30–200 manually annotated tree labels. The NDVI value was then calculated for each block. This dataset, consisting of image-label-NDVI arrays of individual trees in the sparse woodland, was created and partitioned into training, test, and validation sets at an 8:1:1 ratio.
[0026] Step 2: Construct a sparse woodland single tree segmentation network model based on NDVI weighted attention.
[0027] like Figure 2 As shown in the figure, the sparse forest single tree segmentation network model based on NDVI weighted attention consists of 8 ResidualU-block (RSU) modules and 3 RSU-4F modules, where each RSU module adopts the "progressive gradient descent method, each RSU-4F module adopts the progressive void convolution method, and each RSU module and RSU-4F module draws on the idea of UNet encoding-decoding structure. The 8 RSU modules are defined as 4 Module and 4 Module, m represents the number of downsampling times, n represents the number of upsampling times. The remote sensing image first passes through 4 module, then passes through 3 RSU-4F modules in sequence, and finally passes through 4 Module, each 、 The output feature vectors of the RSU-4F module and the RSU-4F module are skip-connected to obtain 6 feature vectors composed of shallow features and deep features. The output value of the network is normalized by adding a Sigmoid function to obtain the probability of each pixel belonging to a tree. The specific processing process is as follows: Input the remote sensing image into the first After the module, it first passes through two consecutive CBR layers and then passes through the NWD submodule, using m-1 times (four The m of the module is 6, 5, 4, 3) and the continuous mCBR layer is downsampled, and then after a CBRD layer, it is continued to be used n-1 times (four The n of the module is 7, 6, 5, and 4 respectively. The continuous nCBR layers are upsampled to restore the feature map to the input size. Finally, the two CBR layers are jump-connected to the n-1th nCBR layer, and the m-1th consecutive mCBR layers are connected to the m-1th i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module. The second, third, and fourth The input of the module is the previous The module outputs the feature vector, and the four The modules have the same structure. The number of input and output channels of the module are [4,64], [64,128], [128,256], and [256,512] respectively.
[0028] The fourth The feature vector output by the module is input into the first RSU-4F module, first passes through two consecutive mCBR layers, then passes through the MSA submodule, and uses 5 consecutive dilated convolution CBRD layers (2 DThe D values in the RSU-4F module are set to 2, 4, 8, 4, and 2, respectively. Finally, after passing through an mCBR layer, two consecutive mCBR layers are skip-connected to the last mCBR layer. The first CBRD layer is skip-connected to the fifth CBRD layer, and the second CBRD layer is skip-connected to the fourth CBRD layer. The final results are added together to obtain the output feature vector of the first RSU-4F module, which serves as the input of the second RSU-4F module. The inputs of the second and third RSU-4F modules are the feature vectors output by the previous RSU-4F module. The structures of all three RSU-4F modules are identical. The number of input and output channels of each RSU-4F module is [512, 512], [512, 512], and [1024, 512], respectively.
[0029] The output feature vector of the third RSU-4F module and the fourth The feature vector output by the module is skipped and input into the first In the module, first pass through two consecutive CBR layers, using m-1 times (four The m of the module is 3, 4, 5, and 6 respectively) and the continuous mCBR layer is downsampled. After adding a CBRD layer and an mCBR layer, it is continued to be used n-1 times (four The n of the module is 4, 5, 6, and 7 respectively. The nCBR layers are upsampled to restore the feature vector to the input size. Finally, the two CBR layers are jump-connected to the n-1th nCBR layer, and the m-1th consecutive mCBR layers are connected to the m-1th i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module. The second, third, and fourth The input of the module is the previous The feature vector output by the module is four The modules have the same structure. The number of input and output channels of the module are [1024,256], [512,128], [256,64], and [128,64] respectively.
[0030] Perform a jump connection between the feature vector output by the second RSU-4F module and the feature vector output by the first RSU-4F module to obtain a feature vector composed of shallow features and deep features. The feature vector output by the module is skipped and connected to the feature vector output by the third RSU-4F module to obtain a feature vector composed of shallow features and deep features. The feature vector output by the module and the first The feature vector output by the module is skipped and connected to obtain a feature vector composed of shallow features and deep features. The feature vector output by the module and the second The feature vector output by the module is skipped and connected to obtain a feature vector composed of shallow features and deep features. The feature vector output by the module and the third The feature vectors output by the module are skipped and connected to obtain the feature vectors composed of shallow features and deep features. These five feature vectors composed of shallow features and deep features are combined with the fourth After the feature vectors output by the modules are concatenated, a Sigmoid function is added to normalize the network output value to obtain the probability of each pixel belonging to the foreground or background.
[0031] In the above process, the CBR layer consists of a convolutional layer, a batch normalization layer, and a ReLU activation function layer. The mCBR layer is a downsampling layer with a maximum pooling added after the CBR layer, and the downsampling rate is set to 1 / 2 each time. The CBRD layer is a CBR layer with 2 D The nCBR layer is an upsampling layer with an interpolate function added after the CBR layer, and the upsampling rate is set to 2 each time.
[0032] The structure of the NWD (NDVI weighted decomposition) submodule is as follows Figure 3 As shown, the feature vector output by the CBR layer is projected into a new feature space , three layers of depth convolution are used to obtain three hierarchical context representations with different receptive fields, namely: (1) Where, For the l The context function of the layer, GeLU is the activation function, and DWConv is the depth convolution operation.
[0033] Compared with pooling, depth convolution is learnable and structure-aware. Compared with ordinary convolution, depth convolution is channel-by-channel. When , the effective receptive fields correspond to the outer contour edge pixels, inner contour edge pixels, and internal pixels of the trees respectively.
[0034] The feature vector output by the CBR layer is input into three deep convolutional layers in sequence, and the feature pixels output by each deep convolutional layer are weighted respectively. Then, the feature pixels after attention weighting are spliced to obtain hierarchical context representations of different receptive fields. As the output of the NWD submodule.
[0035] The weighted calculation method for attention of the three aspects of outer contour edge pixels, inner contour edge pixels and internal pixels is as follows: (2) (3) (4) Where, and are the number of outer contour and inner contour pixels considered, For the i NDVI value of the outer contour pixel, For the j NDVI value of the inner contour pixel, is the average NDVI value of the internal tree pixels, is the average NDVI value of background non-tree pixels, Softmax is the normalized exponential function, 、 、 Represent the outer contour edge, inner contour edge, and internal pixel decomposition attention weights respectively.
[0036] In this embodiment, blue, red and green are used to represent 、 、 The pixels considered, after NWD sub-module processing, the single tree segmentation results are as follows Figure 4 As shown in the figure, the first row is the original remote sensing image after standard false color synthesis, the second row is the image after the NWD sub-module decomposes the mixed pixels of the tree boundaries, and the third row of dotted boxes are respectively displayed after the partial enlargement of the first picture in the first and second rows. Comparing them with the original remote sensing image, it is found that the NWD sub-module can reduce the problem of large area uncertainty caused by mixed pixels to a certain extent.
[0037] The structure of the MSA (Manhattan Spatial Attention) submodule is as follows Figure 5 As shown, the feature vector output by the mCBR layer is first passed through a The depth of the separable convolution layer is then passed through a normalization layer, and then input into the Manhattan self-attention mechanism, and then through the normalization layer and input into The depth of the separable convolutional layer.
[0038] The Manhattan self-attention mechanism is an improvement on the conventional self-attention mechanism. It encodes position information by introducing the Manhattan distance. When calculating the attention weight, it not only considers the dot product of the query (Q) and the key (K), but also incorporates the Manhattan distance encoding information to measure the relative position between elements. This allows the model to pay more attention to elements with specific distance relationships, thereby more effectively capturing long-distance dependencies in the data, better utilizing the spatial or sequential structure information in the data, and improving the model's ability to understand the local and global structure of the data.
[0039] In step 3, the sparse forest single tree segmentation network model constructed in step 2 is trained, hyperparameters are adjusted, and generalization ability is evaluated using the training set, validation set, and test set respectively.
[0040] Step 4: Use the trained sparse forest single tree segmentation network model to perform single tree segmentation.
[0041] After comparing the single tree segmentation results with the classic network models UNET, U2NET, UNETFormer and manually labeled ones, it was found that the sparse forest single tree segmentation network constructed by the present invention performed excellently in the sparse forest single tree segmentation task under real data and scenarios, especially in the segmentation of details and the segmentation taking into account the surrounding pixels.
[0042] Example 2 Based on the same inventive concept, the present invention also provides a sparse forest single tree segmentation system based on NDVI weighted attention, including a processor and a memory, the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute the above-mentioned sparse forest single tree segmentation method based on NDVI weighted attention.
[0043] Example 3 Based on the same inventive concept, the present invention also provides a sparse forest single tree segmentation system based on NDVI weighted attention, including a readable storage medium, on which a computer program is stored. When the computer program is executed, it implements the above-mentioned sparse forest single tree segmentation method based on NDVI weighted attention.
[0044] In specific implementation, the method proposed in the technical solution of the present invention can be automatically run by those skilled in the art using computer software technology. System devices that implement the method, such as computer-readable storage media that store the corresponding computer program of the technical solution of the present invention and computer equipment that runs the corresponding computer program, should also be within the scope of protection of the present invention.
[0045] The specific embodiments described herein are merely illustrative of the spirit of the present invention. Persons skilled in the art may make various modifications, additions, or substitutions to the described specific embodiments without departing from the spirit of the present invention or exceeding the scope of the appended claims.
Claims
1. A sparse woodland single tree segmentation method based on NDVI weighted attention, characterized in that: The following steps are involved: Step 1: Collect high-resolution remote sensing images of the sparse woodland study area, create a dataset containing image-label-NDVI image arrays of individual trees in the sparse woodland, and divide it into training set, test set, and validation set; Step 2: Construct a single tree segmentation network model for sparse woodland based on NDVI weighted attention; Step 3: Use the training set, validation set, and test set to train, adjust hyperparameters, and evaluate the generalization ability of the sparse forest single tree segmentation network model constructed in step 2; Step 4: Use the trained sparse forest single tree segmentation network model to perform single tree segmentation.
2. The method for sparse woodland single tree segmentation based on NDVI weighted attention according to claim 1, characterized in that: In step 1, the collected high-resolution remote sensing images are cropped into Multiple image blocks of different sizes are collected and manually labeled. Each image block contains several manually labeled tree labels. The NDVI value of each image block is then calculated to create a dataset of image-label-NDVI image arrays of single trees in sparse woodlands.
3. The method for sparse woodland single tree segmentation based on NDVI weighted attention according to claim 1, characterized in that: The sparse forest single tree segmentation network model based on NDVI weighted attention in step 2 consists of 8 RSU modules and 3 RSU-4F modules. The 8 RSU modules are defined as 4 Module and 4 Module, m represents the number of downsampling times, n represents the number of upsampling times, the remote sensing image first passes through 4 module, then passes through 3 RSU-4F modules in sequence, and finally passes through 4 Module, each 、 The output feature vectors of the RSU module and the RSU-4F module are jump-connected to obtain 6 feature vectors composed of shallow features and deep features. The output value of the network is normalized by adding a Sigmoid function to obtain the probability that each pixel belongs to a tree. Each RSU module adopts a progressive gradient descent method, and each RSU-4F module adopts a progressive dilated convolution method. In addition, each RSU module and RSU-4F module draws on the idea of the UNet encoding-decoding structure.
4. The method for sparse woodland single tree segmentation based on NDVI weighted attention according to claim 3, characterized in that: In step 2, the remote sensing image passes through 4 The module's processing flow is as follows: Input the remote sensing image into the first After the module, it first passes through two consecutive CBR layers, which are composed of convolutional layers, batch normalization layers, and ReLU activation function layers. Then it passes through the NWD submodule and uses m-1 consecutive mCBR layers for downsampling. The mCBR layer is a downsampling layer composed of a maximum pooling after the CBR layer. The downsampling rate is set to 1 / 2 each time. After passing through a CBRD layer, the CBRD layer adds 2 to the CBR layer. D The dilated convolution is continued, and n-1 consecutive nCBR layers are used for upsampling. The nCBR layer is an upsampling layer formed by adding an interpolate function after the CBR layer. The upsampling rate is set to 2 each time. Finally, the two CBR layers are jump-connected to the n-1th nCBR layer respectively, and the m-1th mCBR layers in the m-1th mCBR layer are connected to the n-1th mCBR layer respectively. i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module; four The m of the modules are 6, 5, 4, and 3 respectively, and the n are 7, 6, 5, and 4 respectively; the second, third, and fourth The input of the module is the previous The module outputs the feature vector, and the four The modules have the same structure. The number of input and output channels of the module are [4,64], [64,128], [128,256], and [256,512] respectively.
5. The method for segmenting individual trees in sparse woodlands based on NDVI weighted attention according to claim 4, characterized in that: In step 2, the NWD submodule sequentially inputs the feature vector output by the CBR layer into three deep convolutional layers, performs attention weighting on the feature pixels output by each deep convolutional layer, and then concatenates the feature pixels after attention weighting to obtain hierarchical context representations of different receptive fields as the output of the NWD submodule. The attention weighting calculation method for the three aspects of outer contour edge pixels, inner contour edge pixels, and internal pixels is as follows: (2) (3) (4) Where, and are the number of outer contour and inner contour pixels considered, For the i NDVI value of the outer contour pixel, For the j NDVI value of the inner contour pixel, is the average NDVI value of the internal tree pixels, is the average NDVI value of background non-tree pixels, Softmax is the normalized exponential function, 、 、 Represent the outer contour edge, inner contour edge, and internal pixel decomposition attention weights respectively.
6. The method for sparse woodland single tree segmentation based on NDVI weighted attention according to claim 4, characterized in that: The processing flow of the feature vector in step 2 passing through the three RSU-4F modules in sequence is as follows: The fourth The feature vector output by the module is input into the first RSU-4F module, first passing through two consecutive mCBR layers, then passing through the MSA submodule, using 5 consecutive dilated convolution CBRD layers, 2 D The D values in are set to 2, 4, 8, 4, and 2 respectively. Finally, after passing through an mCBR layer, the two consecutive mCBRs are jump-connected to the last mCBR layer, the first CBRD layer is jump-connected to the fifth CBRD layer, and the second CBRD layer is jump-connected to the fourth CBRD layer. After adding the final results, the output feature vector of the first RSU-4F module is obtained and used as the input of the second RSU-4F module; the structure of the MSA submodule is as follows: the feature vector output by the mCBR layer first passes through a depthwise separable convolution layer, then passes through a normalization layer, and then inputs the Manhattan self-attention mechanism, and then passes through the normalization layer and inputs the depthwise separable convolution layer; the inputs of the second and third RSU-4F modules are both the feature vectors output by the previous RSU-4F module, and the structures of the three RSU-4F modules are the same; the number of input and output channels of each RSU-4F module is [512, 512], [512, 512], and [1024, 512], respectively.
7. The method for sparse woodland single tree segmentation based on NDVI weighted attention according to claim 6, characterized in that: In step 2, the eigenvectors pass through 4 The module's processing flow is as follows: The output feature vector of the third RSU-4F module and the fourth The feature vector output by the module is skipped and input into the first In the module, first, two consecutive CBR layers are passed, and then m-1 consecutive mCBR layers are used for downsampling. Then, a CBRD layer and an mCBR layer are added, and then n-1 consecutive nCBR layers are used for upsampling to restore the feature vector to the input size. Finally, the two CBR layers are skip-connected to the n-1th nCBR layer, and the m-1th in the mCBR layer are connected to the n-1th. i The first of the mCBR layers and n-1 consecutive nCBR layers i nCBR layer skip connections, , after adding the final results, we get the first The feature vector output by the module is used as the second Input of the module; four The m of the modules are 3, 4, 5, and 6, and the n are 4, 5, 6, and 7 respectively; the second, third, and fourth The input of the module is the previous The feature vector output by the module is four The modules have the same structure. The number of input and output channels of the module are [1024,256], [512,128], [256,64], and [128,64] respectively.
8. The method for segmenting individual trees in sparse woodlands based on NDVI weighted attention according to claim 3, characterized in that: In step 2, each 、 The specific operation of skip connection of the output feature vectors of the module and RSU-4F module is as follows: The feature vector output by the second RSU-4F module is skipped with the feature vector output by the first RSU-4F module, and the fourth The feature vector output by the module is skipped and connected to the feature vector output by the third RSU-4F module. The feature vector output by the module and the first The feature vector output by the module is skipped and connected to the second The feature vector output by the module and the second The feature vector output by the module is skipped and the first The feature vector output by the module and the third The feature vector output by the module is skipped and connected, and the feature vector obtained by the five skip connections, which is a combination of shallow features and deep features, is combined with the fourth After the feature vectors output by the modules are concatenated, a Sigmoid function is added to normalize the network output value to obtain the probability that each pixel belongs to a tree.
9. A sparse woodland single tree segmentation system based on NDVI weighted attention, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute a sparse woodland single tree segmentation method based on NDVI weighted attention as described in any one of claims 1 to 8.
10. A sparse woodland single tree segmentation system based on NDVI weighted attention, characterized in that: The invention comprises a readable storage medium having a computer program stored thereon. When the computer program is executed, the method for segmenting single trees in sparse woodland based on NDVI weighted attention is implemented as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Land cover classification method based on deep fusion of multi-modal remote sensing data
CN113469094A
Single-tree fruit tree segmentation method and system based on multi-scale dense instance detection
CN117392382A
Breeding area prediction method based on improved nested UNet neural network
CN119398540A
Cited By
Cross-domain few-sample forest land vegetation adaptive feature recognition and extraction system and method
CN121837931A
A cross-domain few-shot forest vegetation self-adaptive feature recognition extraction system and method
CN121837931B