# DMLU-Net: A Hybrid Neural Network for Water Body Extraction from Remote Sensing Images
## 2 Proposed Method
### DMLKA Module  
In the task of water body extraction from remote sensing imagery, multi-scale feature learning and attention mechanisms serve as critical factors for enhancing segmentation performance. Multi-scale features help the model to quickly obtain key information, reduce training difficulty, and minimize training costs; the attention mechanism helps the network to focus on key information and reduce or ignore the impact of irrelevant information on the final result. Previous studies in the field of object detection often use various attention mechanisms, including channel attention (CA) and self-attention (SA), to obtain more information features. However, the CA and SA methods only consider the attention results in a fixed mode and cannot further absorb local information or random dependencies. Inspired by research in the fields of object detection and visual attention [31; 32], to further improve the model's focus on important scale information and its anti-interference ability, we propose an innovative neural network module--dynamic multi-scale local kernel attention (DMLKA)--by combining multi-scale local kernel attention (MLKA) and a dynamic weight adjustment mechanism. DMLKA combines multi-scale local kernel convolution (MLKA) and a dynamic weight generator, which captures local details and long-range dependencies through multi-scale large-kernel convolution, and it adaptively adjusts the importance of features at different scales through a dynamic weight mechanism, thereby significantly improving the model's perception and extraction abilities of multi-scale water bodies in complex scenes. The structure of the DMLKA module is shown in Figure 2.  
Specifically, DMLKA consists of four main functions: a normalization layer (layer normalization); large-kernel attention (LKA) to establish mutual dependencies; a multi-scale convolution mechanism to acquire cross-scale information; and a dynamic weight allocation mechanism. Normalization layer (layer normalization): To ensure the distribution consistency of input features, we introduce layer normalization (LN) at the module entrance. The specific implementation is as follows:  
\[x=\frac{x-u}{\sqrt{s+\varepsilon}}\times a+b \tag{1}\]  
Here, \(u\) and \(s\) are the mean and variance of each channel; \(a\) and \(b\) are learnable parameters; and \(\varepsilon\) is a numerical stability term. Each channel is independently normalized by the mean and standard deviation. Large-kernel attention: As shown in Figure 2, for a given input feature map (C, H, and W are the number of channels, width, and height, respectively), LKA performs convolution operations through a single depth-wise convolution layer and a three-layer cascaded convolution module to adaptively extract features. The three-layer cascaded convolution includes a \((2d-1)\times(2d-1)\)-sized depth-wise convolution (\(f_{DW}\)), a \((k/d)\times(k/d)\)-sized depth-wise d-dilation convolution (\(f_{DWD}\)), and a point-wise convolution (\(f_{PW}\)), where \(K\) and \(d\) are the convolution layer parameters. The calculation formula of the three-layer cascaded convolution can be expressed as follows:  
\[LKA(X)=f_{PW}(f_{DWD}(f_{DW}(X))) \tag{2}\]  
Multi-scale convolution mechanism: To learn the attention map of full-scale information, a multi-scale mechanism is used to improve the flexibility of the convolution layer. Assuming that the input feature is \(X\in R^{N\times C\times H\times W}\), the module first splits it into n sub-features with a scale of \(C\times H\times W/n\). For the \(i\)-th group of features \(X_{i}\), an LKAi determined using the parameters \(\{K_{i},d_{i}\}\) is used to generate the corresponding uniform scale feature map. Dynamic weight allocation mechanism: After the data pass through the MLKA module, they are weighted by a variable weight layer. Specifically, adaptive global average pooling (AdaptiveAvgPool2d) is employed to compress feature maps into channel-wise statistical descriptors.