# Uncertainty-Aware Adaptive Multiscale U-Net for Low-Contrast Cardiac Image Segmentation
## 2 Materials and Methods
### Dynamic Saliency U-Net
#### 2.2.3 Spectral Synthesis Fusion Head  
The Spectral Synthesis Fusion Head (SFFH) is designed to refine feature maps in AMU-Net from the perspective of spectral domains. The initial input to the ASFH is first processed through a 3 \(\times\) 3 convolution with a batch normalization layer followed by a nonlinear activation function. The output is then transformed into spectral domains by applying Discrete Cosine Transform (DCT). DCT converts information into the frequency domain using a series of cosine basis functions. It helps in capturing essential structural patterns by emphasizing low-frequency components while suppressing high-frequency noise and can be used in medical image analysis. The attention mechanism extracts meaningful frequency representations using DCT to improve segmentation accuracy in complex medical images. We performed a convolution operation in the spectral domain to normalize the feature maps as below:  
\[ \begin{array}{ll}x_{\text{spectral}}&=\text{Conv}_{1\times 1}(\text{DCT}(\text { LeakyReLU}\ (\\ &\text{Conv}_{3\times 3}\,\text{BN}\big{(}x_{\text{input}}\big{)})))\end{array}  \tag{27}\]  
The initial spectral feature maps are then further enhanced by introducing a learnable attention to focus on the relevant frequency components. We compute attention scores for different frequency components as follows:  
\[AttentionScores=Softmax\Big{(}FC\Big{(}x_{\text{avg},spectral}\Big{)}\Big{)} \tag{28}\]  
where \(FC\) is a fully connected layer, and \(x_{\text{avg},spectral}\) is the average-pooled spectral feature, providing a global frequency context. The computed attention scores are then used to attenuate the spectral features using the equation below:  
\[x_{\text{esf}}\,=x_{\text{spectral}}\,\times\,\text{Attention Scores} \tag{29}\]  
We capture the mutli-scale spectral features by applying the convolution operations to the enhanced spectral feature maps with different kernel sizes. The multi-scale feature maps are then concatenated to form a comprehensive feature representation as follows:  
\[ \begin{array}{ll}x_{\text{multi-scale}}^{3}&=\text{Conv}(x_{\text{esf}}\,,3\times 3)\\ x_{\text{multi-scale}}^{5}&=\text{Conv}(x_{\text{esf}}\,,5\times 5)\\ x_{\text{multi-scale}}^{7}&=\text{Conv}(x_{\text{esf}}\,7\times 7)\\ x_{\text{combined}}&=\text{Concat}\Big{(}x_{\text{multi-scale}}^{3}\,,x_{ \text{multi-scale}}^{5}\,,x_{\text{multi-scale}}^{7}\,,x_{\text{multi-scale}}^{7 }\,\Big{)}\end{array}  \tag{30}\]  
Trainable weights are introduced, followed by a convolution operation to adaptively fuse the multi scale spectral feature maps using the equations below:  
\[ \begin{array}{ll}W_{\text{fuse}}&=\text{Softmax}(\text{ weights}\ )\\ x_{\text{fused}}&=\sum_{i}W_{\text{fuse}}\,[i]\cdot x_{\text{combined}}\,[i] \\ x_{\text{fused}}&=\text{Conv}_{3\times 3}(x_{\text{fused}}\ )\end{array}  \tag{31}\]  
We introduce two fully connected layers followed by a sigmoid function to focus on salient spectral features to improve salient feature representation as follows:  
\[ \begin{array}{ll}x_{\text{avg}}=\text{AvgPool}(x_{\text{fused}}\ )\\ x_{\text{fc}}=\text{FC}\big{(}\text{ReLU}\big{(}\text{FC}\big{(}x_{\text{ avg}}\big{)}\big{)}\big{)}\\ x_{\text{att}}=\text{Sigmoid}(x_{\text{fc}})\times x_{\text{fused}}\end{array}  \tag{32}\]  
The feature map is then transformed back to the spatial domain using an inverse DCT operation after the convolution operation in the spectral domain.