# Water Segmentation for Unmanned Ship Navigation Based on Multi-Scale Feature Fusion
## 2 The Fuse-ResNet Network Model
### Multi-Scale Feature Fusion Decoder  
Water images often contain many background elements, such as trees, buildings, and bridges, where the boundaries between the water and the shore are often unclear. If segmentation relies solely on high-level semantic features extracted by the model, the complex background usually misleads the model to cause segmentation errors. A multi-scale feature fusion decoder is designed to address these issues by combining the ASPP module with the FPN. The ASPP module utilizes atrous convolution to expand the receptive field of the model, further extracting multi-scale contextual information from the image to capture features ranging from local details to global backgrounds [20]. In this way, the multi-scale information is fused by the FPN to generate feature maps with richer information. The implementation process of the multi-scale feature fusion decoder is illustrated in Figure 5.  
The water image is extracted through four stages of the encoder to obtain the feature map, \(F=\{F_{1},F_{2},F_{3},F_{4}\}\), as the input for the decoder, where each residual block stage performs down-sampling and convolution operations on the input image. In this way, the resolutions of the output feature map \(F_{i}\) become \(\{1/4,1/8,1/16,1/32\}\) of the original image, respectively, and the numbers of output channels will be [256; 512; 1024; 2048], respectively.  
In order to extract the context information of different multi-scale features, the feature map \(F_{i}\) is fed into the ASPP module before multi-scale fusion. The ASPP module shown in the left dashed box in Figure 5 includes one \(1\times 1\) convolution, three \(3\times 3\) dilated convolutions (whose expansions are \(6\), \(12\), and \(18\), respectively), and one global average pooling. The \(1\times 1\) convolution adjusts the number of channels of the input features. The three dilated convolutions with different expansion rates are responsible for extracting multi-scale features, and the global average pooling adjusts the number of channels by a \(1\times 1\) convolution so as to unify the number of output channels. Linear interpolation is used to generate the output with the same dimension as the original input before adding all the five extracted feature maps, and the number of channels can be recovered by using \(3\times 3\) convolutions.  
In order to fuse all the feature maps, \(F_{i}\) is applied with a \(1\times 1\) convolution operation to adjust the number of channels to \(512\), and the feature map of \(P=\{P_{1},P_{2},P_{3},P_{4}\}\) can obtained. The higher-scale features, such as \(P_{4}\), are up-sampled by a factor of \(2\) and are added pixel-by-pixel to the lower-scale features, such as \(P_{3}\), and in this way, a fused feature of \(C=\{C_{1},C_{2},C_{3}\}\) can be obtained. Finally, the outputs of all scales of the FPN are up-sampled by \(\{1,2,4,8\}\) to one-fourth of the original image size, respectively, and each of the output features is stitched together after a \(3\times 3\) convolution to obtain the fused feature map in the channel dimension.  
Figure 5: Multi-scale feature fusion decoder.