Abstract:Accurate extraction of apple orchards is fundamental for agricultural resource investigation, optimization of agricultural production layouts, and precision management. To improve the accuracy and spatial representation of apple orchard mapping in the hilly regions of the Loess Plateau, Yan’an City was selected as the study area. Based on Sentinel-2 multispectral imagery, an apple orchard extraction method integrating spectral features, vegetation indices, and texture features was developed, and the performances of traditional machine learning and deep learning models were comparatively evaluated. A random forest (RF) algorithm was employed for pixel-level classification of apple orchards. The results showed that the RF model achieved stable overall classification performance, with an overall accuracy of 93.99% and a Kappa coefficient of 0.932, although fragmented patches occurred in areas with complex terrain. The U-Net and SegFormer semantic segmentation models showed better spatial continuity and boundary integrity. Among them, U-Net achieved a Dice coefficient of 0.828 6 and an IoU of 0.779 on the test set, outperforming SegFormer (Dice=0.775 4, IoU=0.687 9). The total apple orchard area extracted using U-Net was approximately 275 800 hm2, showing a high degree of consistency with statistical data at the county scale (R2=0.96, RMSE=1 648.08 hm2). The results indicated that semantic segmentation methods can provide better spatial representation of orchards in complex hilly regions and provide reliable spatial data support for planting structure analysis and precision management in major apple-producing areas.