## 3 Proposed Method  
This section first introduces DriveSegNet, highlighting its core design and functionality. As summarized in Algorithm 1 and illustrated in Figure 3, the network follows an encoder-decoder paradigm:  
``` Input: I \(\in\) R [B, C\({}_{\text{in}}\), H\({}_{\text{in}}\), W\({}_{\text{in}}\)], type (downsample or upsample) Output: O \(\in\) R [B, C\({}_{\text{out}}\), H\({}_{\text{out}}\), W\({}_{\text{out}}\)] I' \(\leftarrow\) 1 # For both downsampling and upsampling, keep input as is Feat2, Feat4, Feat8, Feat16, Feat32 \(\leftarrow\) ContextPath(I') Feat32_arm \(\leftarrow\) PCAM (Feat32) # Transformer refinement on Feat32 Feat32_sum \(\leftarrow\) Feat32_arm + Feat32 Feat32_up \(\leftarrow\) Interpolate (Feat32_arm + Feat32, (H16, W16))

Figure 2: Overview of the STDC module with a stride of 2. The proposed DriveSegNet architecture, as depicted in Figure 3, consists primarily of three modules: the encoder, the Positional Convolutional Attention Module (PCAM), and the decoder. In the feature extraction phase, DriveSegNet employs the efficient STD-CNet [16] architecture as a lightweight encoder. STDCNet progressively reduces spatial resolution through downsampling in each of its five stages, utilizing convolution with a stride of 2, ultimately compressing the input image to 1/32 of its original size. This process effectively captures high-level semantic information, which is crucial for semantic segmentation tasks, especially when dealing with complex scenes where capturing global contextual information is vital. The decoder is composed of the LAFM, which integrates

Figure 3: Illustrates the overall framework of DriveSegNet. (**a**) Encoder, (**b**) Decoder, (**c**) Segmentation Head, (**d**) Stage 3 Feature Map, (**e**) Stage 4 Feature Map, (**f**) Stage 5 Feature Map. upsampling operations to recover high-resolution outputs while combining features from different scales. The forward process of DriveSegNet can be further analyzed through pseudocode. During feature extraction, the input image passes through the encoder to generate a coarse semantic representation. As the feature maps are downsampled to 1/16 and 1/32 of the input image size, the PCAM module is introduced to enhance the output features. The PCAM module partially utilizes Transformer mechanisms, capturing long-range spatial dependencies at each stage. This not only enhances the discriminative power of the features but also enriches the semantic representations. In semantic segmentation, modeling long-range dependencies is critical for maintaining object coherence and precise boundary delineation. This process is reflected in the pseudocode with PCAM(Feat32) and PCAM(Feat16), highlighting the refinement of features at various stages through the Transformer module. Skip connections are widely employed in deep semantic segmentation networks to merge low-level details with high-level semantic information. DriveSegNet leverages skip connections to organically combine these details with abstract semantic information, overcoming the unidirectional flow of information between layers. The operations Feat32_sum = Feat32_arm + Feat32 and Feat16_sum = Feat16_arm + Feat32_up in the pseudocode illustrate the implementation of this mechanism, fostering interactions across multiple levels of semantics by merging detailed information with semantic content. This design is inspired by the encoder-decoder structure, particularly effective in tasks like edge detection and small object recognition, where low-level details need to be reconstructed. The decoder receives features from different scales of the encoder and performs feature fusion through the LAFM module. LAFM first concatenates and convolves features from different scales, integrating information across scales while maintaining a balance between semantic and detail preservation. Cross-scale fusion is an effective method for addressing the issues of object scale differences and inconsistent contextual information in semantic segmentation.