In this section, we first detail the experimental setup. Subsequently, we present the procedures and results of the ablation studies to validate the efficacy of the proposed innovative modules, and to investigate the performance gains of distinct loss functions across datasets with different physical views. Finally, we conduct qualitative and quantitative comparisons with representative semantic segmentation baselines under a unified experimental protocol.
3.1. Implementation Details
The experiments were conducted on an Ubuntu operating system equipped with a single NVIDIA T4 GPU (16 GB), utilizing the PyTorch 2.9.0 deep learning framework. To accelerate model convergence, both our model and the CNN baselines employed an ImageNet-1K pre-trained ResNet-50 as the backbone network. Similarly, the Transformer-based models in the comparative experiments utilized their respective pre-trained weights. Input image dimensions were tailored to the dataset characteristics: training images from the Cityscapes and ISPRS datasets were randomly cropped to 768 × 768 and 512 × 512 pixels, respectively. The training process incorporated a unified dynamic data augmentation strategy, comprising random multi-scale scaling with a factor ranging from [0.5, 2.0], random cropping, and random horizontal flipping. The DeepLabV3 baseline uses a ResNet-50 backbone with output stride 16. The high-level 2048-channel features are processed by an ASPP module with dilation rates of 6, 12, and 18. No decoder or low-level feature fusion is used in this implementation.
The total number of training epochs was uniformly set to 50. The models were optimized using the AdamW optimizer (weight decay coefficient of 1 × 10−4). For CNN-based models, the optimizer was paired with a OneCycleLR scheduler (maximum learning rate of 0.001). Conversely, Transformer-based models were optimized using a constant learning rate of 0.0001 without an additional scheduler. Additionally, global gradient clipping with a threshold of 0.1 was applied. To enhance computational efficiency, Automatic Mixed Precision (AMP) was enabled during training, and the batch size was set to 12 for CNN-based models and 8 for Transformer-based models due to hardware VRAM constraints.
Statistical uncertainty in the principal ablation comparisons was assessed using paired bootstrap resampling of the evaluation predictions. We compared Baseline_FD with MoE_FD on Cityscapes and Baseline_CE with MoE_CE on ISPRS Vaihingen. A total of 10,000 paired resamples were drawn at the image level for Cityscapes and at the original image-area cluster level for ISPRS to account for dependence among adjacent patches. Ninety-five percent confidence intervals and two-sided p-values were computed for Global mIoU, XS Recall, and Mean Scale Recall, as reported in
Appendix A Table A5.
3.2. Ablation Studies
To evaluate the proposed framework and examine the optimization biases of different loss functions across datasets with varying physical views, we first designed experiments to determine the temperature coefficient. Subsequently, we conducted ablation studies on the Cityscapes and ISPRS Vaihingen datasets. We selected the classic DeepLabV3 (ResNet50) as the baseline. When integrating the SA-MoE architecture, we retained the ResNet-50 backbone and replaced the static ASPP-based feature aggregation with the proposed SA-MoE module. In addition to the loss-level ablations reported in
Table 1 and
Table 2, we further conducted a module-wise ablation to isolate the contribution of each introduced component, including heterogeneous experts, dynamic routing, temperature polarization, and the complete expert group. The detailed results are provided in
Appendix A Table A4.
- (1)
Selection of the Temperature Coefficient
First, using the Cityscapes dataset as a representative case, we evaluated the influence of the temperature coefficient τ in the polarized gating network. In the initial sensitivity analysis, four candidate values, τ = 0.1, 0.5, 1.0, and 2.0, were tested using Global mIoU, Global R-Boundary, XS R-Boundary, and XS Recall as the main indicators. The results indicated that τ = 0.5 provided strong overall performance among the initially tested candidates (
Figure 4).
To further examine the local sensitivity around this value, we additionally conducted a denser supplementary analysis using τ = 0.3, 0.4, 0.5, 0.6, and 0.7. As shown in
Appendix A Figure A1 and
Appendix A Table A1, τ = 0.5 achieved the best overall balance among the tested candidates, with the highest Global mIoU, Global R-Boundary, XS R-Boundary, XS Recall, and Mean Scale Recall. Because τ acts on the gating distribution, we used τ = 0.5 as a fixed architectural setting in both datasets for controlled comparison and to avoid additional dataset-specific tuning.
- (2)
Ablation Study on the Street-Level Dataset
To validate the effectiveness of the proposed SA-MoE architecture and the FD loss function tailored for perspective street-level datasets, we performed an ablation study on the Cityscapes dataset, with results summarized in
Table 1. The quantitative results show that the introduction of the MoE architecture improved the scale-aware boundary and recall metrics, with clearer gains for XS and small-scale vegetation. Concurrently, the gains tended to be larger for smaller vegetation regions: under both CE and FD loss functions, the MoE architecture improved the recall for XS scales by 2.96 and 2.63 percentage points, respectively, and for the Small group by 0.50 and 2.33 percentage points. Conversely, the improvements for mid and large scales remained marginal (within 0.3 and 0.6 percentage points). Furthermore, a horizontal comparison demonstrates that employing the FD loss further improved R-Boundary scores and recall across scales, indicating that the synergy between the SA-MoE architecture and the FD loss function can further exploit the segmentation potential of street-level datasets. The paired bootstrap analysis showed that the improvements in XS Recall and Mean Scale Recall were statistically supported, whereas the small difference in Global mIoU was not statistically significant (
Appendix A Table A5).
- (3)
Ablation Study on the Aerial Dataset
To further examine whether the same SA-MoE design remains effective in the orthographic benchmark, we conducted an identical ablation study on the ISPRS dataset, as shown in
Table 2. The quantitative data indicate that SA-MoE provides consistent recall gains under the orthographic aerial view, reaffirming the negative correlation between scale and accuracy gains observed in the street-level experiment. Under the CE loss function, the MoE module achieved an increase of 5.09 percentage points in recall at the XS scale, while the recall gains for mid-to-large scale targets hovered between 2.6 and 2.8 percentage points.
A noteworthy observation is the differential performance of the loss functions across the two benchmark settings. Unlike the street-level dataset, where the FD loss function comprehensively improved scale-aware accuracy, the MoE model equipped with the CE loss achieved the highest point estimates for most reported metrics under this setting in the aerial dataset. For instance, its XS-scale recall outperformed the FD-equipped MoE model by 1.11 percentage points. This phenomenon suggests that artificial label noise, such as boundary misalignments and positional shifts inherent in orthographic remote sensing scenarios, may negatively affect the FD loss by encouraging the learning of inaccurate boundaries under the current parameter settings. Conversely, the CE loss function, grounded in independent pixel-wise evaluation, exerts a superior smoothing effect on such noise, making it relatively more robust in this specific experimental setting [
49]. In this study, we did not perform extensive hyperparameter tuning for the FD loss, and the parameters were kept fixed for fair comparison. All FD experiments used the same fixed configuration of α = 0.25 and γ = 2, without dataset-specific tuning. Therefore, the comparison between CE and FD in this study should be interpreted under this predefined setting. The paired cluster bootstrap analysis likewise supported the improvements in XS Recall and Mean Scale Recall, while the difference in Global mIoU did not reach statistical significance (
Appendix A Table A5).
- (4)
Module-wise Ablation of the SA-MoE Components
The module-wise ablation results in
Appendix A Table A4 show that static expert fusion alone does not consistently improve performance, indicating that simply increasing the number of parallel branches is insufficient. Introducing dynamic routing improves scale-aware recall compared with static fusion, while the full SA-MoE configuration with τ = 0.5 achieves the strongest XS and small-scale recall, especially on the ISPRS Vaihingen dataset. These results support that the performance gain mainly comes from adaptive expert allocation and the complete scale-aware routing design.
3.3. Comparative Experiments and Results
Building upon the ablation studies, we conducted comparisons with representative algorithms covering several mainstream architecture families: fully convolutional and context-aggregation models (U-Net [
50] and PSPNet [
51]), spatial/channel attention-based models (MANet [
26]), convolutional-attention/large-kernel models (SegNeXt-Tiny [
22]), and Transformer-based models (SegFormer [
27] and Swin-UPerNet [
28]). To isolate the effect of network architecture during comparative evaluation, all models were trained using the dataset-specific loss functions identified in
Section 3.2 (FD for Cityscapes and CE for ISPRS). It should be noted that
Table 1 and
Table 2 establish the overall architectural contribution of SA-MoE under the dataset-specific loss settings, while
Appendix A Table A4 further isolates the role of each introduced module. The purpose of this comparison is a controlled sanity check under a unified protocol rather than a claim to reproduce every model’s best public benchmark score. Public benchmark scores, which are usually reported for the original multi-class segmentation tasks, are not directly comparable with our binary vegetation/tree segmentation setting because of differences in class definitions, input cropping, data partitioning, and evaluation metrics. To address recent convolutional-attention and large-kernel segmentation designs, SegNeXt-Tiny was additionally evaluated and reported in the appendix comparison tables (
Appendix A Table A3). The results show that SegNeXt-Tiny is substantially lighter and faster, whereas SA-MoE retains higher global accuracy and scale-aware recall under the same local protocol.
- (1)
Computational Efficiency
To assess the feasibility of model deployment in real-world scenarios,
Table 3 reports the parameters (Params), computational complexity (GFLOPs), and inference frame rates (FPS) for each model. Because computational load and frame rate depend on input resolution, measurements were conducted at two input sizes: the ISPRS dataset (512 × 512) and the Cityscapes dataset (2048 × 1024).
The results reveal that after integrating the dynamic routing mechanism of the mixture of experts, SA-MoE added only 4.46 M parameters relative to the baseline (DeepLabV3), indicating limited computational overhead. Its inference rates were 23.2 FPS for ISPRS and 3.2 FPS for Cityscapes. For high-resolution Cityscapes images, Swin-UPerNet required 3756.32 GFLOPs and ran at 1.2 FPS. By contrast, SA-MoE required approximately one-third of this computation, providing a favorable balance between computational efficiency and segmentation accuracy.
All parameter counts were obtained using the same procedure. Although MANet also adopts ResNet-50 as its backbone, its relatively large parameter count mainly arises from the attention-based decoder and multi-scale feature-fusion modules, which introduce additional independently parameterized convolutional and attention blocks.
- (2)
Street-Level Dataset
The six-dimensional radar chart comparing global performance on the street-level dataset is presented in
Figure 5, with the fine-grained scale-specific evaluation detailed in
Table 4. The radar chart illustrates the competitive performance of our proposed MoE_FD model across global metrics. Specifically, the OA, Precision, Recall, F1-Score, and mIoU of MoE_FD reached 98.31%, 93.59%, 95.62%, 94.59%, and 89.52%, respectively. The global OA and F1-Score of MoE_FD were slightly higher than those of the other models, whereas its Recall was marginally lower than that of the Swin-UPerNet (Tiny) model. The traditional CNN models all achieved mIoU values below 87% in the perspective street scenes. The self-attention-based Swin-UPerNet (Tiny) achieved the highest global recall (95.96%), though with a comparatively lower precision (92.80%).
Table 4 shows that the proposed MoE_FD model achieves the highest R-Boundary precision across all scales, reaching 53.21% and 62.41% at the XS and Small scales, respectively. This corresponds to an improvement of nearly 5 percentage points over SegFormer (MiT-b2) (48.40% and 57.42%), which performs strongly among the compared baselines. In terms of recall, the proposed model is comparable to Swin-UPerNet (Tiny) at the mid scale, but slightly lower at the XS, small, and large scales (
Table 4). Nevertheless, it still outperforms the other CNN-based models while maintaining higher computational efficiency. Overall, the results indicate that the proposed model improves R-Boundary precision while retaining competitive recall, offering a favorable trade-off between accuracy and efficiency.
- (3)
Aerial Dataset
The six-dimensional radar chart and scale-specific accuracy evaluation table for the aerial dataset are displayed in
Figure 6 and
Table 5. For global metrics, the OA, Precision, Recall, F1-Score, mIoU, and R-Boundary of MoE_CE reached 95.06%, 90.06%, 90.32%, 90.28%, 80.32%, and 79.96%, respectively. Its comparison with other mainstream models exhibits a diametrically opposite trend to that of the street-level dataset, achieving the top score solely in Recall, while the remaining global metrics trailed the two Transformer-based architectures. This suggests that in orthographic aerial datasets, the self-attention mechanisms of Transformer architectures hold a distinct advantage in capturing global contexts and fitting macroscopic boundaries; nonetheless, our improved CNN-based SA-MoE architecture achieved the highest recall.
Appendix A Figure A3 examines the influence of the low-vegetation label treatment in the ISPRS experiment. Low vegetation represents 22.93% of the evaluation pixels and contributes approximately 80% of the false-positive tree predictions. Excluding these pixels from evaluation increases the Precision, F1-score, and Tree IoU of both models. SA-MoE_CE still achieves slightly higher OA, Recall, F1-score, and Tree IoU, and the difference in Precision is only 0.04 percentage points. The analysis is based on fixed predictions and does not involve model retraining.
In the scale-specific accuracy evaluation, the MoE_CE model achieved the highest Recall across all four scales, notably outperforming the runner-up by 3.21 percentage points at the XS scale. However, for the R-Boundary metric, our model lagged behind the best-performing Swin-UPerNet (Tiny) model by approximately 4 to 5 percentage points across all scales. This result highlights the stronger boundary delineation of Transformer architectures, whereas SA-MoE reduces omissions of micro-scale and fragmented vegetation through dynamic routing and receptive-field allocation. This trade-off reflects the different inductive biases of the two model families. The dynamic routing mechanism of SA-MoE tends to allocate more suitable receptive-field experts to fragmented or small vegetation regions, thereby reducing missed detections and improving recall. In contrast, Transformer-based models benefit from long-range self-attention and are therefore better able to preserve global shape consistency and boundary continuity, especially in orthographic scenes with continuous canopy structures.
3.4. Qualitative Visual Analysis
- (1)
Ablation Studies
To illustrate the visual behavior of the proposed SA-MoE architecture, we visualized the vegetation segmentation results on both datasets, as depicted in
Figure 7 and
Figure 8. The results in
Figure 7 suggest that the integration of the MoE architecture improves the identification of distant, micro-scale objects, including vegetation that the baseline model overlooked. The FD loss further enhances this tendency for the street-level benchmark.
Figure 8 shows that the MoE architecture improves the segmentation of small-scale, disconnected vegetation and reduces omissions in several representative regions. Comparing the visualizations of the two loss functions within the MoE architecture, the CE loss appears more stable for small-scale vegetation in aerial imagery, which is consistent with the quantitative trends in the ablation studies.
- (2)
Comparative Experiments
Expanding upon the ablation studies, we conducted qualitative visual comparisons between the selected SA-MoE configurations and representative semantic segmentation architectures.
Figure 9 and
Figure 10 illustrate the visual performance of these models under the two independent imaging views.
A cross-model analysis of
Figure 7,
Figure 8,
Figure 9 and
Figure 10 further reveals several typical failure modes of different architectures under scale variations across the two imaging views. Models relying on traditional deep convolutions and spatial pooling (U-Net (ResNet-50), PSPNet (ResNet-50), and MANet (ResNet-50)) tend to lose fine-grained spatial details during successive downsampling operations. As a result, they show conspicuous omissions in distant street-level vegetation and fragmented aerial canopies, together with false positives in complex background regions and overly smooth predicted boundaries. In contrast, Transformer-based models (SegFormer (MiT-b2) and Swin-UPerNet (Tiny)) benefit from global self-attention and perform better in maintaining the connectivity, structural integrity, and boundary continuity of macro-scale vegetation. However, they still exhibit noticeable omissions and misclassifications when dealing with scattered XS targets. These visual comparisons indicate that SA-MoE mainly improves the detection of small and fragmented vegetation regions, although its boundary continuity in orthographic scenes remains weaker than that of the strongest Transformer-based models.
Overall, the proposed SA-MoE architecture provides a favorable visual trade-off in both benchmark settings, with clearer recall advantages for small-scale targets while still showing room for improvement in boundary continuity compared with the strongest Transformer-based models.
3.5. Visualization and Analysis of Dynamic Routing
To examine whether the scale-aware architecture adaptively allocates experts according to vegetation scale, we extracted the gating weights during forward propagation and visualized them using the ARP and RRP frameworks defined in
Section 2.3.4. We analyzed the routing distributions on the test sets independently for the perspective street-level dataset (Cityscapes) and the orthographic remote sensing dataset (ISPRS). This analysis provides model-side evidence for comparing expert allocation patterns across datasets with distinct physical views.
- (1)
Perspective Street-Level Dataset
In perspective street-level scenarios, the dynamic routing mechanism of our model showed a positive association with target scale. As shown by the absolute distribution in
Figure 11a, the pixel-level 1 × 1 convolution expert (E0) received the highest absolute weight at all scales; however, its weight decreased as target size increased (from 0.631 for XS targets to 0.326 for Large targets). A closer inspection of the relative routing weights of the spatial scale experts (
Figure 11b) shows that for XS targets, the small-receptive-field expert received the highest relative weight (0.607), whereas the large-receptive-field expert received 0.222. As target size increased, the relative weight of the large-receptive-field expert increased to 0.386 for large targets, while the small-receptive-field expert decreased to 0.446. Meanwhile, the absolute weight of the mid-receptive-field expert increased slightly with scale, though its relative weight remained stable. These observations suggest that under perspective-induced scale variation, the spatial experts show a scale-dependent routing tendency. Larger vegetation regions tend to receive relatively higher contributions from large-receptive-field experts for contextual modeling, whereas XS targets rely more on small-receptive-field experts to reduce background interference.
- (2)
Orthographic Aerial Dataset
Under orthographic aerial scenarios, the routing behavior followed a different pattern from that observed in the street-level dataset. As shown in
Figure 12a, the pixel-level expert E0 and the global-context expert E4 received relatively high absolute routing weights, suggesting that they provided the main baseline representation and global contextual support. To better understand the spatial experts, we further examined the relative routing probabilities among E1–E3. As shown in
Figure 12b, the relative weight of the large-dilation expert E3 decreased as the vegetation scale increased, whereas E1 maintained the highest relative routing probability among the spatial experts. For large-scale canopy regions, the RRP of E1 reached 0.763, while that of E3 decreased to 0.067. We therefore interpret this pattern as a relative routing shift away from the large-dilation expert toward smaller-to-middle receptive-field experts, rather than as a strict one-to-one matching between object size and receptive-field size.
To provide direct model-side evidence for this interpretation, we added routing-weight visualizations for representative large-canopy samples in
Appendix A Figure A2. The visualization shows that E3 remains weak within large-canopy regions, while the relative routing weights are mainly assigned to E1 and, to a lesser extent, E2. In addition, we conducted a non-collapse check based on the target-pixel routing weights, as summarized in
Appendix A Table A2. In the orthographic dataset, E1 showed an activation ratio of 0.747 under the threshold W > 0.05, and the normalized routing entropy was 0.568. These results suggest that the observed pattern is not a complete collapse of the spatial expert group, but rather a suppression of the large-dilation expert E3 and a relative shift toward E1/E2.