# Uncertainty-Aware Adaptive Multiscale U-Net for Low-Contrast Cardiac Image Segmentation
## 2 Materials and Methods
### Dynamic Saliency U-Net  
#### 2.2.1 Contextual Dynamic Encoder (CDE)  
The CDE is proposed to enhance feature extraction from the medical images and suppress background information. We have proposed a Modulated Predictive Coding Module into the encoder block to improve feature extraction capabilities, drawing inspiration from the neuroscientific theories of image processing in the human brain's visual cortex [32,33]. This module is designed to mimic the hierarchical and predictive nature of visual perception, thereby enhancing the encoder's ability to capture complex patterns and structures inherent in medical images. Two integral parts of our model are the dynamic and deformable convolution layers [34,35]. Dynamic convolution improves feature extraction by replacing a single convolution kernel per layer with multiple parallel convolution kernels of the same size and input/output dimensions. Inspired by squeeze-and-excitation blocks, it generates attention weights for different convolution kernels based on the input features. These attention weights dynamically adjust the contribution of each kernel, and the final output is obtained by aggregating them via a weighted summation:  
\[Y=\sum_{k=1}^{K}\alpha_{k}(X)*W_{k} \tag{1}\]  
where \(\alpha_{k}(X)\) represents the dynamically generated attention weights for each kernel \(W_{k}\), and * denotes the convolution operation. Therefore, this approach can improve the model's flexibility in processing complex medical image patterns. Deformable convolution improves traditional convolution by introducing learnable offsets that modify the regular sampling grid R used in standard convolution. A standard 2D convolution can be formulated as:  
\[y(p_{0})=\sum_{p_{n}\in R}w(p_{n})\cdot x(p_{0}+p_{n}) \tag{2}\]  
where R defines the receptive field and dilation, and \(w(p_{n})\) represents the convolution kernel weights. In deformable convolution, additional offsets \(\Delta p_{n}\) are added to allow dynamic adjustment of the sampling positions:  
\[y(p_{0})=\sum_{p_{n}\in R}w(p_{n})\cdot x(p_{0}+p_{n}+\Delta p_{n}) \tag{3}\]  
Figure 1: Overall structure of AMU-Net for medical image analysis. where offsets \(\Delta p_{n}\) are learned through additional convolution layers, which enables the model to capture geometric transformations and improve segmentation performance in irregular structures, which is very useful in medical imaging due to the requirement for spatial adaptability for accurate segmentation. Figure 2 illustrates the architecture of the CDE block and the Modulated Predictive Coding Module (MPCM). In Figure 1(a), the CDE block is composed of multiple MPCM modules and a Dynamic Multi-Scale Attention (DMSA) module. The MPCM modules are used for hierarchical feature extraction using deformable convolutions with kernel sizes \(1\times 1\) and \(3\times 3\). These layers process the input sequentially to enhance feature representation while suppressing irrelevant background noise. The DMSA module focuses on refining the extracted features by applying adaptive attention mechanisms across multiple spatial scales to improve the encoder's ability to capture multiscale information. Figure 1(b) shows the architecture the MPCM, which is processed through multiple stages, including the computation of the previous layer's representation, \(r_{(l-1)}\), via deformable convolution and ReLU activation. The modulation weights (MWs) are computed dynamically to scale the features to enable context-aware refinement. A feedback mechanism is applied, where the prediction error \(e_{(l-1)}\) is iteratively calculated and used to update the intermediate representation \(r_{l}^{t}\). This process is inspired by predictive coding, where the final refined feature representation incorporates both feedforward and feedback information.