# MDA-Unet: A Multi-Scale Dilated Attention U-Net for Medical Image Segmentation
## 3 Proposed Model
### Multi-Scale Spatial Attention Module (MSAM)  
Spatial attention modules hold a few additional parameters that focus on 'where' an informative part is. They are lightweight models which enhance important spatial features and suppress less important ones, thereby improving the network's interpretability and reducing the computation complexity [12]. They produce refined features by inferring an attention map along the features' spatial dimension and multiplying it with the input features. Figure 1: Overview of our proposed Multi-scale dilated attention model (MDA-Unet). According to [13], using dilated convolution facilitates constructing a more effective spatial map and allows an exponential expansion of the receptive field, which enables the spatial attention module to seamlessly aggregate enriched contextual information. In this regard, we propose our multi-scale spatial attention module (MSAM), illustrated in Figure 3. It aggregates spatial features from different spatial locations derived by a hybrid hierarchical dilated convolution module (HHDC). This module further enhances the effectiveness of the spatial attention map in localizing objects at different scales (explained in details in Section 4). Given the encoder feature map \(F_{e}\in R^{\mathbb{C}\times H\times W}\) as input, MSAM infers a 2D multi-scale spatial attention map \(M_{s}\in R^{1\times H\times W}\), and the produced refined feature is:  
\[F_{e}^{\prime}=M_{s}(F_{e})\otimes F_{e} \tag{3}\]  
To compute the multi-scale spatial attention map, average-pooling and max-pooling are simultaneously applied to the input encoder features along the channel axis to produce two different spatial context descriptors: \(F_{agg}^{s}\in R^{1\times H\times W}\) and \(F_{max}^{s}\in R^{1\times H\times W}\). Then, both feature descriptors are concatenated and passed to the HHDC module, followed by a  
Figure 3: Overview of our proposed Multi-scale spatial attention module (MSAM). HHDC is the proposed Hybrid Hierarchical Dilated Convolution module. ‘\(\times\)’ is element-wise multiplication. Figure 2: Building blocks: (**a**) U-Net basic building block; (**b**) Residual block. ‘+’ represents element-wise addition. sigmoid function to obtain the final multi-scale 2D spatial attention map. Afterward, the input encoder feature is then multiplied with the multi-scale 2D spatial attention map to obtain the final refined encoder feature. The spatial attention map is computed as follows:  
\[M_{s}(F_{e})=\sigma(HHDC([AvgPool(F_{e});MaxPool(F_{e})])) \tag{4}\]  
where \(\sigma\) denotes the sigmoid function, and \(HHDC\) denotes the Hybrid hierarchical dilated convolution with multiple dilation rates (i.e., 1, 2, and 3). The functionality of the average-pooling operation is to give feedback on all points from each feature map during the gradient backpropagation, while the max-pooling operation gives feedback only where the response is greatest in the feature map in the backpropagation process [31]; thus, both operations effectively highlight informative regions. Previous attention modules, such as CBAM [12] and BAM [13], increase the receptive field by applying either a \(7\times 7\) convolution or 2 consecutive dilated convolution operations, respectively. We argue that using a large-sized kernel as in CBAM emphasizes the attention on large-scale features, discarding small ones. In addition, a gridding artifact problem may occur in BAM due to the consecutive use of two dilated convolutions with the same dilation rate. According to [32], using consecutive dilation rates with a common factor makes the convolution kernel too sparse to cover any local information, missing the details of very small objects in the image. In contrast, we leverage multi-scale information by forwarding the concatenated features to the HHDC module, which encodes effective multi-scale spatial features to emphasize important spatial information from different receptive fields.