## 2 Materials and Methods
### Method
#### 2.4.4 Semantic Decoder
ECA focuses more on important features at lower levels and enhances shallow features' representation capability for targets. Therefore, this paper added 3 ECA modules to feature pyramid modules at different scales to enhance the importance of useful channels in the first three layers of pyramid fusion modules, achieving quick and accurate localization of useful channels. The specific structure of ECA is shown in Figure 8.  
Specifically, for an input feature map \(\chi\), with dimensions C \(\times\) H \(\times\) W (channels \(\times\) height \(\times\) width), the ECA attention mechanism processing flow is as follows. First, through Global Average Pooling (GAP), the features are compressed into a 1 \(\times\) 1 \(\times\) C vector, achieving global spatial information aggregation for each channel. Then, the module adaptively determines the size of the one-dimensional convolution kernel \(\mathbf{k}=\psi(\text{C})\) (5 in this paper) based on the number of channels C, used to control the range of local cross-channel interactions. Channel-wise local information interaction is achieved through one-dimensional convolution operations, a design that obtains channel dependencies without dimensionality reduction. Finally, channel attention weights are generated and interacted with the original feature map, with the calculation process shown in Formula (3):  
\[\widetilde{\chi}=\chi\cdot\sigma(\text{C1D}_{k}(\text{GAP}(\chi))) \tag{3}\]  
where \(\chi\) is the input feature map, \(\sigma(\cdot)\) is the sigmoid activation function, \(\text{C1D}_{k}(\cdot)\) represents a one-dimensional convolution layer with kernel size \(K\), and \(\text{GAP}(\cdot)\) is the Global Average Pooling layer. This method achieves adaptive adjustment of different channel importance, not only with high computational efficiency but also effectively capturing channel dependencies, enhancing the network's response capability to key mangrove features. During the bottom-up downsampling process in the CPFM module, semantic features of small-sized mangrove targets are rapidly lost through layer-by-layer downsampling, resulting in less distinct semantic information in top-layer features. To address this issue, this paper introduces the LSK (Large Selective Kernel) module at the top layer of the feature pyramid. This module works collaboratively with PPM through a spatial selection mechanism, dynamically adjusting feature receptive fields and weighted merging of features processed by deep kernel sequences, with kernel weights determined adaptively based on input. This design enables the model to flexibly utilize convolution kernels of different sizes, specifically adjust the spatial receptive field of deep targets, and further aggregate top-layer context information through cascade fusion with PPM, significantly enhancing the network's ability to extract high-level semantic features of mangroves in deep layers. The specific structure is shown in Figure 9.  
Figure 8: ECA Channel Attention Module Structure. Specifically, the design of the LSK module encompasses three core phases: decomposition, fusion, and selection. During the decomposition phase, large-receptive-field convolution operations are decomposed into multiple small-sized convolution kernels with different dilation rates. This design maintains the original overall receptive field range while providing the network with multiple receptive field options at different scales. The kernel size \(k\), dilation rate \(d\), and receptive field \(RF\) expansion of the \(i\)-th convolution are defined as shown in Equations (4) and (5):  
\[k_{i-1}\leq k_{i},d_{1}=1,d_{i-1}<d_{i}\leq RF_{i-1} \tag{4}\]  
\[RF_{1}=k_{1},RF_{i}=d_{i}(k_{i}-1)+RF_{i-1} \tag{5}\]  
By adjusting the combination of convolution kernel size and dilation rate, different sizes of receptive fields can be flexibly obtained. To avoid sampling gaps in the feature maps caused by dilated convolutions, a reasonable upper limit is set for the dilation rate.