# Deep Learning for Palm Tree Health Assessment: UAV-Based Segmentation in the Figuig Region of Morocco

Ayoub Hammadi, Iliasse Mahi, Hassan Rhinane, Mehdi Maanan, Aude Zingraff-Hamed, Mohamed Maanan

► To cite this version:

Ayoub Hammadi, Iliasse Mahi, Hassan Rhinane, Mehdi Maanan, Aude Zingraff-Hamed, et al.. Deep Learning for Palm Tree Health Assessment: UAV-Based Segmentation in the Figuig Region of Morocco. ISPRS International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, 2026, XLVIII-4/W17-2025, pp.169 - 181. 10.5194/isprs-archives-xlviii-4-w17-2025-169-2026. hal-05492329

HAL Id: hal-05492329

https://hal.science/hal-05492329v1

Submitted on 4 Feb 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Deep Learning for Palm Tree Health Assessment:
## UAV-Based Segmentation in the Figuig Region of Morocco

Ayoub Hammadi<fnref n="1" />, Iliasse Mahi<fnref n="1" />, Hassan Rhinane<fnref n="1" />, Mehdi Maanan<fnref n="1" />, Aude Zingraff-Hamed<fnref n="2" />,<fnref n="3" />, Mohammed Maanan<fnref n="4" />

**Keywords:** UAV, Deep Learning, Palm Tree, Segmentation

## Abstract

This study addresses the challenge of classifying healthy and unhealthy date palm trees within the Figuig oasis region of Morocco using high-resolution Unmanned Aerial Vehicle (UAV) imagery and deep learning. Traditional methods like ground surveys are often time-consuming, costly, and subjective for large areas, while satellite-based remote sensing may lack the spatial resolution to assess individual tree health accurately. Our UAV-based deep learning approach aims to overcome these limitations by providing improved scalability, objectivity, and spatial precision. Recognizing that the 'unhealthy' status observable in top-down UAV imagery represents a visually complex aggregation of symptoms—potentially caused by various stressors prevalent in the Figuig oasis such as Bayoud disease (caused by Fusarium oxysporum f.sp. albedinis) and drought stress—our annotations focused on classifying trees exhibiting these general visual signs of poor health rather than specific causal agents. We therefore focused on semantic segmentation for pixel-level classification. High-resolution RGB orthomosaics were acquired via UAV, processed into tiles, and manually annotated to create a dataset distinguishing three classes: healthy palm, unhealthy palm, and background. This dataset, comprising 296 tiles derived from an initial set and split into training (70%), validation (20%), and testing (10%), was used to train and evaluate U-Net and DeepLabV3+ models implemented from scratch. Quantitative evaluation on the unseen test set demonstrated promising performance: the DeepLabV3+ model achieved a Macro Average F1-score of 82.06%, slightly outperforming the U-Net model's score of 81.28%. Both models showed strong capability in identifying background and healthy palms. However, accurately segmenting the diverse 'unhealthy' class remained the most significant challenge. This potentially highlights inherent difficulties in differentiating subtle or varied stress symptoms from aerial RGB data alone, and may also reflect potential limitations of these architectures in fully capturing fine-grained textural variations or distinguishing between visually similar stress responses without additional input (e.g., multispectral data). Despite these challenges, the findings underscore the potential of integrating UAV technology with custom deep learning models for practical, large-scale palm health status assessment in precision agriculture, offering a marked improvement over less scalable or lower-resolution traditional techniques. While limitations related to dataset diversity and the inability to distinguish specific stressors from RGB data exist, this research provides a foundation for developing AI-driven tools to support timely crop management decisions and promote sustainable date palm cultivation. Future work may focus on enhancing model robustness, incorporating complementary data sources (like thermal or multispectral imagery), and investigating model architectures better suited for subtle feature extraction.

<footnote n="1">¹ Geosciences Laboratory, Faculty of Sciences Ain Chock, Hassan II University of Casablanca, Casablanca 20100, Morocco</footnote>

<footnote n="2">² ENGEES - National School of Water and Environmental Engineering of Strasbourg, 67000 Strasbourg, France</footnote>

<footnote n="3">³ Laboratory Image City Environment, Faculty of Geography and Planning, University of Strasbourg, 67000 Strasbourg, France</footnote>

<footnote n="4">⁴ UMR 6554 CNRS LETG-Nantes Laboratory, Institute of Geography and Planning, Nantes University, 44312 Nantes, France</footnote>
# 1. INTRODUCTION

## 1.1 Background

The date palm (*Phoenix dactylifera*), one of the most ancient cultivated fruit trees, is renowned for its remarkable longevity *Riad* (1996). Its cultivation extends back millennia, with evidence tracing its origins to the Neolithic or Early Bronze Age *Tengberg* (2012). This distinctive tree typically features a single trunk crowned with large, pinnate (feather-like) leaves or fronds that can reach up to 4 meters in length, depending on age and environmental conditions *Zaid and de Wet* (2002). Mature date palms generally attain heights between 15 and 25 meters *Spennemann* (2018).

Thriving primarily in arid and semi-arid regions, date palms are extensively cultivated across the Arabian Peninsula, West Asia, and North Africa. Their inherent resilience allows them to withstand extreme heat, prolonged drought, and even saline or alkaline soils *Chao and Krueger* (2007). With -in these often demanding desert environments, date palms fulfill a critical ecological function by supporting biodiversity and stabilizing fragile ecosystems *Kurup et al.* (2009). Furthermore, their fruits possess a highly valued nutritional profile boasting a sugar content of 60-80% by dry weight, minimal fat, low sodium, ample fiber, and no cholesterol which establishes the date palm as an indispensable crop, particularly in hot climates *Al-Karmadi and Okoh* (2024).

Reflecting its significant economic and agricultural stature, global date production reached 9.74 million tons cultivated over 1.27 million hectares in 2022 FAO. The tree's capacity to thrive under challenging conditions with minimal inputs solidifies its role as a vital resource, especially during periods of food scarcity *Al-Karmadi and Okoh* (2024). Despite this notable resilience, date palms exhibit marked sensitivity to climatic variations. Long-term climate shifts are hypothesized to influence their population dynamics and distribution *Gros-Balthazard et al.* (2018), and these trees face mounting threats in arid regions from intensifying stressors such as more frequent and severe heatwaves and droughts *Reichgelt et al.* (2018). Adding to these environmental pressures, rising levels of tropospheric ozone—originating either from local anthropogenic emissions or through long-range atmospheric transport—pose an additional significant challenge to their survival *Hazzouri et al.* (2020); *Osipov et al.* (2021).

Beyond these climatic stressors, biological threats also prese-
-nt considerable risks to date palm cultivation. Notably,
the North African genetic pool, particularly in western re-
gions, demonstrates high vulnerability to Bayoud disease,
a devastating vascular wilt that has caused the loss of mil-
lions of date palms in Morocco, Algeria, and Mauritania
over the past century Sedra et al. (2003). This disease is
caused by the soil-borne fungus Fusarium oxysporum f. sp.
albedinis (FOA), commonly known as date-palm dieback,
which represents the most severe fungal threat currently
known to date palms. FOA spreads primarily via spores and
mycelium, typically initiating infection by colonizing the

roots before invading the vascular system, ultimately lead-
ing to tree mortality. Studies suggest Bayoud disease origi-
nated in Morocco before spreading and establishing itself as
a difficult-to-manage epiphytotic disease in neighboring re-
gions. The susceptibility of high-value date palm varieties,
such as Majhoul, Boufeggous, and Deglet Nour, exacerb-
bates the economic toll of this disease. Consequently, FOA
is classified as a quarantine organism within the European
Union and listed under the A2 category by the European and
Mediterranean Plant Protection Organization *Shambeh Al-
blooshi* (2020).

While significant advancements have been achieved in date palm cultivation techniques and management strategies, an urgent need persists for innovative solutions to address both established and emerging challenges effectively. Precision farming methodologies, which rely heavily on accurate and timely spatial data, stand to benefit immensely from technologies capable of automatically detecting palm trees and rapidly assessing their health status. The utilization of advanced techniques for swift problem identification and intervention is crucial to mitigate adverse impacts on both the quality and quantity of date production Zhang et al. (2017); Mahlein (2016). In this context, the advent of artificial intelligence (AI) and deep learning represents a potential paradigm shift, offering powerful computational tools to tackle these complexities, particularly in the fields of automated disease detection and classification. Deep learning algorithms, leveraging complex neural networks trained on extensive datasets, have already demonstrated remarkable proficiency in discerning subtle patterns indicative of stress or disease across various agricultural crops Kamilaris and Prenafeta-Boldú (2018).

Deep learning technology provides potent tools for com-
puter vision tasks pertinent to plant health assessment Singh
et al. (2016). However, the effective deployment of these
models often encounters challenges, primarily the require-
ment for large, diverse datasets for robust training and the
need for substantial computational resources to ensure ef-
ficient operation LeCun et al. (2015a). This paper explores
the application of advanced deep learning segmentation tech-
niques, specifically UNet and DeepLab, chosen for their
proven ability to perform detailed pixel-level classification
suitable for health mapping from aerial imagery. Our cen-
tral aim is to address the challenges of date palm health
monitoring within the Figuig region of Morocco. We focus
on developing and evaluating an efficient approach for dif-
ferentiating between healthy and unhealthy palm trees us-
ing high-resolution, UAV-derived orthophotos, thereby con-
tributing to the advancement of precision agriculture in this
vital sector.

## 1.2 Related Studies

This research builds upon advancements in unmanned aerial
vehicle (UAV) technology, artificial intelligence (AI), and
plant health monitoring, positioned within the context of
existing work on date palm (*Phoenix dactylifera*) manage-
ment. The significant agricultural and economic role of date
palms, particularly in arid regions such as Figuig, Morocco, underscores the importance of effective health monitoring to mitigate threats from diseases (e.g., Bayoud), pests, and abiotic stress, thereby ensuring productivity and promoting sustainable practices El Hadrami et al. (1999). Traditional ground-based inspection methods, however, are often characterized by their labor-intensive nature, subjectivity, and limitations in providing timely, large-scale assessments, which motivates the exploration of more efficient, technology-driven precision agriculture approaches Mulla (2013).

The potential of UAVs combined with AI for agricultural applications is increasingly recognized. UAVs offer unparalleled capabilities for acquiring high-resolution imagery with detailed spatial, temporal, and spectral information crucial for crop monitoring. Concurrently, deep learning (DL) techniques, especially convolutional neural networks (CNNs), have shown remarkable success in automatically interpreting visual data for tasks like plant stress and disease identification across diverse agricultural systems Hasan et al. (2023). While the general utility of these combined technologies is well-established for various crops, their specific application focused on the nuanced health dynamics of date palms, particularly using large-area aerial imagery, justifies further investigation.

Several studies have indeed explored AI for assessing palm health, though often employing data sources other than UAV-derived orthomosaics. For example, sophisticated models have classified specific palm leaf diseases with high accuracy (e.g., 97.9%) using curated, ground-level image datasets Khan et al. (2020). Others have utilized mobile phone imagery to detect palm diseases, typically capturing vertical tree sections rather than a top-down perspective Al-Dosary et al. (2021); Al-Saddi et al. (2022). Research has also addressed disease detection in different palm species, such as oil palm Yarak et al. (2021), or mapped disease distribution using field-based methods like kernel density Moujaoui et al. (2021). While informative, these approaches differ from the present study in terms of data source, scale, perspective, or target species, limiting their direct applicability to large-scale date palm health monitoring from UAVs.

Another relevant line of research has successfully applied UAVs and AI/DL techniques for palm tree inventory tasks, including counting, localization, and species identification. Studies have demonstrated reliable classification of palm species, achieved high precision in localizing individual trees, accurately detected oil palms, and specifically counted date palms using object detection and segmentation Al-Saddi et al. (2023); Ferreira et al. (2020); Gibril et al. (2023). These contributions are valuable for mapping palm distribution and density. However, such studies typically focus on identifying the presence or location of trees and do not extend their analysis to evaluate the physiological or health status of these palms, which is the primary goal of our work.

Therefore, a review of the existing literature reveals a specific gap: the integrated application of UAV-derived orthomosaics and deep learning semantic segmentation techniques

for the express purpose of classifying date palm health status (healthy vs. unhealthy) over large agricultural areas from a top-down viewpoint. Previous research has primarily focused on different crops, employed ground-level or alternative imaging perspectives, concentrated on inventory rather than health assessment, or utilized different palm species. This study aims to directly address this gap by developing and evaluating a framework using UNet and DeepLab segmentation models applied to high-resolution UAV orthomosaics from the Figuig region. Our objective is to accurately differentiate healthy and unhealthy date palms based on colors, shapes characteristics, and density, thereby providing a novel and potentially scalable tool for precision agriculture and sustainable date palm management in arid environments.

## 2. EXPERIMENTAL SITE

### 2.1 Study Area

<figure><img src="image_2.png" /><figcaption>Figure 1: Map of the Figuig region showing the study area.</figcaption></figure>

Figuig, the focus of this investigation, is an oasis town strategically situated in Morocco's easternmost territory, adjacent to the Atlas Mountains and the Algerian border. It serves as the administrative hub for the Figuig Province within the Oriental Region. This expansive province covers 55 990 km², constituting 67.69% of the Oriental Region and 7.92% of Morocco's total land area. Primarily rural, the province includes 13 communes (two urban: Figuig and Bouarfa; 11 rural) organized under 8 cadats and 2 circles Population (2024). Geographically, the Figuig Province is defined by high plateaus and the eastern spurs of the High Atlas mountain range. The northern section features plateaus at 1300 m to 1500 m altitude, predominantly covered by esparto grass and dissected by intermittent watercourses. The central zone incorporates the eastern termination of the Great Atlas, with elevations reaching 1500 m to 2000 m. Further east and south lie the Jbel Grouz and Gheis ranges, the Guir basin, and the Hammadat Guir plateau. Crucially, three oases—Figuig, Bouanane, and Aïn-Chouatter—are located at the base of these mountain formations. The province's western part is mountainous with variable altitudes, culminating in Jbel Masrouh, the highest peak at 2714 m. The
region's climate is classified as semi-arid, characterized by pronounced seasonal variations including cold winters, very hot summers, and frequent winds. Annual precipitation is low and erratic, typically ranging from only 25 mm in droug -ht years up to 150 mm in normal years, occurring over approximately 30 to 40 days de l'Intérieur (2005). This aridity profoundly influences the local hydrology. The primary watercourses (Oued Bouanane, Oued Zouzfana feeding Figuig, Oued Falet, and Oued Guir) are ephemeral, carrying significant flow only during brief rainy periods. Consequently, the sustainability of the Figuig oasis itself hinges critically on groundwater. Currently, 28 active freshwater springs supply vital irrigation and drinking water. However, agriculture within the oasis and its periphery also relies on a secondary aquifer, which faces increasing salinity issues attributed to over-extraction. The town of Figuig lies at an elevation of 915 m (3002). According to the most recent available census data, the population stands at approximately 10,449 inhabitants, reflecting fluctuations from a peak of 14,571 in 1982 and 10,872 in 2014. The community is noted for its diversity, historically comprising Berber-speaking sedentary populations, religious figures (marabout -s), agricultural workers (Harratins), and a significant Jewish Berber group. Figui -g's economy remains largely anchored in agriculture, with date palm cultivation playing a central role, supplemented by traditional crafts like textiles and carpets. The town also boasts considerable historical significance, evident in its well preserved architectural heritage, including ancient ruins, fortified villages (ksour), and a rich cultural identity shaped over centuries Wikipedia contributors. From an agricultural perspective, the soil within the Figuig oasis is relatively fertile – typically clayey-silty, rich in potassium and magnesium, though somewhat deficient in organic matter. This contrasts sharply with the surrounding landscape; the high plateaus are marked by eroded limestone slabs, while the hills feature deep soils formed by water erosion, making them vulnerable when cleared or plowed. Vegetation mirrors this pattern: esparto grass and mugwort dominate the high plateaus, thinning out towards the south where thorny, drought-resistant plants prevail. Limited natural and artificial forest patches exist in the western Talsint area and on the Jbel Lakhdar and Jbel Krouz slopes Scene (2025). The core of the Figuig oasis, and thus the specific focus of this study, is its extensive date palm grove. A survey conducted between 2016 and 2017 documented over 4,320 date palm trees distributed across 113 farms. These farms utilize a mix of traditional and modern plantation systems, reflecting the blend of heritage and evolving agricultural practices within the oasis Moujaoui et al. (2021).

## 2.2 UAV Image Acquisition and Preprocessing

High-resolution aerial imagery was acquired using a DJI Phantom 4 RTK unmanned aerial vehicle (UAV). This platform was selected primarily for its integrated high-precision Real-Time Kinematic (RTK) Global Navigation Satellite System (GNSS) module, which facilitates accurate direct geo-referencing crucial for detailed aerial mapping. The UAV

<figure><img src="image_3.png" /><figcaption>Figure 2: Orthophoto mosaic showing the large-scale dataset with detailed views: (a) Field 1, (b) Field 2, (c) Field 3.</figcaption></figure>

was equipped with its standard onboard camera, featuring a 1-inch, 20-megapixel CMOS sensor capturing imagery in the standard RGB (Red, Green, Blue) spectral bands. The camera's fixed focal length of 8.8 mm (equivalent to 24 mm in 35mm format) provided sufficient spatial resolution and image detail for subsequent feature identification and orthomosaic generation.

All flight missions were conducted operating the UAV in RTK mode. This approach ensures high absolute positional accuracy (cm-level) is directly embedded within the EXIF metadata of each captured image, significantly streamlining the georeferencing workflow and minimizing reliance on an extensive network of ground control points (GCPs). Real-time corrections were supplied by a ground-based DJI D-RTK 2 Mobile Station, configured as the base receiver. The base station was positioned over a known survey marker with clear sky visibility throughout the flight operations to ensure consistent and reliable correction data transmission to the UAV. Flight parameters were optimized based on preliminary tests and mission requirements, setting the flight altitude at 75 m above ground level (AGL). Image overlaps were maintained at 80% forward lap and 25% side lap to guarantee robust photogrammetric reconstruction and minimize gaps in the final dataset, achieving a nominal ground sampling distance (GSD) of approximately 2 cm.

The acquired raw UAV images were processed using the photogrammetric software Agisoft Metashape Professional. The standard workflow involved: (1) Importing images and assessing initial quality; (2) Performing camera alignment using the high-accuracy RTK geotags via the structure-from-motion (SfM) algorithm; (3) Generating a dense point cloud based on the aligned camera positions and orientations; (4) Creating a 3D mesh surface from the dense cloud; and finally, (5) Generating and exporting the final orthomosaic product. The software's robust alignment algorithms leveraging the precise image coordinates and its effective texture blending capabilities resulted in a seamless, geometrically accurate, and high-resolution orthomosaic suitable for detailed analysis of the palm tree.
## 2.3 Labelling Datasets

High-quality and sufficient training data are critical for Deep learning algorithms, particularly for segmentation tasks requiring pixel-level class assignments. This study focuses on classifying date palm health status in the Figuig region of Morocco using very high spatial resolution (VHSR) UAV data. A meticulous manual annotation process was employed to create the necessary ground truth masks.

Pixels in the UAV imagery were assigned to one of three classes: **Healthy Palm Tree**, **Unhealthy Palm Tree**, or **Background** (non-palm tree areas). Given the reliance on top-down imagery (horizontal sections) without detailed vertical views, the classification between healthy and unhealthy palms was based on observable morphological and characteristic features:

* **Healthy Palm Trees** were identified by characteristics indicative of vigor: a robust, generally symmetrical, and expansive canopy shape; vibrant green to whitish-green frond coloration without significant discoloration; and evenly spaced, well developed frond -ds. Relative size compared to neighboring trees was also considered.

* **Unhealthy Palm Trees** exhibited signs of stress or disease: a smaller, irregular, or sparse canopy (potentially due to frond loss or stunted growth); significant frond discoloration (e.g., yellowing, browning, spotting); wilted or drooping fronds; potentially irregular shadow patterns; or other visible deformities.

Figure 3 provides visual examples illustrating these distinguishing features used during the annotation process.

<figure><img src="image_4.png" /><figcaption>Figure 3: Example of Healthy and Unhealthy instances used for annotation criteria.</figcaption></figure>

Processing the large VHSR UAV orthomosaic directly pres-ents computational challenges (GPU/TPU memory, time). To mitigate this, the orthomosaic was first divided into uniform 1024×1024 pixel image tiles, ensuring individual palms were generally kept intact within tiles. Subsequently, these tiles were manually annotated using the Roboflow platform according to the criteria defined above. The annotation process covered diverse contexts, including palms in rural farms (vegetation/soil backgrounds) and urban areas (roads, buildings backgrounds), to ensure dataset representativeness. An example of an annotated image tile and its corresponding mask is shown in Figure 4.

These annotated 1024×1024 pixel tiles then underwent fur-

<figure><img src="image_5.png" /><figcaption>Figure 4: Example of an annotated image tile and its corresponding segmentation mask.</figcaption></figure>

ther preprocessing within Roboflow. They were resized to 512×512 pixels to match the input size requirements of the UNet and DeepLabv3+ architectures and optimize the use of computational resources during TPU-based training with TensorFlow, while retaining essential palm features. The resulting ground truth masks served as the benchmark for model training and evaluation.

## 2.4 Methodology Workflow

This study employs a systematic workflow, illustrated in Figure 5, encompassing data acquisition, preparation, model training, and evaluation for classifying date palm health status using deep learning segmentation models. The process begins with the acquisition of large-scale orthophoto imagery of the study area using a UAV. To manage computational resources and facilitate annotation, the orthophoto is first divided into uniform image tiles with dimensions of 1024×1024 pixels. Each tile undergoes manual pixel-level annotation, where pixels are assigned to one of three categories: 'Healthy Palm', 'Unhealthy Palm', or 'Background'. This detailed labeling process generates the ground truth segmentation masks. Subsequently, these annotated 1024×1024 tiles are resized to 512×512 pixels. This resizing step ensures compatibility with the input layers of the chosen deep learning models (UNet and DeepLabv3+) and reduces memory requirements during training, optimizing computational efficiency.

The resulting dataset of 512×512 annotated tiles is then partitioned into three standard subsets: 70% designated for model training, 20% for validation during training, and the remaining 10% held out for final testing. To enhance the diversity of the training data, improve model robustness, and mitigate overfitting, a series of data augmentation techniques are applied exclusively to the 70% training subset. These techniques include geometric transformations (e.g., rotation, flipping, cropping) and photometric adjustments (e.g., contrast adjustment, sharpening, hue shifts).

Two state-of-the-art semantic segmentation models, UNet and DeepLab, are trained independently using the augmented training dataset. During the training process, the 20% validation subset is utilized periodically to monitor model per-
formance, tune hyperparameters (such as learning rate), and
select the best-performing model weights based on valida-
tion metrics, thereby ensuring good generalization capabil-
ity.

<figure><img src="image_6.png" /><figcaption>Figure 5: Overview of the methodology workflow</figcaption></figure>

Following the completion of training and validation, the fi-
nal performance of the trained UNet and DeepLabv3+ mod-
els is rigorously evaluated on the unseen 10% testing subset.
This evaluation employs a set of standard quantitative seg-
mentation metrics (e.g., Intersection over Union (IoU), pre-
cision, F1-score and recall. The performance results of both
models are then compared to systematically assess their re-
spective strengths, weaknesses, and overall suitability for
the task of date palm health classification from UAV im-
agery in the Figuig region. This comparative analysis pro-
vides insights for potential future improvements and de-
ployment considerations.

2.5 U-Net Architecture

The U-Net architecture, initially developed for biomedical
image segmentation Ronneberger et al. (2015), is a fully
convolutional neural network (FCNN) renowned for pre-
cise pixel-wise semantic segmentation. Its defining fea-
ture is a symmetric encoder-decoder structure, often termed
contracting and expanding paths, enhanced by skip connec-
tions. These connections concatenate high-resolution fea-
ture maps from the encoder path directly with correspond-
ing up-sampled feature maps in the decoder path. This
mechanism enables the network to effectively combine de-
tailed spatial information from early layers with abstract
contextual features from deeper layers, facilitating accu-
rate localization of segmentation boundaries LeCun et al.
(2015b). Distinct from typical classification CNNs that pro-
gressively reduce spatial dimensions, U-Net aims to main-
tain spatial information throughout the decoding process,
outputting a full-resolution segmentation map where each
pixel receives a class label. This makes it highly suitable

for tasks demanding spatial precision, such as classifying
healthy palms, unhealthy palms, and background pixels in
this study.

The standard U-Net model implemented in this work was built from scratch. It processes input image tiles of size 512×512×3 (Height×Width×Channels, RGB data) and outputs a segmentation map of the same spatial dimensions with 3 channels (512×512×3), corresponding to the pixel-wise probabilities for the three target classes. As depicted in Figure 6, this architecture comprises:

*   **Encoder (Contracting Path):** Consists of multiple sequential blocks (typically four or five). Each block applies two consecutive 3×3 convolutions (each usually followed by ReLU activation) and concludes with a 2×2 max pooling operation with a stride of 2 for downsampling. This process progressively reduces spatial resolution while increasing the number of feature channels (e.g., starting with 64 filters and doubling at each step).

*   **Bottleneck:** Situated at the point of lowest spatial resolution, connecting the encoder and decoder paths. It typically consists of two 3×3 convolutions (with ReLU) similar to the encoder blocks, capturing the most abstract features (e.g., using 1024 filters).

*   **Decoder (Expanding Path):** Symmetrically mirrors the encoder structure. Each block begins with an up-sampling operation (e.g., a 2×2 transposed convolution or up-convolution) that doubles the spatial resolution and typically halves the number of feature channels. The resulting feature map is then concatenated with the corresponding feature map from the encoder path via a skip connection. This concatenated map is processed through two consecutive 3×3 convolutions (with ReLU).

*   **Final Layer:** A final 1×1 convolution reduces the number of feature channels to the number of output classes (3 in this study). A softmax activation function is then applied pixel-wise across the channels to generate the final probability map for each class.

2.6 DeepLabv3+ Architecture

DeepLabv3+ stands as a state-of-the-art architecture for se-
mantic image segmentation Ronneberger et al. (2015), evolv-
ing from the DeepLab series Chen et al. (2018); Ronneberger
et al. (2015). Its primary innovation lies in capturing multi-
scale contextual information efficiently using atrous (dilated)
convolutions Yu and Koltun (2015); Ronneberger et al. (2015)
within a fully convolutional framework, while also incorpo-
rating mechanisms to refine segmentation boundaries Ron-
neberger et al. (2015). Atrous convolutions allow the net-
work to expand its receptive field and aggregate context
from wider areas without the loss of spatial resolution asso-
ciated with aggressive pooling or striding Chen et al. (2017),
making it suitable for segmenting objects at various scales
Ronneberger et al. (2015).
<figure><img src="image_7.png" /><figcaption>Figure 6: Diagram of the U-Net architecture implemented in this study, showing the standard encoder (contracting path), decoder (expanding path), bottleneck, skip connections, and the progression of feature map dimensions and channels.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 7: Diagram of the DeepLabv3+ architecture implemented in this work.</figcaption></figure>
Compared to the U-Net's symmetric design with extensive skip connections Yu and Koltun (2015), DeepLabv3+ adopts a different strategy Ronneberger et al. (2015). It employs a deep convolutional network as a feature extractor (backbone), often modifying standard architectures with atrous convolutions in later stages to preserve spatial detail (i.e., maintain a larger output stride). Multi-scale context is explicitly aggregated using an Atrous Spatial Pyramid Pooling (ASPP) module. A distinct characteristic of DeepLabv3+ compared to its predecessor (DeepLabv3) is the reintroduction of a simple decoder module that fuses high-level semantic features with low-level spatial details from earlier in the network to achieve sharper segmentation boundaries Ronneberger et al. (2015).

For this study, the DeepLabv3+ model was implemented from scratch. It accepts 512×512×3 (RGB) image tiles as input and generates a corresponding 512×512×3 segmentation map representing pixel-wise probabilities for the healthy palm, unhealthy palm, and background classes. The core components of the implemented architecture, visualized in Figure 7, include:

* **Backbone Network:** A custom deep convolutional neural network, designed specifically for this task, serves as the feature extractor. It consists of multiple convolutional blocks that progressively extract more complex features. Atrous convolutions are employed in the final blocks to maintain a relatively high feature map resolution (e.g., achieving an output stride of 16) compared to standard classification networks, preserving more spatial detail for the subsequent modules.

* **Atrous Spatial Pyramid Pooling (ASPP):** Applied to the feature map generated by the backbone. This module probes the incoming features with filters at multiple scales using parallel branches: typically including one 1×1 convolution, several 3×3 atrous convolutions with different dilation rates (e.g., 6, 12, 18), and an image-level feature branch (global average pooling followed by 1x1 convolution and upsampling). The outputs are concatenated to form a rich multi-scale feature representation.

* **Decoder Module:** The concatenated features from the ASPP module are first bilinearly upsampled (e.g., by a factor of 4). These features are then fused (via concatenation) with low-level features extracted from an earlier stage of the custom backbone network (e.g., after the first few convolutional blocks), which retain finer spatial details. This combined feature map is typically refined using one or more convolutional layers (e.g., 3×3 or 1×1). The result is subsequently upsampled again (e.g., by another factor of 4) to restore the original input image resolution.

* **Final Layer:** A 1×1 convolution maps the refined decoder features to the final number of classes (3). A pixel-wise softmax activation function is then applied to produce the probability map for each class.

### 3. EVALUATION METRICS

The performance of the semantic segmentation models (U-Net and DeepLabv3+) was quantitatively evaluated using a standard set of pixel-level metrics. These metrics assess the agreement between the model's predicted segmentation map and the manually annotated ground truth mask on the test dataset. The primary metrics employed were Intersection over Union (IoU), Precision, Recall, and the F1-score.

Crucially, for multi-class segmentation problems like this one (Healthy Palm, Unhealthy Palm, Background), metrics such as IoU, Precision, Recall, and F1-score are typically calculated on a **per-class basis**. These per-class scores can then be averaged (e.g., using macro-averaging or weighted-averaging) to provide overall performance indicators like mean IoU (mIoU) or macro-F1, if desired.

The definitions of the core components used in these metrics are:

* **TP (True Positive):** Number of pixels correctly classified as belonging to the class of interest.

* **FP (False Positive):** Number of pixels incorrectly classified as belonging to the class of interest (they actually belong to another class).

* **FN (False Negative):** Number of pixels belonging to the class of interest that were incorrectly classified as belonging to another class.

The specific metrics used are defined as follows (Equations must be numbered consecutively):

* **Intersection over Union (IoU / Jaccard Index):** This is a primary metric for segmentation. It measures the overlap between the predicted mask and the ground truth mask for a specific class. It is calculated as the ratio of the intersection area to the union area.

$$IoU = \frac{TP}{TP + FP + FN} \qquad (1)$$

* **Precision (Positive Predictive Value):** For a given class, this measures the accuracy of the positive predictions. It represents the fraction of pixels predicted as belonging to the class that actually belong to that class.

$$Precision = \frac{TP}{TP + FP} \qquad (2)$$

* **Recall (Sensitivity / True Positive Rate):** For a given class, this measures the model's ability to correctly identify all relevant pixels. It represents the fraction of pixels actually belonging to the class that were correctly predicted as such.

$$Recall = \frac{TP}{TP + FN} \qquad (3)$$
* **F1-score:** This metric provides a balance between Precision and Recall for a specific class, calculated as their harmonic mean. It is useful when there is an uneven class distribution or when both false positives and false negatives are important.

$$ 
\begin{aligned}
\text{F1-score} &= 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} \\
&= \frac{2 \times \text{TP}}{2 \times \text{TP} + \text{FP} + \text{FN}}
\end{aligned} 
\quad (4) $$

These metrics provide a comprehensive assessment of the models' performance, allowing for detailed comparison and analysis of their ability to accurately segment healthy palms, unhealthy palms, and background areas in the UAV imagery. Scores for each metric range from 0 (worst performance) to 1 (perfect performance).

# 4. EXPERIMENTAL SETUP

All model development, training, and evaluation were performed within the Google Colaboratory (Colab) environment using the TensorFlow framework (version 2.18), leveraging Google's Tensor Processing Units (TPUs) when available via Colab runtimes and managed using TensorFlow's distribution strategies. We implemented both the U-Net (Figure 6) and DeepLabV3+ (Figure 7) segmentation models from scratch using the Keras API. Input data consisted of 512×512 pixel RGB image tiles and corresponding grayscale masks sourced from pre-split directories on Google Drive. Images were normalized to [0, 1], and masks were one-hot encoded for the three target classes (background, healthy palm, unhealthy palm). Data was loaded directly into NumPy arrays using Keras utilities before being converted into objects for training. The models were trained for 100 epochs using the Adam optimizer with its default learning rate, categorical cross-entropy as the loss function, and a batch size of 8. Training progress was monitored using a validation set, and the final models and training histories were saved.

# 5. RESULTS

The trained U-Net and DeepLabV3+ models, implemented from scratch, were quantitatively evaluated on the unseen test set consisting of 24 image tiles. Performance was assessed using Intersection over Union (IoU), Precision, Recall, and F1-score, calculated for each of the three classes (Background, Healthy, Unhealthy) and subsequently averaged using Macro-averaging to provide overall performance indicators. A detailed comparison of these metrics for both models is presented in Table 1.

The U-Net model achieved a Macro Average IoU of 0.7005 and a Macro Average F1-score of 0.8128. As shown in Table 1, per-class analysis indicated strong performance on

<table><caption>Table 1: Comparison of Segmentation Performance Metrics for U-Net and DeepLabV3+ on the Test Set.</caption><thead><tr><th>Metric</th><th>Class</th><th>U-Net</th><th>DeepLabV3+</th></tr></thead><tbody><tr><td rowspan="3">IoU (Jaccard)</td><td>Background</td><td>0.9104</td><td>0.9116</td></tr><tr><td>Healthy</td><td>0.6851</td><td>0.6867</td></tr><tr><td>Unhealthy</td><td>0.5062</td><td>0.5310</td></tr><tr><td rowspan="3">Precision</td><td>Background</td><td>0.9608</td><td>0.9488</td></tr><tr><td>Healthy</td><td>0.8020</td><td>0.8261</td></tr><tr><td>Unhealthy</td><td>0.6436</td><td>0.7074</td></tr><tr><td rowspan="3">Recall</td><td>Background</td><td>0.9455</td><td>0.9588</td></tr><tr><td>Healthy</td><td>0.8245</td><td>0.8028</td></tr><tr><td>Unhealthy</td><td>0.7033</td><td>0.6804</td></tr><tr><td rowspan="3">F1-Score</td><td>Background</td><td>0.9531</td><td>0.9538</td></tr><tr><td>Healthy</td><td>0.8131</td><td>0.8143</td></tr><tr><td>Unhealthy</td><td>0.6721</td><td>0.6937</td></tr><tr><td>Macro Avg IoU</td><td>–</td><td>0.7005</td><td>0.7098</td></tr><tr><td>Macro Avg Precision</td><td>–</td><td>0.8021</td><td>0.8275</td></tr><tr><td>Macro Avg Recall</td><td>–</td><td>0.8244</td><td>0.8140</td></tr><tr><td>Macro Avg F1-Score</td><td>–</td><td>0.8128</td><td>0.8206</td></tr></tbody></table>

the Background class (IoU: 0.9104), good performance on the Healthy class (IoU: 0.6851), and more moderate performance on the Unhealthy class (IoU: 0.5062). The corresponding confusion matrix (Figure 8a) reveals high recall for Background (94.55%) and Healthy palms (82.45%). However, some Healthy palms were misclassified as Background (10.44%). The Unhealthy class exhibited the lowest recall (70.33%), with notable confusion occurring with both the Healthy (15.55%) and Background (14.12%) classes.

The DeepLabV3+ model demonstrated slightly superior overall performance, yielding a Macro Average IoU of 0.7098 and a Macro Average F1-score of 0.8206 (Table 1). Per-class IoU scores were similarly high for Background (0.9116), comparable for Healthy (0.6867), and slightly better for the Unhealthy class (0.5310) compared to U-Net. DeepLabV3+ achieved excellent Background recall (95.88%). Its Healthy palm recall was slightly lower than U-Net's (80.28%), with the primary confusion being towards the Background class (14.58%). As shown in its confusion matrix (Figure 8b), the Unhealthy class recall was 68.04%, also showing confusion with Background (17.49%) and Healthy palms (14.46%). Notably, DeepLabV3+ achieved higher precision than U-Net for both Healthy (0.8261 vs 0.8020) and Unhealthy (0.7074 vs 0.6436) classes.

# 6. MODELS COMPARISON AND DISCUSSION

## 6.1 Models comparaison

Figure 9 presents a visual comparison of the U-Net and DeepLabV3+ predictions on three distinct zones. Both models successfully segment palm tree instances from the background and assign a uniform *Healthy* (Green) or *Unhealthy*
<figure><img src="image_9.png" /><figcaption>Figure 8: Confusion matrices for the U-Net and DeepLabV3+ models evaluated on the test set.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Figure 9: Pixel-level prediction comparison on three representative zones.</figcaption></figure>
(Yellow) label based on the instance's majority predicted class, consistent with the training objective.

Visual inspection reveals generally good segmentation by both models. However, consistent differences appear in classification: U-Net frequently identifies larger or more numerous *Unhealthy* (yellow) regions across the zones, while DeeplabV3+ tends to classify larger contiguous areas as *Healthy* (green), particularly in Zones 1 and 3.

The bar charts quantitatively confirm this trend. U-Net consistently assigns significantly more pixels to the *Unhealthy* category across all examples, whereas DeeplabV3+ often shows higher pixel counts for *Healthy* pixel in Zone 1 and approximately equal for the rest zones.

In summary, both models achieve the target pixel-level segmentation and classification. Nonetheless, they exhibit different sensitivities based on the learned features: U-Net appears more prone to classifying pixel as *Unhealthy*, while DeeplabV3+ is more conservative in this regard for these examples.

## 6.2 Discussion

This study demonstrated the potential of applying deep learning models (U-Net and DeepLabV3+) to high-resolution UAV RGB imagery for mapping date palm health in the Figuig oasis, addressing limitations of traditional ground surveys (scalability, cost) and satellite imagery (resolution). DeepLabV3+ marginally outperformed U-Net (82.06% vs. 81.28% F1-score), likely due to its ASPP module capturing multi-scale context. However, both models struggled with accurately segmenting the visually diverse 'unhealthy' class (IoU 0.51-0.53), reflecting the inherent difficulty in differentiating varied stress symptoms (potentially from Bayoud disease, drought, etc.) using RGB data alone, which may miss subtle or early physiological changes. While offering significant advantages in objective, large-scale monitoring for targeted interventions in precision agriculture, key limitations include the reliance on visible symptoms captured by RGB, the constraints of nadir imagery for full crown assessment, and the limited generalizability stemming from the modest dataset size. These factors highlight the need for complementary data and further refinement for robust field deployment.

## 7. Conclusion

In conclusion, this research successfully establishes the feasibility of integrating UAV technology and deep learning segmentation for assessing date palm health status within the Figuig oasis. While demonstrating promising results and advantages over traditional methods, accurately classifying the visually ambiguous 'unhealthy' category remains a challenge solely with RGB data. Future work is essential to enhance practical utility and reliability, primarily through the incorporation of multispectral or hyperspectral sensors to capture pre-visual stress indicators, significant expansion of training datasets for improved robustness, and rigorous

ground validation to correlate remote classifications with specific causal agents and physiological states. Addressing these aspects will pave the way for developing powerful, AI-driven tools to support sustainable date palm cultivation and timely management decisions in vulnerable oasis ecosystems.

## References

Mona M. Al-Dosary, Abdulaziz Al-Mujaini, and Abdulah M. Al-Sadi. Development of a mobile application for the detection of date palm diseases using deep learning. *Applied Sciences*, 11(11):5141, 2021.

Ashgan Al-Karmadi and Anthony Ifeanyin Okoh. An overview of date (phoenix dactylifera) fruits as an important global food resource. *Foods*, 13(7):1024, 2024.

F. Al-Saddi, J. M. Abdul-Jabbar, and A. Al-Saffar. A survey on deep learning-based identification of plant and crop diseases from uav-based aerial images. *Cluster Computing*, 2022. doi: 10.1007/s10586-022-03627-x.

F. Al-Saddi et al. Deep learning applications for oil palm tree detection and counting. *Artificial Intelligence in Agriculture*, 9:71–80, 2023. doi: 10.1016/j.aiia.2023. 07.001.

ChihCheng T Chao and Robert R Krueger. The date palm (phoenix dactylifera l.): overview of biology, uses, and cultivation. *HortScience*, 42(5):1077–1082, 2007.

Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation, 2017.

Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In *Proceedings of the European conference on computer vision (ECCV)*, pages 801–818, 2018.

Ministère de l'Intérieur. Monographie de la province de figuig. Available for download from the RADDO website, May 2005. Accessed: 2025-03-10.

A. El Hadrami, A. El Idrissi-Tourane, and S. El Jaafari. Date palm status and perspective in morocco. In A. Zaid and E.J. Arias-Jimenez, editors, *Date Palm Production and Protection*, pages 64–78. FAO Plant Production and Protection Paper 156, Rome, Italy, 1999.

Food FAO. Agriculture organization of the united nations, crops.

M. P. Ferreira et al. Individual tree detection and species classification of amazonian palms using uav images and deep learning. *Forest Ecology and Management*, 475: 118397, 2020. doi: 10.1016/j.foreco.2020.118397.

Mohamed Barakat A Gibril, Helmi Zulhaidi Mohd Shafri, Rami Al-Ruzouq, Abdallah Shanableh, Faten Nahas, and
Saeed Al Mansoori. Large-scale date palm tree segmentation from multiscale uav-based and aerial images using deep vision transformers. *Drones*, 7(2):93, 2023.

Muriel Gros-Balthazard, Khaled Michel Hazzouri, and Jonathan Mark Flowers. Genomic insights into date palm origins. *Genes*, 9(10):502, 2018.

R. I. Hasan, S. M. Yusuf, and L. Alzubaidi. A review on uav-based applications for plant disease detection and monitoring. *Remote Sensing*, 15(17):4273, 2023. doi: 10.3390/rs15174273.

Khaled Michel Hazzouri, Jonathan M Flowers, David Nelson, Alain Lemansour, Khaled Masmoudi, and Khaled MA Amiri. Prospects for the study and improvement of abiotic stress tolerance in date palms in the post-genomics era. *Frontiers in plant science*, 11:293, 2020.

Andreas Kamilaris and Francesc X. Prenafeta-Boldú. Deep learning in agriculture: A survey. *Computers and Electronics in Agriculture*, 147:70–90, 2018.

Ahmed I. Khan, Syed M. K. Quadri, Jehangir Ali Shah, and Saad Ahmad Khan. Detection and classification of date palm leaf diseases using deep learning. *Plants*, 9(8): 1030, 2020.

Shyam S Kurup, Yousef S Hedar, Mouza A Al-Dhaheri, Ahmed Y El-Heawiety, Mohammed AM Aly, and Ghaleb Alhadrami. Morpho-physiological evaluation and rapd markers-assisted characterization of date palm (phoenix dactylifera l.) varieties for salinity tolerance. 2009.

Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. *Nature*, 521(7553):436–444, 2015a.

Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. *nature*, 521(7553):436–444, 2015b.

Anne-Katrin Mahlein. Plant disease detection by imaging sensors – parallels and specific demands for precision agriculture and plant phenotyping. *Plant Disease*, 100 (2):241–251, 2016.

N Moujaoui, E Hariri, and MA Elhoumaizi. Bayoud and belaat diseases of date palm (phoenix dactylifera l.) in figuig oasis of morocco. In *IOP Conference Series: Earth and Environmental Science*, volume 782, page 042065. IOP Publishing, 2021.

David J. Mulla. Twenty five years of remote sensing in precision agriculture: Key advances and remaining knowledge gaps. *Biosystems Engineering*, 114(4):358–371, 2013.

Andrey F Osipov, Kapitolina S Bobkova, and Alexey A Dymov. Carbon stocks of soils under forest in the komi republic of russia. *Geoderma regional*, 27:e00427, 2021.

City Population. Figuig (province, morocco) - population statistics, charts, map. https://www.citypopulation.de/en/morocco/oriental/admin/251_figuig/, 2024. Accessed: 2024-09-01.

Tammo Reichgelt, Christopher K West, and David R Greenwood. The relation between global palm distribution and climate. *Scientific Reports*, 8(1):4721, 2018.

M Riad. The date palm sector in egypt. *CIHEAM-Options Mediterr*, 53:45–53, 1996.

Olaf Ronneberger, Philipp Fischer, and Thomas Brox. Unet: Convolutional networks for biomedical image segmentation. In *Medical image computing and computer-assisted intervention-MICCAI 2015: 18th international conference, Munich, Germany, October 5-9, 2015, proceedings, part III 18*, pages 234–241. Springer, 2015.

Moroccan Scene. Figuig / figig town: The eastern oasis of morocco, between sands & palms. https://moroccanscene.com/figuig-figig-town-the-eastern-oasis-of-morocco-between-sands-palms/, 2025. Accessed: 2025-02-16.

MH Sedra, Bureau Sous-Regional pour l'Afrique, et al. Le bayoud du palmier dattier en afrique du nord. 2003.

Aisha Abdullah Darwish Shambeh Alblooshi. Biological control of fusarium wilt in date palm (phoenix dactylifera l.) in the united arab emirates by endophytic actinobacteria. 2020.

Akanksha Singh, Baskar Ganapathysubramanian, Arti K. Singh, and Soumik Sarkar. Machine learning for high-throughput stress phenotyping in plants. *Trends in Plant Science*, 21(2):110–124, 2016.

Dirk HR Spennemann. Review of the vertebrate-mediated dispersal of the date palm, phoenix dactylifera. *Zoology in the Middle East*, 64(4):283–296, 2018.

Margareta Tengberg. Beginnings and early history of date palm garden cultivation in the middle east. *Journal of Arid Environments*, 86:139–147, 2012.

Wikipedia contributors. Figuig. URL https://fr.wikipedia.org/wiki/Figuig. Version as of 27 August 2024.

Kanitta Yarak, Apichon Witayangkurn, Kunnaree Kritiyutanont, Chomchanok Arunplod, and Ryosuke Shibasaki. Oil palm tree detection and health classification on high-resolution imagery using deep learning. *Agriculture*, 11 (2):183, 2021.

Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. *arXiv preprint arXiv:1511.07122*, 2015.

A Zaid and PF de Wet. Botanical and systematic description of the date palm, 156 (1). *Date palm cultivation. Italy: Federal agriculture organization plant production and protection, Rome*, 2002.
Nan Zhang, Mingxia Wang, and Ning Wang. Precision agri-culture technologies for improving crop productivity and environmental sustainability: A review. *Computers and Electronics in Agriculture*, 142:1–15, 2017.