# Uncertainty-Aware Adaptive Multiscale U-Net for Low-Contrast Cardiac Image Segmentation
## 2 Materials and Methods
### Dynamic Saliency U-Net
#### 2.2.2 Adaptive Feature Decoder Block (AFDB)  
Adaptive Fusion Attention Block (AFAB)  
The AFAB block consists of local and global attention modules to effectively handle complex patterns in medical images, addressing the limitations of traditional global attention approaches like the SE module. Both global and local attention modules are implemented in parallel to extract features simultaneously. The detailed structure of the proposed AFAB block is shown in Figure 5.  
1. Local Attention Block: The local attention module in our proposed AFAB block focuses on capturing the fine-grained, regional characteristics of the image, which is essential  
Figure 4: Overall structure of AFDB used in our proposed AMU-Net. Figure 5: Illustration of Adaptive Fusion Attention Block. to preserve local spatial details. The input undergoes adaptive average pooling in two dimensions, separately. \[X_{h}=\text{Pool}_{h}(X),\quad X_{w}=\text{Pool}_{w}(X) \tag{17}\]  
The module employs a series of dynamic convolution operations to process the pooled inputs. These convolutions adaptively process features, considering spatial dimensions separately. \[Y_{h}=\text{DMConv}(X_{h}),\quad Y_{w}=\text{DMConv}(X_{w}) \tag{18}\]  
Each convolution layer is first concatenated followed by batch normalization and an ReLU activation function, enhancing the model's nonlinearity and stability during training. \[Y=ReLU(BN(DWConv(\text{cat}(Y_{h},Y_{w})))) \tag{19}\]  
The output from the activation operation is then split again followed by dynamic convolution and sigmoid function prior to the integration of global attention module. \[Y_{h},Y_{w}=\text{Split}(Y) \tag{20}\] \[A_{h}=\sigma(\text{Conv}_{h}(Y_{h})),\quad A_{w}=\sigma(\text{ Conv}_{w}(Y_{w}))\] \[A_{\text{local}}=A_{h}\odot A_{w}\]  
A channel self-attention (CSA) mechanism is also introduced by initializing it as a learnable parameter with dimensions equal to the number of input channels as follows:  
\[\omega=\text{ Parameter(zeros }(X)) \tag{21}\]  
\(\omega\) is normalized across using the SoftMax function and applied to the feature maps from the local attention module. Figure 4:0 Figure 4:1  
2. Global Attention Module: The global attention module focuses on extracting broader, more holistic features. The module uses a global average pooling layer followed by three dynamic convolution layers. A batch normalization and ReLU activation function are used after the first two convolution layers in the global branch to ensure the effective propagation of nonlinear features. The output from the third dynamic convolution layer is then passed through a sigmoid function to produce global attention output. This operation is responsible for the extraction of global contextual information from the entire input feature map. Figure 4:2 Figure 4:3  
We also introduce a learnable weight to balance the contributions of the global and local attention outputs. This parameter adjusts how much of each attention type is reflected in the final output. The final output of AFAB is then calculated as follows:  
Figure 4:4where \(\alpha\) is the learnable combination weight. Weighted Fusion (WF)  
The WF module is implemented to facilitate the effective integration of feature maps from encoder layers. This module employs a set of operations orchestrated to optimize the merging of spatial and channel-wise information, resulting in a superior representation of features. The WF module is equipped with a convolutional layer that serves to align the channel dimensions of the residual feature map with the target feature space. This alignment is critical for ensuring that subsequent operations within the module can be executed without dimensionality conflicts. The core of the WF module is maintained by a pair of learnable parameters, which are formulated to dynamically adjust the influence of each feature source during the fusion process. These weights are constrained by an ReLU activation function to ensure that they remain non-negative throughout the training phase.