Accurate vegetation mapping in mountainous Mediterranean terrain presents significant challenges due to topographical complexity and accessibility constraints. This study implements a U-Net architecture with MobileNetV2 encoder for automated vegetation segmentation using high-resolution UAV imagery in Dir El Ksiba, Morocco. The methodology leveraged 34 strategically selected images from challenging mountainous terrain, generating 9,996 standardized patches for optimized model training. Our approach targeted five vegetation classes: three phenological stages of Quercus ilex, Pinus halepensis, and Tetraclinis articulata. The U-Net+MobileNetV2 model demonstrated robust performance with validation metrics outperforming training metrics: 82.0% accuracy and mean Intersection over Union (mIoU) of 0.585. Class-specific IoU values revealed highest performance for Pinus halepensis (0.634), followed by Quercus ilex Stage 1 (0.598), Tetraclinis articulata (0.588), Quercus ilex Stage 2 (0.571), and Quercus ilex Stage 3 (0.556). The lightweight architecture (3.5M parameters) enables efficient deployment while maintaining competitive performance. This research establishes a methodological framework for applying deep learning-based vegetation segmentation in topographically complex Mediterranean ecosystems, addressing practical constraints of mountainous terrain data acquisition while maintaining scientific rigor.
Deep learning has transformed vegetation mapping from UAV imagery, yet state-of-the-art segmentation models require hundreds to thousands of expertly annotated images, creating prohibitive labor costs for conservation applications targeting endangered flora. This study addresses this bottleneck by systematically comparing three foundation models namely: DINOv2 (self-supervised), SegGPT (supervised), and SAM (promptable), for binary segmentation of Euphorbia resinifera, an endemic Moroccan succulent of conservation concern, using patches extracted from a single annotated UAV orthomosaic. A single-image training framework is presented where spatial diversity within one high-resolution orthomosaic substitutes for diversity across multiple images, combined with sliding window inference with vote-based fusion for full-resolution deployment. SegGPT achieved 83.74±2.55% mean IoU across 20 spatially independent test images spanning a 10.5-fold vegetation density gradient (2.01 to 21.11% coverage), outperforming DINOv2 (78.09±6.63%) and SAM (47.03±20.64%). The observed collapse in SAM’s performance, despite billion-mask pretraining, can be attributed to its architectural constraints. SAM’s fixed 1024×1024 input reduced training patches by 76.2%, and its frozen encoder limited trainable parameters to 0.1M versus SegGPT’s 316M. These findings establish that fine-tuned encoders substantially outperform frozen-encoder architectures for specialized vegetation (Euphorbia resinifera) segmentation, and that single-image foundation model training offers a viable paradigm for conservation deployment, reducing annotation costs from tens of thousands to hundreds of dollars. While demonstrated for a morphologically distinctive species, these principles may inform broader conservation remote sensing applications pending validation across diverse plant forms.