# Segmenting Urban Scene Imagery in Real Time Using an Efficient UNet-like Transformer
## 5 Conclusions  
In this study, a CNN-based encoding and Transformer-based decoding U-shaped network (Flatomrner) was proposed for efficiently segmenting remote sensing urban images. Meanwhile, we designed the WMFSA module based on the focused linear attention and window-based, multi-head self-attention mechanisms, which constitutes a major part of the global-local information modeling module. The local branch and global branch in the GLIM ensured that our model could capture both local and global contexts, which is conducive to obtaining more accurate segmentation results. Specifically, the FLA and SPT modules were integrated into the global branch to extract global information efficiently, while the local branch used two sets of parallel convolutions to extract local information. As a result, the dual-branch structure in the decoder is the main reason that the proposed Flauformer achieved good performance. In addition, we conducted comparison and ablation experiments on four challenging datasets, demonstrating the potential of our model in real-time scene applications. Meanwhile, we also used the Transformer as the encoder. Although the model accuracy was improved slightly, it incurred great computational overhead, which demonstrates the rationality of using ResNet18 as the encoder. However, the method was not accurate enough to recognize some small objects, and the segmentation accuracy among different categories was not balanced. In addition, some areas with different lighting conditions were easily misclassified, such as the grass and pavements covered by building shadows. In the future, we will try to develop more efficient and effective models to address these challenges and enhance the potential of Transformer-based methods in the semantic segmentation tasks of remote sensing urban imagery, making contributions to urban planning, environmental protection, and sustainable development.  
Conceptualization, M.Y. and H.X.; methodology, H.X.; validation, M.Y. and H.Y.; software, H.X.; investigation, F.Z.; formal analysis, H.X.; data curation, H.X.; resources, M.Y.; writing--original draft preparation, H.X.; visualization, H.X.; writing--review and editing, M.Y.; supervision, M.Y.; funding acquisition, M.Y.; project administration, M.Y. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the National Natural Science Foundation of China, grant number 41801308, and the China National Key R&D Program during the 13 th Five-year Plan Period, grant number 2019 YFD1100800.  
Not applicable.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Models** & **Backbone** & **Complexity (G)** & **Parameters (M)** & **Speed** & **mIoU** \\ \hline Fast-SCNN & – & 3.55 & 1.17 & 260 & 61.4 \\ ABCNet & ResNet18 & 62.51 & 13.39 & 108 & 63.6 \\ DANet & – & 110.85 & 47.44 & 67 & 60.8 \\ MANet & ResNet50 & 310.97 & 35.86 & 27 & 62.5 \\ A2 FPN & ResNet18 & 167.33 & 22.82 & 42 & 65.3 \\ EANet & ResNet18 & 388.19 & 81.52 & 30 & 64.9 \\ DC-Swin & Swin-Tiny & 184.28 & 45.61 & 27 & 67.3 \\ RANet & ResNet-Lite & 52.71 & 12.72 & 13 & 64.5 \\ SwinUNet & Swin-Tiny & 182.25 & 41.34 & 19 & 64.3 \\ VPANet & ResNet50 & 143.21 & 24.15 & 56 & 64.7 \\ SegFormer & MiT-B1 & 63.24 & 13.71 & 32 & 66.1 \\ UNetFormer & ResNet18 & 46.98 & 11.68 & 121 & 67.6 \\ Our model & ResNet18 & 47.10 & 11.69 & 114 & 68.2 \\ \hline \hline \end{tabular}
\end{table}
Table 8: The speed comparison of each model on the UAVid dataset. The input size was 1024 \(\times\) 1024 and we used a single 3090 GPU.  
Data Availability Statement: The Potsdam and Vaihingen datasets are available at Benchmark on Semantic Labeling (isprs.org), accessed on 14 July 2023; the UAVid dataset is available at UAVid Semantic Segmentation Dataset, accessed on 16 July 2023; the LoveDA dataset is available at CodaLab--Competition (upscalay.fr), accessed on 18 July 2023.  
The authors thank the anonymous reviewers for their constructive comments. The authors declare no conflicts of interest.