## 2 Materials and Methods
### Lightweight Design of the Water Body Segmentation Network
#### 2.4.1 Encoder Based on CADCN  
To enhance the model's ability to extract water bodies with complex shapes, highly variable sizes, and spatial distributions in agricultural watersheds, this study designed a lightweight backbone network. The core of this network lies in constructing an efficient  
Figure 5: Overall architecture of the proposed lightweight LKF-DCANet. CADCN feature extraction block. Specifically, the encoder adopts a four-layer downsampling structure. In each layer, the resolution of the feature map is gradually reduced by max pooling and \(1\times 1\) convolution. At the same time, the feature expression is enhanced by increasing the number of channels. The preliminary feature extraction module uses \(3\times 3\) convolution, batch normalization, and the GELU (Gaussian Error Linear Unit) activation function to map the three channels of the RGB image into 16 channels and achieve preliminary downsampling. Subsequently, multi-scale features are extracted layer by layer through four CADCNs. The number of output channels is 16, 32, 64, and 128 in sequence. Compared with the existing mainstream segmentation architectures, the number of network layers and channels is significantly reduced, thus effectively reducing the number of parameters. The CADCN consists of a \(1\times 1\) convolution, a deformable convolution [50], batch normalization, a GELU activation function, and a Convolutional Block Attention Module (CBAM) channel attention sub-module (CA) [51]. Among them, the deformable convolution technology breaks the limitations of the fixed sampling grid by introducing dynamic offset values, enabling the convolution kernel to adaptively adjust the sampling positions according to the spatial distribution of the input features. In this way, it can more accurately capture the geometric features of water bodies in agricultural watersheds, as shown on the left side of Figure 5c. The red boxes in the figure represent the dynamically sampled locations guided by learned offsets. Inspired by the multi-head self-attention mechanism, the deformable convolution module divides the spatial aggregation process into multiple groups. Each group independently predicts the sampling offset values and modulation scalars, enabling the learning of rich features from multiple subspaces, as shown in Figure 6. At the same time, a separable convolution strategy is adopted, in which the depthwise convolution is responsible for position-aware modulation, and the pointwise convolution shares the projection weights among the sampling points, thus significantly reducing the number of parameters and memory overhead. Apply softmax normalization constraints to each sampling point to ensure that the sum of the modulation scalars is 1 so as to improve the training stability under different model scales. The specific calculation expression is  
\[y(p_{0})=\sum_{g=1}^{G}\sum_{k=1}^{K}w_{g}m_{gk}x_{g}\left(p_{0}+p_{k}+\Delta p _{gk}\right) \tag{6}\]  
where \(G\) is the number of aggregation groups, and \(K\) is the number of sampling points per group. \(w_{g}\) denotes the shared projection weight of group \(g\), and \(m_{gk}\) is the modulation factor for the \(k\)-th point in group \(g\). \(x_{g}\) is the input feature map, \(p_{0}\) is the current position, \(p_{k}\) is the sampling offset, and \(\Delta p_{gk}\) is its additional offset. \(y(p_{0})\) indicates the output feature at position \(p_{0}\). Figure 6: Illustration of \(3\times 3\) deformable convolution. However, although deformable convolution alone performs excellently in adapting to spatial transformations, its ability to model the differences in features among different channels is relatively insufficient. To this end, we introduced the channel attention submodule (CA) of CBAM into the CADCN. Through two strategies of global average pooling and global max pooling, each channel is adaptively weighted and then, respectively, passed through a dimensionality reduction fully connected layer and a ReLU activation function.