4.1. Dataset
The SZUTreeDataset (
http://szu-hsilab.com/szu-tree-dataset/(accessed on 2 June 2025)) was constructed and publicly released by the Hyperspectral Imaging Laboratory (HSI Lab) at Shenzhen University. It is a high-resolution hyperspectral image dataset focused on urban tree classification. As shown in
Figure 5, it includes samples of 25 common tree species from cities in southern China.
NJFUDataset is a comprehensive plant dataset for plant classification and resource surveys, built upon the website of NJFU Campus Plants (
http://plants.njfu.edu.cn). The website is established through an on-site botanical inventory covering the entire NJFU campus, and thus can be regarded as an authoritative reference with near-complete coverage and high identification reliability. The multi-scale location map of NJFUDataset is shown in
Figure 6. As a forestry university in East and Central China, this dataset covers 94 families and 222 genera, including 400 common and distinctive plant samples, which supports multi-dimensional plant feature analysis. The spatial resolution is 0.0347 m per pixel (ground sampling distance), and the data are provided as standard
.tif files. The dataset integrates remote sensing imagery, field surveys, and ecological parameters, aiming to alleviate the shortage of training data for regional tree species identification, biomass estimation, and growth monitoring, and also supporting campus-scale urban green research such as carbon sink benefit assessment and planting optimization [
38,
39]. For each dataset, the samples were randomly divided into training, validation, and testing subsets at a ratio of 8:1:1. The same split was used for all compared models to ensure a fair evaluation.
4.3. Qualitative Analysis
We provide the tree-species legends for SZUTreeDataset and NJFUDataset, as shown in
Table 2 and
Table 3, to support interpretation of the spatial distribution of species in later qualitative results.
Representative regions from the two datasets are presented to qualitatively compare the original UAV images, ground truth, the MobileViT baseline, and the results of our method (
Figure 7 and
Figure 8).
On both datasets, the baseline model can roughly locate the main tree crowns. However, it performs poorly in complex backgrounds and in fine-grained category differentiation. In regions R1 and R2 of the SZUTreeDataset, misclassifications are often blocky. Color mixing frequently appears near roadsides, dense forest belts, and buildings. Boundaries between visually similar species are also blurry. On the NJFUDataset, the baseline makes larger errors. The dataset contains more species. The shooting conditions vary more. The model often misclassifies shadowed areas and crowns with similar height. Some species with small crowns or few samples are even missed entirely.
Our method produces predictions that better match the ground truth on both datasets. The overall crown shapes are more accurate. Local texture details are also better preserved. Crown edges are more continuous. Gaps between canopies and grass regions are reduced. False positives on non-vegetation areas such as buildings and roads are also reduced. For adjacent species, the color-block boundaries are clearer. The results better reflect gradual spatial transitions between species. In the more challenging parts of R2 in the SZUTreeDataset and in the NJFUDataset, the baseline often ignores scattered trees. These trees are located along roads or in narrow gaps between buildings. Our method still detects them as separate crowns. This suggests stronger robustness under complex campus scenes.
These observations suggest that BSM suppresses background interference from roads, buildings, and shadows. It makes feature extraction more focused on crown regions. FGF and the GLF head further strengthen sensitivity to local textures and crown-edge morphology. They help maintain clearer decision boundaries when species differences are subtle. Some errors remain on both datasets. They mainly occur for species with very similar morphology. They also occur for small crowns or heavy occlusion. This reflects the intrinsic difficulty of fine-grained tree species recognition.
Figure 9 compares the confusion matrices of the MobileViT baseline and the proposed TreeSpecViT on the SZUTreeDataset and NJFUDataset in a 2 × 2 layout. For confusion-matrix analysis, each sample is defined as an individual tree-crown patch used for classification. Accordingly, the confusion matrices are computed at the sample level rather than at the pixel level, and the class indices correspond to the species class numbers listed in
Table 2 and
Table 3. For each dataset, the baseline and TreeSpecViT results are shown side by side to facilitate direct comparison. Overall, most categories are concentrated along the diagonal, indicating stable discrimination for the majority of classes. The remaining errors mainly follow three systematic patterns: confusion between visually similar species, misclassification of long-tail classes into dominant classes with more training samples, and reduced separability in regions affected by dense crown adjacency, shadows, or other background interference.
On the SZUTreeDataset, the main confusion is concentrated among several broadleaf species with similar crown appearance. In the baseline model, these classes produce visible cross-stripe and off-diagonal responses, indicating mutual confusion between visually similar categories. In addition, some long-tail classes are more likely to be predicted as dominant classes with larger sample sizes, suggesting a bias caused by class imbalance. In contrast, TreeSpecViT produces a more concentrated diagonal distribution and weaker off-diagonal responses, indicating that the proposed modules improve class separability by suppressing non-canopy interference and preserving more discriminative fine-grained crown features. This improvement is particularly evident for long-tail classes, whose predictions become less biased toward major classes after introducing BSM, FGF, and GLF.
On the NJFUDataset, the confusion pattern is more dispersed than that on the SZUTreeDataset, reflecting the higher task difficulty caused by a larger number of species, stronger seasonal and illumination variation, and more complex canopy appearance differences. In this dataset, misclassification still occurs mainly between species with similar crown shape and leaf color, while minority classes are more likely to be absorbed into nearby dominant classes. Complex UAV scene factors, including dense crown adjacency and shadows, further reduce separability for some classes. Compared with the baseline, TreeSpecViT yields a clearer diagonal structure and reduced off-diagonal confusion for many classes, indicating improved intra-class compactness and inter-class separability under class imbalance and complex background conditions.
Some errors remain on both datasets. They mainly occur in classes with very limited samples and in regions affected by shadows, occlusion, or limited spatial resolution. Although common data-augmentation strategies were used during training to partially alleviate the impact of limited samples in long-tail classes, more dedicated methods, such as class-balanced loss or other imbalance-aware learning strategies, may further improve the recognition of minority classes in future work.
Training and validation loss curves of representative models are provided to compare the convergence behaviors of the proposed method and competing methods on SZUTreeDataset and NJFUDataset (
Figure 10 and
Figure 11).
It can be seen that on both datasets, the method proposed in this paper can quickly reduce the loss to a low level in the previous stages of training, and then steadily converge within a relatively smooth range. The gap between the training curve and the validation curve remains small, with no prolonged oscillations or obvious overfitting. In contrast, some of the comparison models experience slow loss reduction or even slight increases in the later stages, especially on more complex datasets like NJFUDataset, where inter-class differences are more subtle, showing more noticeable fluctuations. This indicates that in more challenging scenarios, the method proposed in this paper can still maintain good optimization stability and generalization ability, which corroborates the previously demonstrated advantages in accuracy, F1 score, and confusion matrix.
4.4. Quantitative Analysis
To systematically evaluate the overall performance of the proposed framework in fine-grained tree species classification, this study uses the SZUTreeDataset and NJFUDataset, selecting various mainstream lightweight CNNs and vision Transformers, including MobileViT, MobileNetV3, RegNet, DenseNet, EfficientNet, Swin Transformer, EfficientFormer, ViT, and ConvNeXt, as well as two fine-grained recognition baselines, BCNN and TransFG, as comparison models. A quantitative comparison is conducted based on four metrics: Accuracy, Precision, Recall, and F1, with results shown in
Table 4, while the model complexity comparison is reported in
Table 5. Overall, Transformer and CNN–Transformer hybrid structures generally outperform pure CNN models, and under similar lightweight constraints, the proposed method achieves the best or jointly best overall performance on both datasets.
Compared with lightweight CNN models, the baseline MobileViT has already shown significant advantages on both datasets, but it is still affected by complex backgrounds and confusion between similar tree species. After introducing BSM, FGF, and GLF Head, our method achieves stable improvements on both datasets: on the SZUTreeDataset, Accuracy increases from 81.82% to 87.88% and F1 from 71.40% to 76.48%, improving by 6.06 and 5.08 percentage points respectively; on the NJFUDataset, Accuracy rises from 71.20% to 76.30% and F1 from 62.90% to 70.10%, improving by 5.10 and 7.20 percentage points respectively. As shown in
Table 5, it can be seen that, while maintaining a parameter scale and computational cost similar to MobileViT, the proposed combination of modules brings consistent and substantial gains on both datasets. Comparing our method with other Transformers or hybrid architectures as well as fine-grained recognition baselines further shows that the F1 score is the highest among all methods on both datasets: on the SZUTreeDataset, our F1 is 76.48%, about 1.28 percentage points higher than the second-best model, TransFG, which has 75.20%; on the NJFUDataset, our F1 is 70.10%, still about 1.70 percentage points higher than the second-best model, TransFG (68.40%). Additionally, there is a good balance between Precision and Recall, without a situation where one metric is high while the other drops significantly, indicating that the model does not achieve high scores by favoring majority classes, but rather has strong recognition ability across the overall class distribution. It should be noted that, compared to SZUTreeDataset, Accuracy and F1 are generally lower for all methods on NJFUDataset, reflecting the higher difficulty of this dataset due to tree species diversity, variations in shooting conditions, and background interference. Even in this more challenging setting, our method maintains a lead over all comparison methods in both key metrics, indicating that the proposed BSM, FGF, and GLF combination is not only effective within a single campus scenario but also demonstrates strong cross-region generalization ability and robustness to complex backgrounds.
In summary, under the premise that the number of parameters and computational cost are on the same level as MobileViT, the method proposed in this paper can consistently and significantly improve Accuracy and F1 on both SZUTreeDataset and NJFUDataset. It also achieves the best overall performance among various lightweight models, fine-grained recognition baselines, balancing accuracy, efficiency, and deployability, thus providing reliable support for the practical application of fine-grained tree species classification for drones in campus and urban greening management scenarios.
4.5. Ablation Experiment
Table 6 presents the results of module ablation experiments conducted on the NJFU dataset. As shown in the table, when using MobileViT as the baseline, the accuracy is 71.20%, precision is 62.85%, recall is 63.40%, and F1 score is 62.90%. When individually adding each module to this baseline, all three yielded stable yet varying performance gains. Adding only BSM boosted accuracy to 72.60% and F1 to 64.00% (+1.10 percentage points), demonstrating that image-level background suppression effectively mitigates interference from roads, buildings, and shadows. Adding only FGF increased accuracy to 73.05% and F1 to 65.10% (+2.20 percentage points), representing the largest improvement among the three standalone configurations. This demonstrates that explicitly guiding fine-grained features before tokenization is particularly crucial for distinguishing similar tree species. When only the GLF head was added, accuracy reached 72.30% and F1 reached 64.00%, primarily improving precision. This demonstrates that global–local feature fusion can reduce misclassifications of partially boundary-blurred and long-tail categories. The ablation results suggest that BSM, FGF, and GLF are complementary because they act on different stages of the feature-extraction and decision pipeline. BSM is introduced in the early feature-learning stage to suppress non-canopy interference and improve the foreground signal-to-noise ratio. FGF is applied before tokenization to enhance subtle fine-grained canopy cues, so that the generated tokens preserve more discriminative information. GLF is used at the prediction stage to combine holistic crown semantics with local structural cues that may be weakened by purely global summarization. From this perspective, the three modules address different but connected aspects of the task: background suppression, fine-grained feature enhancement, and global–local representation fusion. Their joint use, therefore, leads to more stable gains than any single module alone.
Performance gains become more pronounced when combining multiple modules. The joint use of BSM and FGF increases accuracy to 74.80% and F1 to 67.00% (a +4.10 percentage point improvement over the baseline). Combining BSM with GLF raises F1 to 65.90%. When FGF and GLF are combined, accuracy is 74.30% and F1 is 66.40%. The F1 scores of these three combinations significantly outperform any single module, indicating functional complementarity among background suppression, fine-grained guidance, and global-local fusion. Specifically, the front-end BSM provides cleaner foreground input, the intermediate FGF enhances detail discrimination, and the back-end GLF further integrates global semantics with local textures during category decision-making.
When all three modules (BSM + FGF + GLF) are enabled, the model achieves peak performance: Accuracy rises to 76.30% and F1 reaches 70.10%, representing improvements of 5.10 and 7.20 percentage points over the baseline, respectively. Concurrently, precision and recall also increase to 70.95% and 69.90%. Combined with the parameter and complexity analysis discussed earlier, this significant accuracy gain is achieved while maintaining the same order of magnitude of parameters and inference overhead as MobileViT. This fully validates the effectiveness and high cost-effectiveness of the proposed module design for the fine-grained classification task of tree species in complex urban campus UAV environments.
4.7. Human–Vegetation Coupling Results
Based on the grid-level vegetation metrics defined in
Section 3.5, we generate a vegetation-density heat map, as shown in
Figure 12. In this framework, TreeSpecViT contributes to the coupling analysis by providing species-level labels for individual tree crowns, while crown delineation provides the geometric basis for canopy-area estimation and grid-level vegetation aggregation. These outputs jointly support the construction of the digital tree archive and the subsequent spatial coupling analysis. It should be noted, however, that uncertainty in the preceding recognition stage may propagate to downstream ecological interpretation, especially when the analysis involves species composition or species-aware summaries. For canopy-coverage-based indicators such as
, the direct influence mainly depends on crown delineation quality, whereas the reliability of species-related interpretation is more closely tied to classification accuracy.
To calibrate the grid-level activity field, we collected pedestrian-flow observations at two representative campus corridors, S1 and S2, during three typical periods: morning peak, midday, and evening peak. Each observation lasted 30 min, and the observed pedestrian intensities are summarized in
Table 8. The observation sites are shown in
Figure 13. These observations were used to calibrate the potential activity field, yielding the grid-level activity intensity
for the subsequent coupling analysis with vegetation coverage.
Figure 14 visualizes the relationship between calibrated human activity intensity
and vegetation coverage
V using a LOESS smoother and an exponential decay fit. Both curves show an overall decreasing trend of
V with increasing
, suggesting that high pedestrian-flow areas on campus are more often associated with relatively limited canopy coverage. This pattern is consistent with the functional structure of campuses, where movement is concentrated along paved corridors and near major facilities, while denser canopy coverage is more often found in less trafficked patches.
Importantly, this empirical coupling reflects a spatial association at the grid level rather than an individual behavioral preference. It does not imply that pedestrians avoid trees; instead, it indicates that some high-demand activity zones are not fully matched by canopy supply. This result provides practical evidence for prioritizing shade enhancement and greening interventions along high-use routes and functional hotspots.