# Water Segmentation for Unmanned Ship Navigation Based on Multi-Scale Feature Fusion
## 2 The Fuse-ResNet Network Model
### Attention Enhancement Encoder  
In the onboard processing of waterbody images for the navigation of an unmanned vessel, the segmentation model is vulnerable to the background noise, such as light changes and shore reflections. In order to minimize the impact of noise, an attention-enhanced encoder is incorporated into the Fuse-ResNet architecture, allowing the network to focus more effectively on target feature regions during feature extraction, while suppressing irrelevant background features. This attention-enhanced encoder integrates an attention module, CBAM, to enhance target features extracted from multi-scale feature maps by the backbone network. The CBAM consists of a channel attention mechanism and a spatial attention mechanism, which, respectively, enhance the model's focus on target regions along the channel and spatial dimensions. The implementation process of the attention mechanism is illustrated in Figure 2.  
The channel attention module compresses the feature map along the spatial dimension and learns the global characteristics of the entire image in the channel dimension. After  
Figure 1: The Fuse-ResNet structure.  
Figure 2: Attention mechanism realization process.  
obtaining the weight parameters for each channel, these weights are multiplied by the input features \(F\in R^{C\times H\times W}\) to generate a weighted feature map, thereby achieving feature recalibration along the channel dimension, such that  
\[F^{\prime}=M_{c}(F)\otimes F \tag{1}\]  
where \(F\) is a feature map of size (H \(\times\) W \(\times\) C), \(\otimes\) denotes element-by-element multiplication, \(M_{c}\) represents a channel attention map, and \(F^{\prime}\) is an(1) output feature map after an attention mechanism.  
Figure 3 shows the implementation process of the channel attention module. The feature map F is used as the input to the channel attention module before applying the global average pooling and global maximum pooling operations to obtain the average pooled feature \(F^{c}_{avg}\) and the maximum pooled feature \(F^{c}_{\max}\), respectively. The outputs are then summed by the multilayer perceptron (MLP) in parallel, and the Sigmoid activation function is used to obtain the weight parameters from 0 to 1, and the final generation of the attentional channel map \(M_{c}\), such that  
\[M_{c}(F)=\sigma(MLP(F^{c}_{avg})+MLP(F^{c}_{\max})) \tag{2}\]  
where \(F^{c}_{avg}\) is global average pooling, \(F^{c}_{\max}\) denotes global maximum pooling, \(MLP\) is the multilayer perceptron processing, and \(\sigma\) represents a Sigmoid activation function.  
Subsequently, the generated attention channel map \(M_{c}\) is used as the input to the spatial attention module, and Figure 4 shows the implementation process of the spatial attention module. In this module, the global average pooling and global maximum pooling operations are performed on the input features \(F^{\prime}\), respectively, to obtain the average pooled feature map \(F^{s}_{avg}\) and the maximum pooled feature map \(F^{s}_{\max}\) of both sizes \(1\times H\times W\). The two feature maps are then stacked and applied with the convolution kernel of \(7\times 7\) (defined as \(f^{7\times 7}\)) to adjust the number of channels. The weight of each feature point on the feature map is then adjusted to 0-1 using the Sigmoid activation function, and the feature map \(M_{s}(F^{\prime})\) can be obtained with weight coefficients, such that  
\[F^{\prime\prime}=M_{s}(F^{\prime})=\sigma(f^{7\times 7}(F^{s}_{avg};F^{s}_{ \max})) \tag{3}\]  
Finally, the weighted feature map \(M_{s}(F^{\prime})\) is further multiplied with the input feature map \(F^{\prime}\) to obtain the feature map \(F^{\prime\prime}\) with spatial attention.  
Figure 4: Mechanisms of spatial attention.  
Figure 3: Channel attention mechanism.