## 2 Methodology
### Attention Block  
As shown in the part on multiscale feature extraction in Figure 1, \(X^{0,1}\), \(X^{0,2}\), \(X^{0,3}\) and \(X^{0,4}\) represent the four predicted feature maps generated by the UNet++, respectively. In the traditional UNet++, the four feature maps are directly concatenated by an averaging operation, which will suppress the better feature maps and raise the negative feature maps on the final output. The reasons may be as follows: for the extracted hierarchical semantic features, the low-level feature maps have poor semantic information but rich spatial location information for the small receptive field, whereas the high-level feature maps have strong semantic information but weak spatial location information because of the large receptive field. Hence, feature maps from different levels should be concatenated discriminately to make networks allocate reasonable attention to the high-level and low-level features. Furthermore, it is necessary to emphasize the important parts and suppress the unimportant parts due to the extracted features that are often spatially affected by similar patterns and noisy backgrounds. Thus, in this paper, in order to select representative features when fusing different level feature maps, we assigned weights to different-layer feature maps as their relative importance in the channel dimension and sub-features in the spatial dimension. Thus, inspired by the great progress in attention mechanisms of neural networks, CBAM was introduced in our proposed network to learn which information to emphasize or suppress, which is a sequential combination of a channel and a spatial attention module (as shown in the attention block in Figure 1). As shown in Figure 2, given the predicted feature map \(F\in\mathbb{R}^{C\times H\times W}\) generated from the multiscale features extraction module, \(N=H\times W\) denotes the number of spatial pixels, and \(C\) is the dimension of the feature map. Figure 2: The channel attention mechanism. The channel attention explores 'what' is useful in an input image by exploiting the inter-channel relationships of features. Firstly, two descriptors including average-pooled features \(\rm F_{AVG}^{C}\) and max-pooled features \(\rm F_{MAX}^{C}\) are generated by using global average-pooling and global max-pooling for aggregating the global information of each channel and clues about distinctive object features, respectively. The two descriptors are then forwarded to a shared multi-layer perceptron (MLP) (as shown in Figure 3) to produce two vectors, which are next merged by an element-wise sum and finally output the channel attention map \(\rm M_{c}(F)\):  
\[\rm M_{c}(F)=Sigmoid(a_{1}(a_{0}(F_{AVG}^{C}))+a_{1}(a_{0}(F_{MAX}^{C})) \tag{2}\]  
where \(\rm a_{0}\) and \(\rm a_{1}\) denote the MLP weights. The spatial attention explores 'where' the informative regions that should be paid more attention are, just as illustrated in Figure 4. Firstly, based on the channel refined feature F', average-pooled features \(\rm F_{AVG}^{S}\) and max-pooled features \(\rm F_{MAX}^{S}\) across the channel are generated by performing average-pooling and max-pooling for aggregating the channel information, respectively. Then, they are concatenated and convolved by a standard \(7\times 7\) convolution layer, producing the spatial attention map:  
\[\rm M_{s}(F)=Sigmoid(f^{7\times 7}([F_{AVG}^{S};F_{MAX}^{S}])) \tag{3}\]  
where \(f^{7\times 7}\) denotes a convolution operation with size of \(7\times 7\). Figure 4: The spatial attention mechanism. Figure 3: The multi-layer perceptron (MLP) consisting of two convolution layers with a filter size of 1. Then, the CBAM sequentially infers the channel attention map \(\text{M}_{\text{c}}\in\text{R}^{\text{C}\times 1\times 1}\) and the spatial attention \(\text{M}_{\text{s}}\in\text{R}^{1\times H\times W}\), and the total attention process can be written as:  
\[