## 3 Proposed Method
\begin{gathered}\text{Q}=Z_{1}*\text{W}_{\text{Q}},\text{K}=Z_{1}* \text{W}_{\text{K}},\text{V}=Z_{1}*\text{W}_{\text{V}}\\ \text{Z}_{1}\in\text{R}^{\text{B}\times\text{N}\times\text{C}\text {in}}\\ \text{W}_{\text{Q}},\text{W}_{\text{K}},\text{W}_{\text{V}}\in\text{R} ^{\text{C}}_{\text{in}}{}^{\times\text{C}}_{\text{head}}\\ \text{Q},\text{K},\text{V}\in\text{R}^{\text{B}\times\text{N}\times \text{C}}_{\text{head}}\\ \text{A}=\text{Softmax}\text{ }\left(\text{Q }*\text{K}^{\text{T}}\right)/\sqrt{d}\\ \text{Attention }(\text{Q},\text{K},\text{V})=\text{A}*\text{V}\\ \text{Z}_{2}=\text{Concat}\left(\text{Head}_{1},\text{Head}_{2}, \ldots,\text{Head}_{\text{h}}\right)*\text{W}_{\text{O}}\end{gathered}  \tag{3}\]

Here, \(\text{W}_{\text{Q}}\), \(\text{W}_{\text{K}}\), and \(\text{W}_{\text{V}}\) are the learnable weight matrices, where \(\text{C}_{\text{head}}\) represents the dimension of the attention head, \(\text{d}\) is the dimensionality of each head, and \(\text{W}_{\text{O}}\in\text{R}^{\text{HC}}_{\text{head}}{}^{\times\text{C}}_{ \text{out}}\) is the output weight matrix, with \(\text{h}\) being the number of attention heads. Notably, the integration of the learnable positional bias \(\text{P}\) into \(Z_{1}\) enables the subsequent attention weights \(\text{A}\) to implicitly capture spatial priors via the Q/K projections. This implicit spatial encoding proves advantageous for enhancing long-range contextual modeling, especially in scenarios characterized by structured spatial layouts. After the multi-head attention module, a residual connection and layer normalization are applied, as expressed in Equation (4). The formula for the residual connection is as follows:

\[ \begin{gathered} Z_{3}\ =\ \text{LayerNorm}\ (Z_{2}\ +\ Z_{1})\ =\ (Z_{2}\ +\ Z_{1}\ -\ \mu_{\text{A}})/\sqrt{\sigma_{A}^{2}\ +\ \varepsilon* \gamma_{\text{A}}}+\beta_{\text{A}}\end{gathered}  \tag{4}\]

Here, \(\mu_{\text{A}}\) and \(\sigma_{A}^{2}\) represent the mean and variance after the residual summation, while \(\gamma_{\text{A}}\) and \(\beta_{\text{A}}\) are the learnable normalization parameters. Next, the input \(Z_{3}\) enters the feedforward network. The feedforward network consists of two linear transformations and a ReLU activation function. The output is denoted as \(Z_{4}\), as shown in Equation (5):

\[ \begin{gathered} Z_{4}=\text{ReLU }(Z_{3}\ ^{*}\text{W}_{1}+\text{b}_{1})* \text{W}_{2}+\text{b}_{2}\end{gathered}  \tag{5}\]

where \(\text{W}_{1}\), \(\text{b}_{1}\), and \(\text{W}_{2}\), \(\text{b}_{2}\) represent the two weight matrices and bias vectors of the feedforward network. Next, a second residual connection and layer normalization are applied. The formula is given in Equation (6) as follows:

\[ \begin{gathered} Z_{5}\ =\ \text{LayerNorm}\ (Z_{4}\ +\ Z_{3})\ =\ (Z_{4}\ +\ Z_{3}\ -\ \mu_{\text{A}})/\sqrt{\sigma_{A}^{2}\ +\ \varepsilon* \gamma_{\text{A}}}+\beta_{\text{A}}\end{gathered}  \tag{6}\]

Finally, a Permute operation is performed to adapt to the downstream task requirements, usually by transposing or rearranging the dimensions of the data. The final output is denoted as Zout, as shown in Equation (7):

\[ \begin{gathered} Z_{\text{out}}=\text{Permute }(Z_{5})\end{gathered}  \tag{7}\]

### Lightweight Adaptive Fusion Module

Achieving high-accuracy segmentation requires the effective fusion of multi-level features, as different layers capture complementary spatial and semantic information. While common strategies such as element-wise addition and concatenation are simple and fast, they often fail to fully exploit the spatial alignment and semantic relevance between feature maps. To address this, recent methods such as Semantic Flow Network (SFNet) [36], Feature-aligned Pyramid Network (FaPN) [37], and Attention-Augmented Network (AttaNet) [38] introduce feature alignment modules or deformable convolutions to improve fusion quality. However, these approaches significantly increase computational complexity, limiting their applicability in real-time scenarios.