## 3 Methodology
### Mix Vision Transformer  
The backbone comes from SegFormer [35], a simple, efficient, powerful semantic segmentation framework that unifies a Transformer with lightweight Multilayer Perceptron (MLP) decoders. Main features: (1) a new hierarchical Transformer encoder that outputs  
Figure 1: The proposed structure of improved model.  
multi-scale features without positional encoding. This avoids interpolation of positional codes, reducing performance degradation when testing resolution differs from training. (2) The MLP decoder avoids complexity by aggregating information from different layers, combining local and global attention and offering strong representation capabilities. As shown in Figure 2, the overall network model consists of two parts: an encoder and a decoder. The encoder is composed of a layered Transformer module, while the decoder is composed of MLP.  
The Transformer first achieved success in the natural language processing (NLP) field, and later [PERSON] et al. pioneered the use of Vision Transformer (ViT) in the CV field, achieving comparable results to CNN. ViT divides an image into fixed-sized patches, linearly embeds each patch, adds positional embeddings, and provides the resulting vector sequence to a standard Transformer encoder. For classification purposes, ViT uses a standard method of adding additional learnable \"classification markers\" to the sequence.  
The standard Transformer receives a one-dimensional sequence embedded with a flag as input. To process two-dimensional images, ViT reshapes \(x\in R^{H\times W\times C}\) into a series of flat two-dimensional patches where \(x_{p}\in R^{N\times(P^{2}\bullet C)},(H,W)\) represents the resolution of the original image, C represents the number of channels, \((P,P)\) represents the resolution of every image patch, and \(\mathrm{N}=\frac{\mathrm{H}\times W}{\mathrm{P}^{2}}\) represents the number of patches, and can also be used as an effective input sequence length for the Transformer. The Transformer uses a constant latent vector size D in all layers, so ViT flattens the patch and maps it to the D dimension through trainable linear projection. The output of ViT projection is called patch embedding.  
SegFormer is a cutting-edge semantic segmentation Transformer framework that combines efficiency, accuracy, and robustness. Compared to traditional methods, SegFormer's framework has redesigned the encoder and decoder. Firstly, the encoder does not use interpolation position codes when inferring images of different resolutions from the training images. Therefore, SegFormer's encoder can easily adapt to any testing resolution  
Figure 2: The SegFormer network has two main modules: a hierarchical Transformer encoder to extract features, and a lightweight All-MLP decoder to fuse these features and predict the segmentation mask. The FFN stands for feed-forward network [35].  
without affecting performance. Furthermore, the layered part allows the encoder to generate low-resolution rough features and high-resolution fine features, which contrasts with ViT's ability to generate a single descending feature map with a fixed resolution. Secondly, SegFormer proposed a lightweight MLP decoder that utilizes Transformer induced features, where lower-level attention tends to maintain locality, while higher-level attention is highly non local. By aggregating information from different layers, local and global attention is combined by the MLP decoder. Therefore, SegFormer has obtained a concise and direct decoder that can demonstrate strong expressive power. SegFormer has created a range of Mix Vision Transformer (MiT) encoders, from mit-b0 to mit-b5, with identical structures but varying sizes.