A dense mangrove counting method based on improved U2Net model

By improving the U2Net model and combining multi-scale feature extraction and feature map fusion, the problems of low accuracy and insufficient model generalization ability of mangrove density detection were solved, and efficient, accurate and robust mangrove density detection was achieved.

CN119600466BActive Publication Date: 2025-09-26GUANGDONG OCEAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411659761.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-09-26
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in mangrove density detection, especially in dense mangroves, and the model generalization ability of deep learning networks is insufficient.

Method used

An improved U2Net model is adopted, which combines an encoder, a dense skip connection module, a decoder and a salient feature map fusion module to generate a saliency probability map of mangroves through multi-scale feature extraction and feature map fusion.

Benefits of technology

The accuracy of mangrove density detection and the robustness of the model are improved, and the ability to extract contextual information of mangrove area characteristics is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600466B_ABST
    Figure CN119600466B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology and discloses a dense mangrove counting method based on an improved U2Net model. The method comprises collecting UAV lidar data from mangrove growth areas to construct a UAV visible light remote sensing image dataset; constructing an improved U2Net model; the improved U2Net model comprises an encoder, a dense skip connection module, a decoder, and a salient feature map fusion module; and utilizing the improved U2Net model to generate a saliency probability map to obtain mangrove counting results. The present invention combines lidar remote sensing imagery to produce a dataset that can better reflect the crown width characteristics of mangroves. The network model incorporates multi-scale features and an attention mechanism to improve mangrove counting results in dense scenes. Furthermore, the method demonstrates good generalization capabilities for mangrove images at different spatial scales and different canopy densities, thereby improving the accuracy of mangrove counting results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method for density detection and counting of mangrove images, and more particularly to a dense mangrove counting method based on an improved U2Net model. Background Art

[0002] Mangroves, as important coastal wetland ecosystems, play a vital role in maintaining ecological balance, sequestering carbon, and storing it. Tree density, a key structural parameter of mangrove forests, plays a crucial role in calculating mangrove biomass. However, mangroves are diverse in species, have complex ecological structures, and grow at high densities. Their location in the intertidal zone of coastal waters, where tides periodically inundate them, makes field surveys of mangrove density time-consuming and labor-intensive. Remote sensing technology offers unique advantages for monitoring mangrove parameters. High-resolution remote sensing imagery has become a primary source of information for estimating forest and tree parameters, reducing the cost of mangrove monitoring. However, traditional detection algorithms, such as the watershed algorithm, suffer from low accuracy when measuring mangrove density distribution due to their high canopy density and complex spatial structure. Effectively estimating mangrove abundance at multiple scales using remote sensing technology has been a challenge.

[0003] UAV-based Lidar offers high accuracy and the ability to extract three-dimensional structural information, providing a variety of tree detection methods and effectively inferring mangrove density within a region. However, its high cost and difficulty in data collection hinder widespread implementation. Therefore, methods based on high-resolution optical imagery are still widely used for tree detection.

[0004] With the development and application of deep learning, an increasing number of neural network models have been widely used in tree detection. Existing methods for counting tree counts using deep learning-based instance segmentation methods are not easily applicable to mangroves, as mangroves are typically densely distributed, have more complex canopy morphology, less distinct gaps between canopies, and exhibit greater variability within individual forest patches. Density regression methods based on deep learning networks can reduce the difficulty of model training and are widely used in scenarios such as crowd counting, fish counting, and crop counting. This method uses a Gaussian density map to represent the distribution of objects, deriving the number of objects while also achieving density segmentation. While effective in dense counting scenarios, recognition performance still needs to be improved in feature-rich scenarios. Mangrove canopies vary greatly in size, and when using similar counting network structures for mangrove counting, more attention should be paid to multi-scale feature extraction. Therefore, given the existing technical limitations, there is an urgent need for a method that effectively improves the accuracy of tree recognition in dense mangrove forests captured in optical images and enhances the model's generalization capabilities. Summary of the Invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a dense mangrove counting method based on an improved U2Net model.

[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0007] A dense mangrove counting method based on an improved U2Net model includes the following steps:

[0008] Collect UAV lidar data from mangrove forest areas and construct a UAV visible light remote sensing image dataset;

[0009] Constructing an improved U2Net model; the improved U2Net model includes an encoder, a dense skip connection module, a decoder, and a salient feature map fusion module;

[0010] The encoder is used to extract mangrove crown feature maps containing different levels of semantic information from the UAV visible light remote sensing image dataset.

[0011] The dense skip connection module is used to adjust the mangrove canopy feature map extracted by the encoder to be semantically consistent with the mangrove canopy feature map restored by the corresponding decoder and then passed to the decoder;

[0012] The decoder is used to fuse the mangrove canopy feature map transmitted by the dense skip connection module with the mangrove canopy feature map output by the encoder and then output to the salient feature map fusion module;

[0013] The mangrove crown feature maps of different scales output by the decoder are fused using the salient feature map fusion module to generate a saliency probability map and obtain the mangrove counting results.

[0014] Furthermore, the collecting of drone lidar data of mangrove growth areas and the construction of a drone visible light remote sensing image dataset include:

[0015] Collecting drone lidar data of mangrove growth areas;

[0016] Perform two-dimensional orthophoto reconstruction on UAV lidar data and build a UAV visible light remote sensing image dataset.

[0017] Furthermore, the encoder comprises:

[0018] The first encoder, second encoder, third encoder, fourth encoder, fifth encoder and sixth encoder are arranged in sequence from top to bottom; the input end of the first encoder serves as the input end of the encoder, and its output end is connected to the input end of the second encoder; the output end of the second encoder is connected to the input end of the third encoder; the output end of the third encoder is connected to the input end of the fourth encoder; the output end of the fourth encoder is connected to the input end of the fifth encoder; the output end of the fifth encoder is connected to the input end of the sixth encoder; and the output end of the sixth encoder serves as the output end of the encoder.

[0019] Furthermore, the decoder comprises:

[0020] The first decoder, second decoder, third decoder, fourth decoder and fifth decoder are arranged in sequence from bottom to top; the output end of the sixth encoder is spliced ​​with the output end of the fifth encoder, and then connected to the input end of the fifth decoder; the output end of the fifth decoder is spliced ​​with the output end of the fourth encoder, and then connected to the input end of the fourth decoder; the output end of the fourth decoder is spliced ​​with the output end of the third encoder, and then connected to the input end of the third decoder; the output end of the third decoder is spliced ​​with the output end of the second encoder, and then connected to the input end of the second decoder; the output end of the second decoder is spliced ​​with the output end of the first encoder, and then connected to the input end of the first decoder; the output end of the first decoder serves as the output end of the decoder.

[0021] Furthermore, the first encoder, the second encoder, the third encoder, and the fourth encoder, and the first decoder, the second decoder, the third decoder, and the fourth decoder all include an RSU-L module; the RSU-L module adopts a symmetric encoder-decoder structure with a depth of a positive integer L;

[0022] The RSU-L module includes L+1 encoder units and L-1 decoder units, the input end of the first encoder unit serves as the input end of the RSU-L module, the output end of the first encoder unit is connected to the input end of the second encoder unit, the output end of the second encoder unit is connected to the input end of the third encoder unit, the output end of the third encoder unit is connected to the input end of the next-level encoder unit, and is connected in series to the input end of the L+1th encoder unit, the output feature map of the L+1th encoder unit and the output feature map of the previous-level encoder are merged and connected to the input end of the L-1th decoder unit, the output of the L-1th decoder unit and the output of the same-level encoder unit are spliced ​​and connected to the input end of the previous-level decoder unit until the input end of the second decoder unit is connected, the output feature map of the second decoder unit and the output feature map of the second encoder unit are spliced ​​and connected to the input end of the first decoder unit, and the output end of the first decoder unit serves as the output end of the RSU-L module;

[0023] The first encoder unit and the second encoder unit of the RSU-L module are composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining encoder units further increase the downsampling operation; the L-1th decoder unit at the bottom of the RSU-L module is composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining decoder units further increase the upsampling operation.

[0024] Furthermore, the fifth encoder, the sixth encoder, and the fifth decoder all include a multi-scale dilated residual module, and the multi-scale dilated residual module adopts a multi-scale dilated convolution structure and a dense connection structure;

[0025] The multi-scale dilated residual module includes a first dilated convolution unit, a second dilated convolution unit, a third dilated convolution unit, a fused convolution unit and a residual unit; each dilated convolution unit is composed of a first Conv2d convolution layer, a first ReLU activation function layer, a second Conv2d dilated convolution layer and a second ReLU activation function layer, the output end of the first convolution layer is connected to the input end of the first activation function layer, the output end of the first activation function layer is connected to the input end of the second convolution layer, the second convolution layer adopts dilated convolution with dilation ratios of 1, 2 and 3, and its output end is connected to the second The input end of the activation function layer is connected; the first, second and third dilated convolution units are cascaded and spliced ​​to fuse the feature maps at different scales together, and are connected to the input end of the fused convolution unit; the fused convolution unit is composed of a 3*3 convolution layer, which fuses the output feature map of the dilated convolution unit and changes the number of channels, and its output end is connected to the input end of the residual unit; the residual unit includes a 1*1 convolution layer and an adder, which adds the input feature map to the output of the fused convolution unit through a residual connection, and the output end of the residual unit serves as the output end of the multi-scale dilated residual module.

[0026] Furthermore, the RSU-L module and the multi-scale dilated residual module each further include an EMCAM multi-scale convolutional attention module, and the EMCAM multi-scale convolutional attention module includes a channel attention block, a spatial attention block, and a multi-scale convolution block arranged in sequence;

[0027] The channel attention block includes an average pooling layer, a maximum pooling layer, a convolution layer and a Sigmoid function. Its input is a multi-channel image feature map. The average pooling and maximum pooling results of the input feature map are calculated as the input of the convolution layer. Then, the two pooling results are respectively applied with 1*1 convolution, ReLU activation function and 1*1 convolution, and then added together and passed through the Sigmoid function to obtain the final attention weight. Finally, the final attention weight is multiplied with the input feature map to obtain the channel attention feature map;

[0028] The spatial attention block includes an average pooling layer, a maximum pooling layer, a convolution layer and a Sigmoid function, which receives the channel attention feature map output by the channel attention block as input, connects the input ends of the average pooling layer and the maximum pooling layer respectively, calculates the average pooling result and the maximum pooling result of the input feature map, wherein the pooling operation is performed along the channel dimension, and the outputs of the average pooling layer and the maximum pooling layer are spliced ​​along the channel dimension to form a new feature map; after applying convolution to the spliced ​​feature map, a spatial attention weight is obtained by the Sigmoid function, and finally the spatial attention weight is multiplied by the input feature map to obtain the spatial attention feature map;

[0029] The multi-scale convolution block receives the output of the spatial attention block as input, first performs channel expansion through a 1*1 point convolution layer, then uses multi-scale depth convolution with convolution kernel sizes of 1*1, 3*3, and 5*5 to process the expanded feature map, adds the processed feature maps of different scales, and finally adjusts the number of channels of the feature map to the number of channels of the input feature map of the multi-scale convolution block through a 1*1 point convolution layer, and its output is used as the output of the EMCAM multi-scale convolution attention module.

[0030] Furthermore, the dense skip connection module includes:

[0031] a first bridge, a second bridge, a third bridge, a fourth bridge, a fifth bridge, and a sixth bridge;

[0032] The input end of the first bridge serves as the input end of the dense skip connection module and is connected to the output ends of the first encoder and the second encoder respectively, and its output end is connected to the input end of the second decoder and the second bridge respectively; the input end of the second bridge is connected to the output ends of the first bridge and the fourth bridge respectively, and its output end is connected to the input end of the second decoder and the third bridge respectively; the input end of the third bridge is connected to the output ends of the second bridge and the fifth bridge respectively, and its output end is connected to the input end of the second decoder; the input end of the fourth bridge is connected to the output ends of the third encoder and the fourth encoder respectively, and its output end is connected to the input end of the fifth bridge, the third decoder, and the second bridge respectively; the input end of the fifth bridge is connected to the output ends of the fourth bridge and the sixth bridge respectively, and its output end is connected to the input end of the third bridge and the third decoder respectively; the input end of the sixth bridge is connected to the output ends of the fourth encoder and the fifth encoder respectively, and its output end is connected to the input end of the fifth bridge and the fourth decoder respectively;

[0033] The first bridge, the second bridge, the third bridge, the fourth bridge, the fifth bridge and the sixth bridge each include a multi-scale dilated residual module.

[0034] Furthermore, the salient feature map fusion module receives the output feature maps from the first decoder, the second decoder, the third decoder, the fourth decoder, the fifth decoder and the sixth encoder as its input, processes them through a 3*3 convolution kernel as the input of the bilinear interpolation method, and upsamples the processed feature maps using the bilinear interpolation method to obtain an output saliency probability map; then, the output saliency probability map is subjected to a feature map splicing operation according to the channel dimension, and the spliced ​​saliency probability map is processed through a 1*1 convolution layer and a Sigmoid activation function to obtain a final saliency probability map.

[0035] Furthermore, the loss function of the C-U2Net model is:

[0036] L=L e +λL c

[0037]

[0038] Among them, L is the loss function of the C-U2Net model, L e is the Euclidean distance loss function, L c is the multi-scale density level consistency loss function, λ is the coefficient for adjusting the relative weight of the two component losses, N is the number of pictures, i is the picture number, G(X i ; θ) is the image X i The predicted density map of is the true density map, S is the number of scale levels, j is the scale level number, P ave is the average pooling operation, k j Set output size for average pooling.

[0039] The present invention has the following beneficial effects:

[0040] By constructing an improved U2Net network model, the present invention can effectively extract multi-scale features, enhance the ability to capture key features, and fuse features at different levels through the feature map fusion layer to improve the model's sensitivity to details and overall performance. This structure enhances the mangrove crown dark valley feature data on drone images, increases the network model's ability to extract contextual information of mangrove area features, and can improve the model's accuracy and robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a dense mangrove counting method based on the improved U2Net model;

[0042] Figure 2 This is a structural diagram of the C-U2Net model;

[0043] Figure 3 This is a schematic diagram of the structure of the RSU-7 module;

[0044] Figure 4 It is a structural diagram of the MDRB module;

[0045] Figure 5 Schematic diagram of the structure of EMCAM multi-scale convolutional attention module;

[0046] Figure 6 It is a structural diagram of the feature fusion module;

[0047] Figure 7 This is a schematic diagram of the structure of the C-U2Net-lite model;

[0048] Figure 8 Schematic diagram of the dataset production process;

[0049] Figure 9 A comparison chart of the effects of C-U2Net and mainstream network models;

[0050] Figure 10 This is a prediction diagram of 256*256 size of the present invention. DETAILED DESCRIPTION

[0051] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.

[0052] like Figure 1 As shown, an embodiment of the present invention provides a dense mangrove counting method based on an improved U2Net model, comprising the following steps S1 to S6:

[0053] S1. Collect UAV lidar data in mangrove growth areas and construct a UAV visible light remote sensing image dataset.

[0054] S2. Build an improved U2Net model; the improved U2Net model includes an encoder, a dense skip connection module, a decoder, and a salient feature map fusion module;

[0055] S3. Use the encoder to extract mangrove crown feature maps containing different levels of semantic information from the UAV visible light remote sensing image dataset;

[0056] S4, using a dense skip connection module to adjust the mangrove canopy feature map extracted by the encoder to be semantically consistent with the mangrove canopy feature map restored by the corresponding decoder, and then passing it to the decoder;

[0057] S5. Using the decoder, the mangrove canopy feature map transmitted by the dense skip connection module is fused with the mangrove canopy feature map output by the encoder, and the resultant is output to the salient feature map fusion module.

[0058] S6. Use the salient feature map fusion module to fuse the mangrove crown feature maps of different scales output by the decoder to generate a saliency probability map and obtain the mangrove counting result.

[0059] The present invention constructs an improved U2Net model, denoted as the C-U2Net network model, which can effectively extract multi-scale features, enhance the ability to capture key features, and fuse features at different levels through the feature map fusion layer to improve the model's sensitivity to details and overall performance. This structure enhances the characteristic data of mangrove crown dark valleys in drone images, increases the network model's ability to extract contextual information of mangrove area features, and can improve the accuracy and robustness of the model.

[0060] In an optional embodiment of the present invention, collecting UAV lidar data of mangrove growth areas and constructing a UAV visible light remote sensing image dataset includes:

[0061] Collecting drone lidar data of mangrove growth areas;

[0062] Perform two-dimensional orthophoto reconstruction on UAV lidar data and build a UAV visible light remote sensing image dataset.

[0063] In an optional embodiment of the present invention, the encoder includes:

[0064] The first encoder, second encoder, third encoder, fourth encoder, fifth encoder and sixth encoder are arranged in sequence from top to bottom; the input end of the first encoder serves as the input end of the encoder, and its output end is connected to the input end of the second encoder; the output end of the second encoder is connected to the input end of the third encoder; the output end of the third encoder is connected to the input end of the fourth encoder; the output end of the fourth encoder is connected to the input end of the fifth encoder; the output end of the fifth encoder is connected to the input end of the sixth encoder; and the output end of the sixth encoder serves as the output end of the encoder.

[0065] The decoder comprises:

[0066] The first decoder, second decoder, third decoder, fourth decoder and fifth decoder are arranged in sequence from bottom to top; the output end of the sixth encoder is spliced ​​with the output end of the fifth encoder, and then connected to the input end of the fifth decoder; the output end of the fifth decoder is spliced ​​with the output end of the fourth encoder, and then connected to the input end of the fourth decoder; the output end of the fourth decoder is spliced ​​with the output end of the third encoder, and then connected to the input end of the third decoder; the output end of the third decoder is spliced ​​with the output end of the second encoder, and then connected to the input end of the second decoder; the output end of the second decoder is spliced ​​with the output end of the first encoder, and then connected to the input end of the first decoder; the output end of the first decoder serves as the output end of the decoder.

[0067] The first encoder, the second encoder, the third encoder, and the fourth encoder, and the first decoder, the second decoder, the third decoder, and the fourth decoder all include an RSU-L module; the RSU-L module adopts a symmetric encoder-decoder structure with a depth of a positive integer L;

[0068] The RSU-L module includes L+1 encoder units and L-1 decoder units, the input end of the first encoder unit serves as the input end of the RSU-L module, the output end of the first encoder unit is connected to the input end of the second encoder unit, the output end of the second encoder unit is connected to the input end of the third encoder unit, the output end of the third encoder unit is connected to the input end of the next-level encoder unit, and is connected in series to the input end of the L+1th encoder unit, the output feature map of the L+1th encoder unit and the output feature map of the previous-level encoder are merged and connected to the input end of the L-1th decoder unit, the output of the L-1th decoder unit and the output of the same-level encoder unit are spliced ​​and connected to the input end of the previous-level decoder unit until the input end of the second decoder unit is connected, the output feature map of the second decoder unit and the output feature map of the second encoder unit are spliced ​​and connected to the input end of the first decoder unit, and the output end of the first decoder unit serves as the output end of the RSU-L module;

[0069] The first encoder unit and the second encoder unit of the RSU-L module are composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining encoder units further increase the downsampling operation; the L-1th decoder unit at the bottom of the RSU-L module is composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining decoder units further increase the upsampling operation.

[0070] The fifth encoder, the sixth encoder and the fifth decoder all include an MDRB multi-scale dilated residual module, which uses multi-scale dilated convolution and dense connection to capture feature information at different scales; the MDRB multi-scale dilated residual module includes a first dilated convolution unit, a second dilated convolution unit, a third dilated convolution unit, a fused convolution unit and a residual unit arranged in sequence from top to bottom; each dilated convolution unit is composed of a first Conv2d convolution layer, a first ReLU activation function layer, a second Conv2d dilated convolution layer and a second ReLU activation function layer, the output end of the first convolution layer is connected to the input end of the first activation function layer, and the first activation function layer is connected to the input end of the first activation function layer. The output end of the activation function layer is connected to the input end of the second convolutional layer. The second convolutional layer adopts dilated convolution with dilation ratios of 1, 2, and 3, and its output end is connected to the input end of the second activation function layer; the first, second, and third dilated convolution units are cascaded and spliced ​​to fuse the feature maps at different scales together, and are connected to the input end of the fused convolution unit; the fused convolution unit is composed of a 3*3 convolution layer, which fuses the output feature map of the dilated convolution unit, and its output end is connected to the input end of the residual unit; the residual unit includes a 1*1 convolution layer and an adder, and the input feature map is added to the output of the fused convolution unit through a residual connection. The output end of the residual unit serves as the output end of the MDRB module.

[0071] like Figure 2As shown, the C-U2Net model constructed in this embodiment adopts a U-shaped network structure. The input end of the U-shaped network structure serves as the input end of the C-U2Net model, which includes six encoders and six decoders in sequence; the first encoder Encoder1 is composed of an RSU-7 module, and its output end is connected to the input end of the second encoder; the second encoder Encoder2 is composed of an RSU-6 module, and its output end is connected to the input end of the third encoder; the third encoder Encoder3 is composed of an RSU-5 module, and its output end is connected to the input end of the fourth encoder; the fourth encoder Encoder4 is composed of an RSU-4 module, and its output end is connected to the input end of the fifth encoder; the fifth encoder Encoder5 is composed of an MDRB module, and its output end is connected to the input end of the sixth encoder; the sixth encoder Encoder6 is composed of an MDRB module, and its output end is spliced ​​with the output end of the fifth encoder and connected to the input end of the fifth decoder. The fifth decoder Decoder5 is composed of the MDRB module, and its output end is spliced ​​with the output end of the fourth encoder and connected to the input end of the fourth decoder; the fourth decoder Decoder4 is composed of the RSU-4 module, and its output end is spliced ​​with the output end of the third encoder and connected to the input end of the third decoder; the third decoder Decoder3 is composed of the RSU-5 module, and its output end is spliced ​​with the output end of the second encoder and connected to the input end of the second decoder; the second decoder Decoder2 is composed of the RSU-6 module, and its output end is spliced ​​with the output end of the first encoder and connected to the input end of the first decoder; the first decoder Decoder1 is composed of the RSU-7 module, and its output end and the second output end of the other decoders and the second output end of the sixth encoder are respectively connected to the input end of the salient feature fusion module, and its output end serves as the output end of the C-U2Net model.

[0072] The U-shaped network structure employed in this embodiment utilizes the RSU-L module and the MDRB multi-scale dilated residual module, combined with skip connections and concatenation operations. This effectively improves the ability to extract mangrove canopy features and the accuracy of mangrove tree count detection, making it suitable for high-precision mangrove count detection. Furthermore, skip connections can directly transmit high-level features to the lower-level decoder, effectively recovering detailed information. This improves the recovery of mangrove canopy boundaries and contributes to improved detection accuracy and robustness.

[0073] The C-U2Net model constructed in this embodiment includes two types of modules: RSU (ReSidual U-block) module and multi-scale dilated residual module;

[0074] like Figure 3As shown, the RSU-L module adopts a symmetric encoder-decoder structure with a depth of L, where L is a positive integer. In the improved U2Net model, L takes values ​​of 4, 5, 6, and 7, respectively. Each RSU-L module contains L+1 encoders and L-1 decoders. In the encoder part, the feature map is processed sequentially by the encoder. The two encoders at the top are composed of RSU residual blocks consisting of Conv2d convolutional layers, BatchNorm2d normalization layers, and ReLU activation layers. The remaining encoders further downsampling, performing a 2x maxpool downsampling after each module pass. In the decoder part, each decoder receives as input the concatenation of the output of the encoder at the same level and the output of the decoder at the previous level. The bottom decoder has a structure similar to the encoder, consisting of an RSU residual block consisting of Conv2d convolutional layers, BatchNorm2d normalization layers, and ReLU activation layers. The remaining decoders further upsampling, performing a 2x bilinear upsampling before each module pass.

[0075] like Figure 4 As shown, the MDRB module adopts a multi-scale dilated convolution structure and a dense connection structure; the MDRB module includes a first dilated convolution unit, a second dilated convolution unit, a third dilated convolution unit, a fused convolution unit and a residual unit; each dilated convolution unit is composed of a first Conv2d convolution layer, a first ReLU activation function layer, a second Conv2d dilated convolution layer and a second ReLU activation function layer. The output end of the first convolution layer is connected to the input end of the first activation function layer, and the output end of the first activation function layer is connected to the input end of the second convolution layer. The second convolution layer adopts an expansion ratio of 1, 2, 3, and its output end is connected to the input end of the second activation function layer; the first, second and third dilated convolution units are cascaded and spliced ​​to fuse the feature maps at different scales together, and are connected to the input end of the fused convolution unit; the fused convolution unit is composed of a 3*3 convolution layer, which fuses the output feature map of the dilated convolution unit and changes the number of channels, and its output end is connected to the input end of the residual unit; the residual unit includes a 1*1 convolution layer and an adder, which adds the input feature map and the output of the fused convolution unit through a residual connection, and the output end of the residual unit serves as the output end of the MDRB module.

[0076] The different depths of the RSU-L module in this embodiment can capture features at different scales, which is crucial for identifying mangrove crowns. Because mangrove crowns vary in size, shape, and density, multi-scale feature extraction capabilities are required to distinguish different types of crowns. The MDRB module replaces downsampling and upsampling operations with dilated convolutions at different scales, increasing the receptive field and enhancing the ability to capture information at different scales. It can extract features while keeping the size of the feature map unchanged, which plays a role in maintaining the fine structure of the mangrove crown and helps the model better identify the edges and internal structure of the crown.

[0077] In an optional embodiment of the present invention, the RSU-L module and the MDRB module each further include an EMCAM multi-scale convolutional attention module, and the EMCAM multi-scale convolutional attention module includes a channel attention block, a spatial attention block and a multi-scale convolution block arranged in sequence;

[0078] The channel attention block includes an average pooling layer, a maximum pooling layer, a convolution layer and a Sigmoid function. Its input is a multi-channel image feature map. The average pooling and maximum pooling results of the input feature map are calculated as the input of the convolution layer. Then, the two pooling results are respectively applied with 1*1 convolution, ReLU activation function and 1*1 convolution, and then added together and passed through the Sigmoid function to obtain the final attention weight. Finally, the final attention weight is multiplied with the input feature map to obtain the channel attention feature map;

[0079] The spatial attention block includes an average pooling layer, a maximum pooling layer, a convolution layer and a Sigmoid function, which receives the channel attention feature map output by the channel attention block as input, connects the input ends of the average pooling layer and the maximum pooling layer respectively, calculates the average pooling result and the maximum pooling result of the input feature map, wherein the pooling operation is performed along the channel dimension, and the outputs of the average pooling layer and the maximum pooling layer are spliced ​​along the channel dimension to form a new feature map; after applying convolution to the spliced ​​feature map, a spatial attention weight is obtained by the Sigmoid function, and finally the spatial attention weight is multiplied by the input feature map to obtain the spatial attention feature map;

[0080] The multi-scale convolution block receives the output of the spatial attention block as input, first performs channel expansion through a 1*1 point convolution layer, then uses multi-scale depth convolution with convolution kernel sizes of 1*1, 3*3, and 5*5 to process the expanded feature map, adds the processed feature maps of different scales, and finally adjusts the number of channels of the feature map to the number of channels of the input feature map of the multi-scale convolution block through a 1*1 point convolution layer, and its output is used as the output of the EMCAM multi-scale convolution attention module.

[0081] like Figure 5As shown in the figure, the EMCAM multi-scale convolutional attention module, through the combination of channel attention blocks (CAB), spatial attention blocks (SAB), and multi-scale convolutional blocks (MSCB), can effectively enhance the model's ability to capture mangrove canopy features and improve the accuracy of mangrove number detection. CAB generates channel attention weights by performing average and maximum pooling on multi-channel image feature maps and applying convolution and activation functions, thereby highlighting important features. SAB further enhances attention in the spatial dimension by concatenating the average and maximum pooling results and applying convolution and sigmoid functions to generate spatial attention weights. MSCB fuses feature information at different scales through multi-scale convolution, improving the model's sensitivity to tree canopies of different sizes and shapes. This multi-scale attention mechanism helps preserve detailed information about the mangrove canopy.

[0082] In an optional embodiment of the present invention, the dense skip connection module includes:

[0083] a first bridge, a second bridge, a third bridge, a fourth bridge, a fifth bridge, and a sixth bridge;

[0084] The input end of the first bridge serves as the input end of the dense skip connection module and is connected to the output ends of the first encoder and the second encoder respectively, and its output end is connected to the input end of the second decoder and the second bridge respectively; the input end of the second bridge is connected to the output ends of the first bridge and the fourth bridge respectively, and its output end is connected to the input end of the second decoder and the third bridge respectively; the input end of the third bridge is connected to the output ends of the second bridge and the fifth bridge respectively, and its output end is connected to the input end of the second decoder; the input end of the fourth bridge is connected to the output ends of the third encoder and the fourth encoder respectively, and its output end is connected to the input end of the fifth bridge, the third decoder, and the second bridge respectively; the input end of the fifth bridge is connected to the output ends of the fourth bridge and the sixth bridge respectively, and its output end is connected to the input end of the third bridge and the third decoder respectively; the input end of the sixth bridge is connected to the output ends of the fourth encoder and the fifth encoder respectively, and its output end is connected to the input end of the fifth bridge and the fourth decoder respectively;

[0085] The first bridge, the second bridge, the third bridge, the fourth bridge, the fifth bridge and the sixth bridge all include MDRB modules. In this embodiment, a dense skip connection module is added starting from the second layer encoder of the U-shaped network structure. SkipBlock1 is respectively connected to the output ends of Encoder2 and Encoder3 of the U-shaped network, and its output end is respectively connected to the input ends of Decoder2 and SkipBlock2; the input end of SkipBlock2 is respectively connected to the output ends of SkipBlock1 and SkipBlock4, and its output end is respectively connected to Decoder2 and SkipBlock3; the input end of SkipBlock3 is respectively connected to the output ends of SkipBlock2 and SkipBlock5, and its output end is respectively connected to Decoder2 and SkipBlock3. oder2; the input end of the SkipBlock4 is respectively connected to the output ends of Encoder3 and Encoder4, and its output end is respectively connected to SkipBlock5, Decoder3 and SkipBlock2; the input end of the SkipBlock5 is respectively connected to the output ends of SkipBlock4 and SkipBlock6, and its output end is respectively connected to SkipBlock3 and Decoder3; the input end of the SkipBlock6 is respectively connected to the output ends of Encoder4 and Encoder5, and its output end is respectively connected to SkipBlock5 and Decoder4.

[0086] In the traditional U-shaped architecture, skip connections directly connect feature maps between the encoder and decoder, which can lead to the fusion of semantically dissimilar feature maps. Adding a redesigned skip path can compensate for the semantic differences between the encoder and decoder subpaths. Furthermore, adding skip modules only to small-scale feature paths can further refine small-scale feature maps while effectively reducing the number of parameters and training difficulty. Furthermore, all convolutional layers in the skip path use 3*3 kernels to enhance local correlation and semantic consistency of features.

[0087] In an optional embodiment of the present invention, Figure 6As shown, the salient feature map fusion module receives the output feature maps from the first decoder, the second decoder, the third decoder, the fourth decoder, the fifth decoder and the sixth encoder as its input, processes them through a 3*3 convolution kernel as the input of the bilinear interpolation method, and upsamples the processed feature maps using the bilinear interpolation method to obtain an output saliency probability map; then, the output saliency probability map is subjected to a feature map splicing operation according to the channel dimension, and the spliced ​​saliency probability map is processed through a 1*1 convolution layer and a Sigmoid activation function to obtain the final saliency probability map.

[0088] The salient feature map fusion module constructed in this embodiment can effectively integrate multi-scale information, restore spatial resolution through convolution operations and bilinear interpolation, and ultimately generate a high-quality saliency probability map through feature map splicing, 1x1 convolution, and Sigmoid activation function. This is particularly useful for mangrove crown feature extraction and number detection tasks. Using this module can improve detection accuracy, preserve details, and suppress noise, thereby enhancing overall performance.

[0089] In an optional embodiment of the present invention, Figure 7 As shown, the C-U2Net-lite model is a lightweight version of the C-U2Net model. C-U2Net-lite reduces one encoder and one decoder to achieve the purpose of reducing the number of parameters; the encoder of the C-U2Net-lite includes a first encoder, a second encoder, a third encoder, a fourth encoder and a fifth encoder; the decoder includes a first decoder, a second decoder, a third decoder and a fourth decoder; the first encoder, the second encoder, the third encoder and the fourth encoder and the first decoder, the second decoder, the third decoder and the fourth decoder all include an RSU-L module; the fifth encoder, the first bridge, the second bridge, the third bridge, the fourth bridge, the fifth bridge and the sixth bridge of the C-U2Net-lite all include an MDRB module.

[0090] The C-U2Net-lite model constructed in this embodiment can effectively reduce the number of parameters and effectively reduce the size of the model while maintaining the performance of the C-U2Net model as much as possible, thereby achieving faster training cycles and response speeds to meet different needs in some scenarios and improve the versatility of the model.

[0091] In an optional embodiment of the present invention, the loss function of the C-U2Net model is:

[0092] L=L e +λL c

[0093]

[0094] Among them, L is the loss function of the improved U2Net model, L e is the Euclidean distance loss function, L c is the multi-scale density level consistency loss function, λ is the coefficient for adjusting the relative weight of the two component losses, N is the number of pictures, i is the picture number, G(X i ; θ) is the image X i The predicted density map of is the true density map, S is the number of scale levels, j is the scale level number, P ave is the average pooling operation, k j Set output size for average pooling.

[0095] The loss function of the C-U2Net network constructed in this embodiment adopts a hybrid function of the multi-scale density level consistency loss function and the Euclidean distance loss function as the loss function.

[0096] The multi-scale density level consistency loss function sets three pooling windows of different sizes to calculate the average pooling loss. The pooling window sizes are 1×1, 2×2 and 4×4 respectively. The first scale-level window with an output size of 1×1 captures the global features of the density level, while the other two scale-level windows represent the local density levels of the image blocks. For each pooling window size, the average pooling loss between the input and target values ​​is calculated and summed.

[0097] The Euclidean distance loss function is used as the loss function for general density distribution tasks. However, the Euclidean loss function only focuses on pixel-level errors and does not take into account the structural correlation between the predicted density map and the true density map. However, there is a certain spatial structure between tree density maps. By combining the Euclidean loss function and the multi-scale density level consistency loss function, the total loss L is obtained. The weight between the two is adjusted by the hyperparameter e to obtain the final total loss.

[0098] The hybrid loss function used in this example combines a multi-scale density level consistency loss and a Euclidean distance loss. Using pooling windows of varying sizes, it captures both global and local density features. This multi-scale approach helps the network better understand the structure and distribution patterns of mangroves. By adjusting the hyperparameter e to balance the weights of the two losses, the consistency between the predicted and true density maps can be more accurately assessed while preserving the integrity of mangrove details.

[0099] like Figure 8As shown in the figure, a mangrove density distribution dataset was constructed using UAV Lidar data for training the C-U2Net network. The steps include but are not limited to point cloud denoising, ground point classification, point cloud normalization, construction of DEM digital elevation model, construction of DSM digital surface model, construction of CHM canopy height model, CHM canopy segmentation, generation of seed points, manual correction, canopy width feature mapping, and Gaussian kernel function to produce density distribution map.

[0100] First, the high-resolution UAV LiDAR data is denoised to remove noise points caused by high-order errors (such as interference from flying objects) and low-order errors (abnormal points in the measurement process); the denoised point cloud data is classified using the Improved Progressive TIN Densification (IPTD) filtering algorithm to distinguish ground points from non-ground points; then, the Digital Elevation Model (DEM) is constructed using the irregular triangulation interpolation method, and the Digital Surface Model (DSM) is generated using the Kriging interpolation technique; after obtaining the DEM and DSM models, the canopy height model (CanopyHeight) is created by subtracting the DEM from the DSM. Next, for mangrove plants with a height of more than 0.5 m, a watershed algorithm is used to segment individual trees. This algorithm regards high points on the CHM as peaks and low points as valleys. Barriers are set up where water flows converge. The dividing lines corresponding to these barriers form the boundaries of the crown, thereby achieving individual tree segmentation. Based on the CHM individual tree segmentation based on Lidar data, the center point of each individual tree, that is, the canopy center point, can be obtained. However, CHM segmentation may cause over-segmentation or under-segmentation of the mangrove point cloud data, affecting the estimation accuracy of individual tree parameters such as tree height and crown width. Therefore, it is necessary to optimize the seed points through manual visual interpretation to meet the standards of the dataset. After the crown marking is completed manually, the seed points are further vectorized to obtain the corresponding seed point files. These seed point files record the spatial distribution of mangroves, which not only contain the relative coordinate information of each seed point, but also reflect the crown width and tree height of the mangroves. Then, the geometric relationship between the gridded image and the seed points is constructed, and the resolution of these point grids is reconstructed to the same spatial resolution as the visible light image to be trained. Then, according to the crown area size and tree height, the crown is represented by C, and three scale levels C are set. l 、C m and C h Represent small, medium and large tree crowns respectively. For each scale, different Gaussian kernels are applied to reflect the blur effect of the tree crown at that scale and construct a density distribution map. Assume that the marked tree is located at pixel p i, expressed as indicator function δ{pp i}, where p represents the index of any pixel, indicating that the function is i If the value of p is 1 at the node and 0 at other nodes, the gridded tree distribution H(p) of N trees can be expressed as:

[0101]

[0102] In order to convert it into a density function, a discrete Gaussian blur kernel is convolved with the tree distribution map, and the density distribution can be expressed as:

[0103]

[0104] The Gaussian function contains two key parameters: the standard deviation σ and the size of the Gaussian blur kernel. These two parameters determine the size and integral value of a single marker in the density map, and have a significant impact on the estimation of the tree density map. Where j∈{l,m,h}, j depends on the scale level C to which the i-th tree belongs. j Once we have the corresponding density map, the task of tree counting is transformed into a function F such that D = F(I), where I represents the remote sensing image. Then, the total number of trees N in the density map is calculated as follows:

[0105]

[0106] Where subscript i denotes the row, subscript j denotes the column, H denotes the height of the density map, and W denotes the width of the density map. Finally, the gridded Gaussian density map and visible light map were sliced ​​into 256x256 pixel images to create two datasets with different densities, GaoQiaoMangrove_A and GaoQiaoMangrove_B. The samples in GaoQiaoMangrove_A were randomly divided into a training subset of 1700 and a test subset of 300, while the samples in GaoQiaoMangrove_B were randomly divided into a training subset of 2402 and a test subset of 300. In the GaoQiaoMangrove_A and GaoQiaoMangrove_B datasets, each image had an average of 632 and 236 labeled trees, respectively, with a maximum of 3005 and 1535 labeled trees, respectively, for a total of approximately 1.9 million labeled trees. Compared to dataset B, dataset A has a higher mangrove density and more complex scene characteristics, while dataset B has a lower mangrove density and a relatively simpler scene.

[0107] Table 1 GaoQiaoMangrove dataset

[0108]

[0109] The experimental platform used in the present invention is equipped with a 13th Gen Intel Core i9-13900K processor, 128G running memory, a GPU of NVIDIA RTX 4090D graphics card, 24G video memory, and a window11 operating system. It uses the Cuda 12.3 version of the PyTorch open source framework and Python 3.8 for data processing. During the training of the model, the Adam optimizer is used to optimize the parameters of the network model, and the initial learning rate is set to 0.0001. The learning rate is used to control the hyperparameters of the model parameter update speed to achieve better convergence speed; the input image size is set to 256x256 pixels, and the maximum epoch is set to 200 rounds; BatchSize is set to 16, and each time the model parameters are updated, 16 images will be processed simultaneously; during the training process, the data set is divided into a training set, a validation set, and a test set. The training set is used to train the model, the validation data set is used to supervise the training results to prevent overfitting, and the test data set is used for independent model performance evaluation; during the training process, the training parameters with the lowest loss value during the training process are saved as the final prediction model;

[0110] The present invention uses four evaluation indicators, including MAE mean absolute error (the average of the absolute difference between each predicted value and the actual value), RMSE root mean square error (the square root of the average of the squares of the predicted errors), rMAE relative mean absolute error and rRMSE relative root mean square error for quantitative evaluation. The expressions of the indicators used are as follows:

[0111]

[0112] Where S represents the number of samples, the subscript i represents the index of the sample, and N net Indicates the number of trees estimated by the network, N obs Indicates the number of observed trees. Generally speaking, lower MAE, rMAE, RMSE, and rRMSE values ​​indicate better counting accuracy.

[0113] As shown in Table 2, the C-U2Net model of the present invention is compared with the five mainstream network models of MCNN, CRSNet, SANet, DSNet, and TreeCountNet on the test set. MAE and RMSE are used as the main evaluation indicators to obtain the comparison results and make a comparison table of the evaluation results. On the GaoQiaoMangrove_A subset, C-U2Net has the best effect, with MAE and RMSE reaching the lowest 160.79 and 231.80, and the improvement effect is significant. Compared with the classic multi-column network MCNN, the MAE and RMSE of C-U2Net are reduced by 15.3% and 15.2%, respectively. The C-U2Net-lite lightweight model performs second, with MAE and RMSE reaching 163.23 and 235.07, respectively. The MAE and RMSE of C-U2Net without the attention mechanism reach 169.98 and 239.16, respectively, which proves the effectiveness of the MDRB and RSU modules. In the case of relatively sparse tree density Ga On the oQiaoMangrove_B subset, C-U2Net ranked among the top three with good results, with MAE and RMSE reaching 34.48 and 60.53 respectively. The above comparative experimental results verify the effectiveness of the C-U2Net model for dense mangrove counting in UAV images.

[0114] Table 2 Comparison of evaluation results of different models on the dataset

[0115]

[0116]

[0117] like Figure 9 As shown in the figure, the C-U2Net model and the C-U2Net-lite model of the present invention perform regression analysis on the GaoQiaoMangrove_A dataset, calculate the MAE, RMSE, RMAE, rRMSE indicators and the least squares linear fitting equation, and draw them into a visual scatter plot;

[0118] like Figure 10 The following table shows a visualization of the prediction results of the C-U2Net model. The first column shows the original images in the dataset, the second column shows the label density maps corresponding to these original images, and the third column shows the predicted density maps generated by the C-U2Net model training. Four test set samples, a, b, c, and d, were extracted for analysis. A comparison of the prediction results is shown in Table 3.

[0119] As shown in Table 3, in areas where mangroves are sparsely distributed, the C-U2Net model can distinguish plants at a finer granularity and roughly estimate the distribution of mangrove trees. When mangroves are sparsely distributed and relatively few in number, the prediction effect is good and the error is small. Even in scenarios where mangroves are densely distributed, the model can effectively predict samples, with the error controlled within a certain range. The network prediction results are close to the actual tree distribution.

[0120] Table 3 Comparison of prediction results

[0121]

[0122] As shown in Table 4, to evaluate the effectiveness of various optimizations in network design, the C-U2Net model was subjected to multiple ablation experiments on the GaoQiaoMangrove_A dataset. Six variants were selected for performance comparison, and the experimental results are shown in Table 4. Model A removes the MDRB module, achieving a lower MAE but with the largest number of parameters; Model B removes the RSU-L module; Model C removes the EMCAM attention mechanism from C-U2Net-lite; Model D removes the EMCAM attention mechanism from C-U2Net-lite; Model E represents the complete C-U2Net-lite model; and Model F represents the complete C-U2Net model. Since the baseline model is responsible for regressing the extracted feature maps into density maps, these cannot be removed. The experimental results show that combining the skip connection structure with both the RSU-L and EMCAM modules yields the best MAE and RMSE metrics, significantly improving model performance.

[0123] Table 4 Ablation experiment results

[0124]

[0125]

[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0129] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

[0130] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.

Claims

1. A dense mangrove counting method based on an improved U2Net model, characterized in that: The following steps are involved: Collect UAV lidar data from mangrove forest areas and construct a UAV visible light remote sensing image dataset; Build an improved U2Net model; The improved U2Net model includes an encoder, a dense skip connection module, a decoder and a salient feature map fusion module; the encoder includes: The first encoder, the second encoder, the third encoder, the fourth encoder, the fifth encoder, and the sixth encoder are arranged in order from top to bottom; the input end of the first encoder serves as the input end of the encoder, and the output end thereof is connected to the input end of the second encoder; the output end of the second encoder is connected to the input end of the third encoder; the output end of the third encoder is connected to the input end of the fourth encoder; the output end of the fourth encoder is connected to the input end of the fifth encoder; the output end of the fifth encoder is connected to the input end of the sixth encoder; and the output end of the sixth encoder serves as the output end of the encoder; The decoder comprises: The first decoder, second decoder, third decoder, fourth decoder and fifth decoder are arranged in order from bottom to top; the output end of the sixth encoder is spliced ​​with the output end of the fifth encoder, and then connected to the input end of the fifth decoder; the output end of the fifth decoder is spliced ​​with the output end of the fourth encoder, and then connected to the input end of the fourth decoder; the output end of the fourth decoder is spliced ​​with the output end of the third encoder, and then connected to the input end of the third decoder; the output end of the third decoder is spliced ​​with the output end of the second encoder, and then connected to the input end of the second decoder; the output end of the second decoder is spliced ​​with the output end of the first encoder, and then connected to the input end of the first decoder; the output end of the first decoder serves as the output end of the decoder; The fifth encoder, the sixth encoder, and the fifth decoder all include a multi-scale dilated residual module, which uses multi-scale dilated convolution and dense connections to capture feature information at different scales; The multi-scale dilated residual module includes a first dilated convolution unit, a second dilated convolution unit, a third dilated convolution unit, a fused convolution unit and a residual unit arranged in sequence from top to bottom; each dilated convolution unit is composed of a first Conv2d convolution layer, a first ReLU activation function layer, a second Conv2d dilated convolution layer and a second ReLU activation function layer, the output end of the first convolution layer is connected to the input end of the first activation function layer, the output end of the first activation function layer is connected to the input end of the second convolution layer, and the second convolution layer adopts dilated convolution with dilation ratios of 1, 2, and 3. , its output end is connected to the input end of the second activation function layer; the first, second and third dilated convolution units are connected by cascading and splicing to fuse the feature maps at different scales together, and are connected to the input end of the fused convolution unit; the fused convolution unit is composed of a 3*3 convolution layer, which fuses the output feature map of the dilated convolution unit, and its output end is connected to the input end of the residual unit; the residual unit includes a 1*1 convolution layer and an adder, which adds the input feature map to the output of the fused convolution unit through a residual connection, and the output end of the residual unit serves as the output end of the multi-scale dilated residual module; The encoder is used to extract mangrove crown feature maps containing different levels of semantic information from the UAV visible light remote sensing image dataset. The dense skip connection module is used to adjust the mangrove canopy feature map extracted by the encoder to be semantically consistent with the mangrove canopy feature map restored by the corresponding decoder and then passed to the decoder; The decoder is used to fuse the mangrove canopy feature map transmitted by the dense skip connection module with the mangrove canopy feature map output by the encoder and then output to the salient feature map fusion module; The mangrove crown feature maps of different scales output by the decoder are fused using the salient feature map fusion module to generate a saliency probability map and obtain the mangrove counting results.

2. The dense mangrove counting method based on the improved U2Net model according to claim 1 is characterized in that: The method of collecting UAV lidar data of mangrove growth areas and constructing a UAV visible light remote sensing image dataset includes: Collecting drone lidar data of mangrove growth areas; Perform two-dimensional orthophoto reconstruction on UAV lidar data and build a UAV visible light remote sensing image dataset.

3. The dense mangrove counting method based on the improved U2Net model according to claim 1 is characterized in that: The first encoder, the second encoder, the third encoder, and the fourth encoder, and the first decoder, the second decoder, the third decoder, and the fourth decoder all include an RSU-L module; the RSU-L module adopts a symmetric encoder-decoder structure with a depth of a positive integer L; The RSU-L module includes L+1 encoder units and L-1 decoder units, the input end of the first encoder unit serves as the input end of the RSU-L module, the output end of the first encoder unit is connected to the input end of the second encoder unit, the output end of the second encoder unit is connected to the input end of the third encoder unit, the output end of the third encoder unit is connected to the input end of the next-level encoder unit, and is connected in series to the input end of the L+1th encoder unit, the output feature map of the L+1th encoder unit and the output feature map of the previous-level encoder are merged and connected to the input end of the L-1th decoder unit, the output of the L-1th decoder unit and the output of the same-level encoder unit are spliced ​​and connected to the input end of the previous-level decoder unit until the input end of the second decoder unit is connected, the output feature map of the second decoder unit and the output feature map of the second encoder unit are spliced ​​and connected to the input end of the first decoder unit, and the output end of the first decoder unit serves as the output end of the RSU-L module; The first encoder unit and the second encoder unit of the RSU-L module are composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining encoder units further increase the downsampling operation; the L-1th decoder unit at the bottom of the RSU-L module is composed of an RSU residual block consisting of a Conv2d convolution layer, a BatchNorm2d normalization processing layer and a ReLU activation function layer, and the remaining decoder units further increase the upsampling operation.

4. The dense mangrove counting method based on the improved U2Net model according to claim 1 is characterized in that: The RSU-L module and the multi-scale dilated residual module each further include an EMCAM multi-scale convolutional attention module, and the EMCAM multi-scale convolutional attention module includes a channel attention block, a spatial attention block and a multi-scale convolution block arranged in sequence; The channel attention block includes an average pooling layer, a maximum pooling layer, a convolution layer and a Sigmoid function. Its input is a multi-channel image feature map. The average pooling and maximum pooling results of the input feature map are calculated as the input of the convolution layer. Then, the two pooling results are respectively applied with 1*1 convolution, ReLU activation function and 1*1 convolution, and then added together and passed through the Sigmoid function to obtain the final attention weight. Finally, the final attention weight is multiplied with the input feature map to obtain the channel attention feature map; The spatial attention block includes an average pooling layer, a maximum pooling layer, a convolution layer, and a Sigmoid function. It receives the channel attention feature map output by the channel attention block as input, connects the input ends of the average pooling layer and the maximum pooling layer respectively, and calculates the average pooling result and the maximum pooling result of the input feature map. The pooling operation is performed along the channel dimension, and the outputs of the average pooling layer and the maximum pooling layer are spliced ​​along the channel dimension to form a new feature map. After applying convolution to the concatenated feature map, the spatial attention weight is obtained through the Sigmoid function. Finally, the spatial attention weight is multiplied by the input feature map to obtain the spatial attention feature map. The multi-scale convolution block receives the output of the spatial attention block as input, first performs channel expansion through a 1*1 point convolution layer, then uses multi-scale depth convolution with convolution kernel sizes of 1*1, 3*3, and 5*5 to process the expanded feature map, adds the processed feature maps of different scales, and finally adjusts the number of channels of the feature map to the number of channels of the input feature map of the multi-scale convolution block through a 1*1 point convolution layer, and its output is used as the output of the EMCAM multi-scale convolution attention module.

5. The dense mangrove counting method based on the improved U2Net model according to claim 4 is characterized in that: The dense skip connection module includes: a first bridge, a second bridge, a third bridge, a fourth bridge, a fifth bridge, and a sixth bridge; The input end of the first bridge serves as the input end of the dense skip connection module and is connected to the output ends of the first encoder and the second encoder respectively, and its output end is connected to the input end of the second decoder and the second bridge respectively; the input end of the second bridge is connected to the output ends of the first bridge and the fourth bridge respectively, and its output end is connected to the input end of the second decoder and the third bridge respectively; the input end of the third bridge is connected to the output ends of the second bridge and the fifth bridge respectively, and its output end is connected to the input end of the second decoder; the input end of the fourth bridge is connected to the output ends of the third encoder and the fourth encoder respectively, and its output end is connected to the input end of the fifth bridge, the third decoder, and the second bridge respectively; the input end of the fifth bridge is connected to the output ends of the fourth bridge and the sixth bridge respectively, and its output end is connected to the input end of the third bridge and the third decoder respectively; the input end of the sixth bridge is connected to the output ends of the fourth encoder and the fifth encoder respectively, and its output end is connected to the input end of the fifth bridge and the fourth decoder respectively; The first bridge, the second bridge, the third bridge, the fourth bridge, the fifth bridge and the sixth bridge each include a multi-scale dilated residual module.

6. The dense mangrove counting method based on the improved U2Net model according to claim 1 is characterized in that: The salient feature map fusion module receives the output feature maps from the first decoder, the second decoder, the third decoder, the fourth decoder, the fifth decoder and the sixth encoder as its input, processes them through a 3*3 convolution kernel as the input of the bilinear interpolation method, and upsamples the processed feature maps using the bilinear interpolation method to obtain an output saliency probability map; then, the output saliency probability map is subjected to a feature map splicing operation according to the channel dimension, and the spliced ​​saliency probability map is processed through a 1*1 convolution layer and a Sigmoid activation function to obtain a final saliency probability map.

7. The dense mangrove counting method based on the improved U2Net model according to claim 1 is characterized in that: The loss function of the improved U2Net model is: ; ; ; in, To improve the loss function of the U2Net model, is the Euclidean distance loss function, is the multi-scale density level consistency loss function, To adjust the coefficient of the relative weight of the two component losses, is the number of pictures, i is the picture number, For pictures The predicted density map of is the true density map, is the number of scale levels, j is the scale level number, is the average pooling operation, Set output size for average pooling.

Citation Information

Patent Citations

  • Intestinal tract lesion segmentation method combining multi-scale U-shaped residual encoder and overall reverse attention mechanism

    CN112712528A

  • Reservoir water body extraction method based on remote sensing image

    CN114821295A