## 3 Methodology
### Parallel Encoding Architecture  
We achieve efficient local feature extraction and multi-scale contextual fusion through the collaborative design of a heterogeneous convolutional architecture and pyramid pooling. Specifically, as shown in Figure 2, three independent local feature extractors--LocalFeatureExtractor1, LocalFeatureExtractor2, and LocalFeatureExtractor3--each use convolutional kernels of different sizes for feature extraction and optimize the features through pooling strategies. This can be expressed as follows:  
(1) LocalFeatureExtractor1:  
\[feat_{1}=MaxPool2d(Conv2d_{3\times 3}(x)). \tag{1}\]  
Here, a \(3\times 3\) convolutional kernel (i.e., \(Conv2d_{3\times 3}\)) is used to extract high-frequency texture features from the input \(x\), and the max pooling (i.e., \(MaxPool2d\)) operation retains prominent features. (2) LocalFeatureExtractor2:  
\[feat_{2}=AvgPool2d(Conv2d_{5\times 5}(x)). \tag{2}\]  
A \(5\times 5\) convolutional kernel is used to extract mid-scale semantic features, and the average pooling (i.e., \(AvgPool2d\)) operation suppresses noise. (3) LocalFeatureExtractor3:  
\[feat_{3}=Conv2d_{3\times 3}(x)\cdot Conv2d_{3\times 3}(x). \tag{3}\]  
The cascading of two \(3\times 3\) convolutional kernels is used to extract fine-grained detail features. After feature extraction through the three branches, the features are upsampled to a \(64\times 64\) resolution using bilinear interpolation and concatenated along the channels to obtain a unified local feature map:  
\[local\_features=Concat(feat_{1},feat_{2},feat_{3}). \tag{4}\]To achieve efficient long-range dependency modeling and global feature extraction, we use an improved hierarchical Swin transformer and enhance global feature modeling through dynamic window attention mechanisms. As shown in Figure 3, the input image is first divided into non-overlapping image patches using a \(4\times 4\) convolution kernel in the patch embedding layer, generating a 96-channel feature map of size \(H/4\times W/4\). The image is then input into the four-stage transformer architecture. In the first stage, it contains two Swin blocks, using a fixed window size of \(8\times 8\) for multi-head attention calculation (four heads). This stage enhances the low-level semantic representation through the interaction of local and global features:  
\[stage1\_out=SwinBlock_{1}(SwinBlock_{2}(patches)) \tag{5}\]  
Then, from the second to fourth stages, a hierarchical downsampling strategy is adopted, where the SafePatchMerging module merges adjacent \(2\times 2\) feature blocks before each stage, achieving \(2\times\) downsampling of spatial resolution (\(H/8\to H/16\to H/32\)) and a stepwise expansion of channel numbers. The mathematical expressions are:  
\[stage2\_out=SafePatchMerging(stage1\_out). \tag{6}\]  
\[stage3\_out=SafePatchMerging(stage2\_out). \tag{7}\]  
\[stage4\_out=SafePatchMerging(stage3\_out). \tag{8}\]  
Each Swin block uses an alternating structure of window multi-head attention and shifted window attention, which is represented as:  
\[Attention(Q,K,V)=Softmax\bigg{(}\frac{QK^{T}}{\sqrt{d_{k}}}+B\bigg{)}V, \tag{9}\]  
where \(B\) is a learnable relative positional bias and \(d_{k}\) is the dimension of each attention head. To obtain the attention matrices, we perform linear projections on the input features \(X\in\mathbb{R}^{8\times N\times C}\), where \(B\) is the batch size, \(N\) is the number of tokens, and \(C\) is the channel dimension. These subspaces represent queries (\(Q\)), keys (\(K\)), and values (\(V\)) through learned projection matrices:  
\[Q=XW^{Q},\quad K=XW^{K},\quad V=XW^{V}, \tag{10}\]  
\[feat_{2}=AvgPool2d(Conv2d_{5\times 5}(x)). \tag{2}\]0 The architecture of the local feature extractor in the parallel feature encoder. where \(W\), \(W^{K}\), and \(W^{V}\in\mathbb{R}^{C\times d_{k}}\) are learnable projection matrices. The dot-product between \(Q\) and \(K\) determines the attention weights, and these weights are applied to \(V\) to perform a weighted aggregation of features within each window.