## 2 Materials and Methods
### Deep Water Body Segmentation Network
#### 2.3.1 Learnable Kalman Filter Module  
The Kalman filter is a recursive method for state estimation that combines prior predictions with current observations through a two-step process: prediction and update [46; 47; 48]. While effective in linear systems, it struggles with nonlinear scenarios and requires manual parameter tuning. In this work, we adapt the Kalman Filter into a learnable, spatially aware module suitable for remote sensing image segmentation. To enhance the model's ability to cope with noise interference during feature decoding, we serialize the two-dimensional feature map and regard each row as a one-dimensional sequence. In this sequence, the pixels are dynamically modeled by the LKF module according to the spatial adjacent order. The Kalman module predicts the state \(\hat{x}_{k|k-1}\) at the current position based on the state estimate \(\hat{x}_{k-1|k-1}\) at the adjacent position and adaptively corrects the prediction result by combining it with the actual observation value \(z_{k}\) in the input feature map. Through this spatially ordered recursive mechanism, the model can effectively enhance its robustness against interference factors while maintaining the continuity of the local structure, providing a more stable and accurate feature representation for subsequent segmentation tasks. To implement this recursive mechanism, we designed an LKF module by embedding the classical prediction-update structure of the Kalman filter into a deep neural network. The core of it lies in transforming the state transition matrix \(F_{k}\), the observation matrix \(H_{k}\), the process noise covariance matrix \(Q_{k}\), and the observation noise covariance matrix \(R_{k}\), which rely on statistics and manual settings in the traditional Kalman filter into matrices whose parameters can be learned and updated through a deep neural network. Through backpropagation, dynamic optimization is carried out during the training process, enabling the filter to adaptively adjust the state estimation, as shown in Figure 4.  
Figure 3: Architecture of the deep network based on MobileNetV2. (1) State Prediction Phase in LKF  
In our framework, the input feature map is serialized along the spatial dimension, and each pixel is processed sequentially based on its adjacent spatial positions. At each step, the module treats the input feature at the previous position \(z_{k-1}\) as the current observation for initialization. During the prediction phase, the state estimation \(\hat{x}_{k|k-1}\) and the associated error covariance \(P_{k|k-1}\) are predicted via matrix operations, as shown in Equation (1). A learnable state transition matrix \(F_{k}\) models the spatial evolution of features between adjacent positions, allowing the previous state estimation \(\hat{x}_{k-1|k-1}\) to be propagated forward. Simultaneously, a learnable process noise covariance matrix \(Q_{k}\) is introduced to account for uncertainties in the prediction:  
\[\left\{ \begin{aligned} \hat{x}_{k|k-1}=F_{k}\hat{x}_{k-1|k-1}\\ P_{k|k-1}=F_{k}P_{k-1|k-1}F_{k}^{T}+Q_{k}\end{aligned} \right. \tag{1}\]  
where \(\hat{x}_{k-1|k-1}\) denotes the updated state estimation at the adjacent previous position (initialized as a zero tensor), and \(\hat{x}_{k|k-1}\) represents the predicted state at the current spatial position. \(P_{k-1|k-1}\) is the posterior error covariance matrix at the previous position, initialized as 0.1I, with I being the identity matrix. (2) State Update Phase in LKF  
In the update phase, the module refines the predicted state using the actual feature observation \(z_{k}\) at the current spatial position. The state is mapped to the observation space through the learnable observation matrix \(H_{k}\) to ensure an effective connection between the predicted state and the actual observation value. Use the learnable observation noise covariance matrix \(R_{k}\) to quantify the noise level in the observation data and determine the extent of the influence of the observation value on the state update.