Rev. FCA UNCuyo | 2026 | 58(2) | ISSN 1853-8665
Agroindustrial technologies
https://doi.org/10.48162/rev.39.233
Multi-Class Weed Segmentation in Potato Crops from UAV Imagery Under Uncontrolled Field Conditions Using an Improved U-Net
Segmentación de malezas en cultivos de papa a partir de imágenes de UAV mediante una red U-Net mejorada
Adriana Giret-Boggino 1,
Marco Pusdá-Chulde 2,
Jorge Pazos-Morillo 2,
Pedro Granda-Gudiño 2,
1 Universitat Politècnica de València. Departamento de Sistemas Informáticos y Computación. 46022. Valencia. España.
2 Universidad Técnica del Norte. Facultad de Ingeniería en Ciencias Aplicadas. 100150. Ibarra. Ecuador.
* idgarcia@utn.edu.ec
Abstract
Weed identification and quantification are essential for precision agriculture because weeds compete with crops for resources and can reduce productivity. This study aimed to develop and evaluate an improved U-Net convolutional neural network (iU-Net) for the automatic multiclass segmentation and quantification of weeds in potato crops using RGB images acquired by an unmanned aerial vehicle (UAV). We constructed a custom dataset of 2,100 annotated 250 × 250 sub-images from potato fields in Ecuador under uncontrolled field conditions and classified them into six classes: background, potato, Broadleaf dock, Dandelion, Kikuyu, and other weeds (unknown). Following the Knowledge Discovery in Databases (KDD) methodology, we trained and evaluated six U-Net-based architectures using Dice loss, Mean Dice Coefficient, and mean Intersection over Union (mIoU). The best-performing model was the proposed iU-Net with an EfficientNetV2-Small backbone, which achieved an mIoU of 0.8871 on the test set and an inference time of 11.34 ms per 128 × 128 resized image (88.18 FPS). The model showed particularly high segmentation performance for the main weed classes, with IoU values above 0.90. These results demonstrate the proposed approach’s potential for accurate multiclass weed segmentation and automatic weed coverage estimation under challenging field conditions.
Keywords: semantic segmentation, precision agriculture, weed segmentation, Deep Learning, UAV imagery, CNN, U-Net
Resumen
La identificación y cuantificación de malezas son esenciales para la agricultura de precisión, ya que compiten con los cultivos por recursos y pueden reducir la productividad. Este estudio tuvo como objetivo desarrollar y evaluar una red neuronal convolucional U-Net mejorada (iU-Net) para la segmentación y cuantificación de malezas en cultivos de papa, a partir de imágenes RGB adquiridas con un dron. Se construyó un conjunto de datos de 2100 imágenes anotadas, bajo condiciones de campo no controladas, y se clasificaron en seis clases: fondo, papa, lengua de vaca, diente de león, kikuyo y otras malezas (desconocidas). Se entrenaron seis arquitecturas basadas en U-Net y se evaluaron con métricas cuantitativas (principalmente mIoU). El modelo con mejor rendimiento fue el iU-Net con la arquitectura EfficientNetV2-Small, que alcanzó un mIoU de 0,8871 y un tiempo de inferencia de 11,34 ms por imagen de 128 × 128 (88,18 FPS). El modelo mostró un alto rendimiento en las principales clases de malezas, con valores de IoU superiores a 0,90, lo que demuestra su potencial para la segmentación precisa de malezas y la estimación de su cobertura en condiciones de campo difíciles.
Palabras clave: segmentación semántica, agricultura de precisión, segmentación de malezas, Deep Learning, imágenes de UAV, CNN, U-Net
Originals: Received: 21/10/2025 - Accepted: 05/10/2026
Introduction
Unwanted plants (weeds) pose one of the greatest challenges to agricultural production worldwide, causing significant economic losses for farmers. Accurate weed mapping is crucial for successful farming, efficient agricultural resource management, and sustainability. Weeds significantly threaten crop yields and harvest quality by competing for essential soil resources. Manual weed identification can lead to significant errors in quantifying weed infestation, resulting in ineffective and untimely weed-control decisions (Gao et al., 2024).
One approach to weed identification is Deep Learning (Jabed & Azmi Murad, 2024), which enables automatic feature extraction from large amounts of data, integrating heterogeneous environmental information and supporting spatially informed agricultural management (Córdoba et al., 2025). Convolutional Neural Networks (CNN) have become increasingly popular across various application contexts (Cevallos et al., 2025; Montenegro et al., 2023) thanks to powerful hardware. CNNs have delivered strong results for semantic segmentation and weed identification (Sandoval-Pillajo, Perugachi-Chávez et al., 2026a; Sandoval-Pillajo, Pusdá-Chulde et al., 2026b; Vinueza et al., 2025), enabling the generation of a segmentation map of plants in the input image (Garibaldi-Márquez et al., 2025). The identification task is challenging because plants (crops and weeds) share similar physical characteristics, overlap, and are influenced by outdoor environmental conditions. Detecting multiple weed types is crucial for precision agriculture. Different weeds require tailored control strategies that avoid excessive herbicide use and minimize collateral damage to soil and human health.
This study aimed to develop and evaluate an improved U-Net (iU-Net) for multiclass weed segmentation and automatic weed coverage estimation in potato crops using UAV imagery acquired under uncontrolled field conditions. Potato is an important crop in northern Ecuador, where this study was conducted. However, research addressing weed recognition and multiclass segmentation specifically in potato crops in this region remains limited, highlighting the need for approaches adapted to local field conditions. Specifically, six U-Net-based architectures were evaluated on a custom dataset comprising six classes: background, potato (Solanum tuberosum L.), Broadleaf dock (Rumex obtusifolius), Dandelion (Taraxacum officinale), Kikuyu grass (Cenchrus clandestinum), and other weeds. The study hypothesized that the proposed iU-Net would achieve higher multiclass segmentation performance than the conventional U-Net-based architectures, particularly under the variability inherent in uncontrolled field conditions.
U-Net was selected as the baseline architecture because its encoder-decoder structure with skip connections is well-suited to semantic segmentation tasks on drone-acquired images, particularly when precise localization of object boundaries is required (Amarasingam et al., 2024; Rai & Sun, 2024). Experimenting with U-Net variants to quantify weed types in uncontrolled environments, using a custom-annotated dataset of potato crops, contributes to the field. Uncontrolled conditions pose major challenges for Deep Learning, as models must be robust, adaptable, and able to generalize to unpredictable settings without manual tuning.
Between 2023 and 2024, a dataset comprising 2100 UAV images of potato crops in the provinces of Carchi and Imbabura, Ecuador, was collected. Aerial images are easily affected by factors such as atmospheric scattering and illumination changes. These factors cause significant noise and blur, degrading image quality and considerably reducing the accuracy of existing models (Yuan et al., 2025). Our dataset (RGB images and segmentation masks) is publicly available on the GitHub platform for research and comparison at http://bit.ly/3WmatsC, reducing the effort and time required to collect and annotate various native weeds. To the best of our knowledge, publicly available datasets combining UAV RGB imagery of potato crops with annotations for the three predominant weed types considered in this study remain limited (Lu et al., 2025). The U-Net algorithms were developed in Python using the TensorFlow-Keras framework, following the well-known Knowledge Discovery in Databases (KDD) methodology for image data analysis. We evaluate the proposed models using several metrics and compare them with current state-of-the-art methods, as summarized below.
Kong et al., 2024 proposed the ECSNet (Efficient Crop Segmentation Net), based on YOLOv5s, which incorporates an attention mechanism and a feature fusion technique in the backbone for corn crop fields. The network achieved an mIoU of 90.9% in corn segmentation. Gao et al., 2024 presented a model with an encoder-decoder symmetric architecture to segment and map weeds in images captured in maize fields. They classified three classes (weed, maize, soil), achieving an mIoU of 0.617 and mOA of 0.734 in the aerial images.
Amarasingam et al., 2024 developed a model to map Bitou bush (weed) using multispectral (MS) and hyperspectral (HS) imagery. The ground truth classes were Bitou bush (target vegetation), other vegetation, and non-vegetation. They evaluated several U-Net-based models, achieving an mOA of 92% and an mIoU of 73.2%. Bretas et al., 2024 developed a U-Net-based segmentation model to map Amaranthus spinosus L. in grass pastures using RGB images. The images were manually labeled to represent a binary mask: weed and non-weed. The model detected 80% of the weeds with an average accuracy of 94%.
Machidon et al., 2025 proposed an adaptive segmentation model, SqueezeSlimU-Net (SSU-Net), for real-time UAV weed detection. The dataset considered labels for background, crop, and weeds. They included the AgriAdapt dataset (lettuce) and the Tobacco dataset. SSU-Net achieved an mIoU of 58.28% and an accuracy of 90.47%. Syed et al., 2025 proposed a lightweight architecture, Multi-Scale and Edge-Aware Network (MSEA-Net), to enhance segmentation accuracy. They used a public dataset called Motion-Blurred UAV Images of Sorghum Fields. One of the three classes (weed, sorghum, or soil) was assigned to every pixel. The MSEA-Net achieved an mIoU of 87.42%. Asuka et al., 2025 proposed an ensemble learning-based method for detecting weed pixels in rice plants using a camera mounted in front of a boat at a height of 17.5 cm, simulating an aquatic drone. A custom dataset was constructed, where each pixel was labeled either “weed” or “background”. The best model was bagged UNet++, achieving an mIoU of 0.706 and a pixel accuracy of 0.971. Lu et al., 2025 developed models using YOLOv8 and Mask R-CNN to identify weeds in potato fields. They used super-resolution (Real-ESRGAN) to improve image resolution and enable semi-automatic annotation with three classes: potato and two weed types (long leaves and other weeds). YOLOv8 converged faster, achieving an mIoU of 0.5089.
Zhang et al., 2025 integrated a bean/weed detection model using a teacher-to-student training approach. They constructed a dataset using a manual semi-automatic annotation method. The results show that the best-performing student model, Segformer-b0-S, achieved mIoU, mPA, and accuracy of 79.28%, 88.95%, and 95.36%, respectively. Wei et al., 2025 proposed a hybrid CNN-transformer network for the semantic segmentation of crops and weeds on Resource-Constrained Embedded Devices. The WeedMap dataset was considered, which includes 245 images obtained with multispectral sensors. This dataset includes the classes soil, crop, and weeds. The network achieved an mIoU of 0.7869. Chao et al., 2025) developed a network based on DeepLabV3+ with an Xception backbone enhanced by the Self-Attention mechanism to identify weeds. The RGB images were annotated into three categories: Erigeron annuus, Erigeron canadensis, and the apple tree. The model achieved an mIoU of 0.947 and an mPA of 0.973. Shafiee et al., 2025 created a weed map in a maize field using Sequoia (multispectral) and CMOS (RGB) sensors. They converted all images into a single orthomosaic and classified them into four classes (soil, maize crop, and two dominant weeds: cheeseweed and bindweed). The Neural Network and SVM had the highest accuracies, at 96.44% and 95.77%, respectively.
Guo et al., 2025 developed a semi-supervised U-Net-based model for detecting weeds in cornfields, SSL-UNet. They focused on detecting areas with weed distribution, resulting in two predicted categories: weeds and background. The model achieved 85.5% mIoU and 98.7% OA. Mei et al., 2025 proposed the SSMR-Net model, based on an improved U-Net architecture, combined with Across Feature Mapped Attention (AFMA), for the semantic segmentation of weeds in early-stage wheat fields. A custom-built dataset was created, comprising 453 RGB images annotated as wheat, weeds, and soil. The SSMR-Net achieved an mIoU of 0.865.
Overall, recent UAV-based weed segmentation studies demonstrate the effectiveness of deep learning approaches; however, direct comparison remains challenging because datasets differ substantially in crop type, weed diversity, image acquisition conditions, and segmentation tasks. Most reported studies focus on binary or three-class segmentation, whereas multiclass identification of multiple weed species in potato crops remains underexplored. Moreover, existing models may perform poorly under uncontrolled field conditions due to variations in illumination, plant overlap, weed morphology, and class imbalance. These limitations motivate evaluating multiple U-Net-based architectures on a diverse, custom dataset specifically developed for potato crops and native weed classes in the study region.
Materials and Methods
KDD Methodology
The well-known Knowledge Discovery in Databases (KDD) methodology was employed for analyzing image data, consisting of five phases detailed below.
Data Collection
RGB images (5472×3648) were collected from 8 different potato crop fields in Carchi and Imbabura (Ecuador) at a crop age between 15 and 40 days, incorporating diverse climatic conditions, land, and plant variability. Thus, 3810 images were acquired in 2023 and 2024, significantly extending the original dataset (unbalanced) proposed in our previous work (Vinueza et al., 2025) by approximately 56%. The DJI Mavic 2 Pro UAV was used along with the Android DroneDeploy application to configure flight parameters: height, 9-10 m; speed, 1 m/s; and cm/px ratio, 0.25, representing a compromise between GSD and ground coverage and avoiding motion blur (Tian et al., 2024). Figure 1 shows image examples collected in potato fields with different weed types.
In Carchi (a) and Imbabura (b) provinces. (c) Example of delimiting and extracting a 250×250 sub-image.
Provincias de Carchi (a) e Imbabura (b). c) Ejemplo de delimitación y extracción de una subimagen 250×250.
Figure 1. Examples of RGB images taken at 9-10 m height by a UAV in potato fields.
Figura 1. Ejemplos de imágenes RGB tomadas a 9-10 m de altura por un UAV en campos de papa.
Data Selection, Preprocessing, and Transformation
Images not suitable were discarded, mainly blurred ones. Subsequently, the classes in the original dataset were nearly balanced by incorporating new images from croplands not previously considered. A 250×250 sub-image extraction method is employed for manual image annotation, as it has been found that better results are achieved when the image is divided into patches rather than resizing the entire image (Garibaldi-Márquez et al., 2025). Adobe Photoshop was used to extract the sub-images, as shown in figure 1c.
Predominant weeds with the greatest coverage were Broadleaf dock, Dandelion, and Kikuyu. The “other weeds” class grouped low-frequency weed species that could not be reliably assigned to these three predominant categories, including small or visually ambiguous plants. Therefore, this class is intentionally heterogeneous and represents non-target weed diversity observed in the fields. A total of 2100 correctly classified 250×250 sub-images were obtained. Each extracted sub-image was then resized to 128×128 for image annotation and semantic segmentation, ensuring compatibility with the U-Net architecture. The online platform used for image annotation was Roboflow, considering the six classes, as shown in table 1.
Table 1. The number of plants in the extended dataset is more balanced than in the original dataset.
Tabla 1. El conjunto de datos extendido está más equilibrado que el original.

Manual annotation required 210 work hours and took approximately 6 minutes for each sub-image. The annotated dataset was split into training, validation, and testing sets in the ratio of 80% (1680 sub-images), 10% (210 sub-images), and 10% (210 sub-images), respectively, which is a good balance in general. Data augmentation was then performed to expand the dataset size and enhance model training. The operations applied to the sub-images were a 25% increase and decrease in brightness, a Gaussian blur with a 5×5 kernel, and rotations at angles of 90°, 180°, and 270°. Seven types of data augmentation were applied, resulting in 11760 sub-images for the model’s training set.
Data Mining
This phase consists of two parts: choosing the Deep Learning algorithm and training it.
The Deep Learning Algorithm
The U-Net architecture was selected as justified above for its effectiveness in semantic segmentation, which is widely used in medical images (Ronneberger et al., 2015) and, more recently, in weed segmentation (Rai & Sun, 2024). The U-Net captures both low-level features (edges, textures, simple patterns, colors, and gradients) and high-level features (complex patterns, semantic contexts, and spatial relationships between different image regions). Its architecture is an encoder-decoder-based approach. The encoder extracts features through convolutions and pooling operations, progressively reducing the image’s resolution. Low-level features are extracted in the first layers of the encoder, while high-level features are captured in the deeper layers. Instead, the decoder restores the dimensionality to its original size by fusing low- and high-resolution features through transposed convolution (deconvolution), upsampling (interpolation), and concatenation. The decoder handles reconstruction and semantic segmentation for the six classes mentioned.
Several variations of U-Net were adapted to enhance the accuracy and efficiency of weed segmentation in potato crops, including the original U-Net, Residual U-Net, Double U-Net, MU-Net, Attention U-Net, and our improved U-Net (iU-Net), as detailed below.
Training the U-Net Models
The U-Net variants were trained on Google Colab Pro+ using TensorFlow-Keras and an Nvidia A100 GPU with 40 GB of VRAM.
Original U-Net (Ronneberger et al., 2015)
This model was compiled with the Adam optimizer and the sparse categorical cross-entropy loss function, suitable for multiclass segmentation. The EarlyStopping callback stops training when validation loss does not improve for 10 consecutive epochs, and the ReduceLROnPlateau callback reduces the learning rate when validation accuracy stagnates. Training was performed for 100 epochs with a batch size of 32.
Residual U-Net (Zhang et al., 2018)
This version incorporates residual blocks instead of plain convolutional blocks, which help mitigate the gradient degradation problem in deep networks. This model maintains the basic U-Net architecture but adds skip connections across multiple layers. The total number of parameters was approximately 135 million, occupying 515 MB.
Double U-Net (Jha et al., 2020)
This variation combines two U-Net architectures stacked on top of each other, using a conventional U-Net with a Residual U-Net in a hybrid setup. The U-Net output serves as input to the Residual U-Net, improving the propagation of semantic information across layers. The total number of parameters was 116 million, with a size of 443 MB.
Modified U-Net (MU-Net) (S. Zhang & Zhang, 2023)
This network introduces the residual block (Resblock) and residual path (Respath) concepts into the U-Net. Resblocks are useful for overcoming gradient disappearance and explosion problems, whereas Respaths enhance the transformation of corresponding feature information between the contraction and expansion paths. Together, they increase network depth, improving the network’s ability to perform complex image segmentation. The total number of parameters was 14 M, and the size was 54 MB.
U-Net with attention modules and Residual blocks (AU-Net)
This variation is detailed in our previous work (Sandoval-Pillajo, Pusdá-Chulde, et al., 2026b), which combines attention modules with Residual blocks, trying to achieve more precise and efficient weed segmentation. Attention modules (Attention Gate) enable the network to focus on the most relevant areas, such as weeds, and suppress irrelevant information, thereby enhancing segmentation and reducing false positives. The residual blocks mitigate vanishing gradient problems and replace the standard convolutional layers in the U-Net. This improves feature extraction while preserving key information. This model has 93 million parameters and requires 355 MB of storage.
Improved U-Net (iU-Net)
This custom variant incorporates significant improvements for weed segmentation, the three key differences from the original U-Net being the following: First, a backbone based on EfficientNetV2 (Tan & Le, 2021) pre-trained on the ImageNet dataset, experimenting with two lightweight versions: EfficientNetV2-B0 and EfficientNetV2-Small. This allows leveraging transfer learning, using a much more powerful and efficient encoder that extracts complex and relevant features from the earliest layers. EfficientNetV2 represents an efficient neural network architecture that optimizes both inference efficiency and training speed. This improvement comes from new Fused-MBConv building blocks that use modern hardware more effectively, along with a progressive learning strategy that starts with lower-resolution images and gradually increases resolution.
Second, a bridge between the encoder and decoder, containing an Atrous Spatial Pyramid Pooling (ASPP) module (Chen et al., 2018; Garibaldi-Márquez et al., 2025; Mei et al., 2025) which is used to capture context at multiple scales, allowing the model to understand both fine details and global structures, suitable for small or sparse weeds. In addition, a deformable attention layer (Zhu et al., 2020) focuses on relevant regions of the image, adapting to the irregular and variable shapes of weeds at any position rather than fixed attention zones. Third, an efficient decoder with separable convolutions instead of standard convolutions. This significantly reduces parameters and computational cost without sacrificing performance, making the model lighter and faster. Additionally, Dropout regularization adds layers (rate 0.2) to the decoder to reduce overfitting. Appendix 1 (Supplementary Material shows a diagram of the custom iU-Net architecture. It integrates modern computer vision techniques for agricultural image segmentation from UAVs (Sandoval-Pillajo et al., 2025), combining principles of efficiency (EfficientNetV2), multi-scale context (ASPP), and spatial adaptability (Deformable Attention). The Loss function used is as follows: Total loss = 1.0 × Focal loss + 1.5 × Dice loss. This combination improves segmentation of small, dispersed weeds while addressing class imbalance (Syed et al., 2025).
Additionally, we used explicit weights for the six classes in the Focal Loss function, reflecting each class’s relative importance and frequency in our dataset. The assigned weights were: background=0.4, Broadleaf dock=1, Dandelion=1, Kikuyu=1, other=2, potato=1.Larger weights (e.g., 2) are assigned to less frequent but important classes (such as other weeds), while smaller weights (e.g., 0.4) are assigned to more frequent or less important classes (such as Background). The iU-Net model, equipped with the EfficientNetV2-B0 backbone, has 13.5 million parameters and occupies 52 MB. The model with the EfficientNetV2-Small backbone has about 28 million parameters and occupies 107 MB. Table 2 summarizes the parameters and hyperparameters used to train each U-Net-based model.
Table 2. Training parameters and hyperparameters used in the six U-Net-based models for 128×128×3 input.
Tabla 2. Parámetros e hiperparámetros utilizados en los seis modelos basados en U-Net.

The experimented architectures differ in model complexity and training configuration, including batch size and number of trainable parameters. Therefore, the comparison should be interpreted as an empirical benchmark of the implemented models under their respective optimized configurations rather than as a strictly controlled architectural ablation. Training settings were selected according to the computational requirements and convergence behavior of each architecture. To facilitate reproducibility, a fixed random seed of 42 was used throughout the experiments. RGB images were resized to 128 × 128 pixels using bilinear interpolation, while segmentation masks were resized using nearest-neighbor interpolation and converted to one-hot encoding. Data augmentation was applied online only to the training set, using horizontal and vertical flips, rotations of 0°, 90°, 180°, and 270°, and random adjustments to brightness, contrast, hue, and saturation. Augmented versions of training images were not included in the validation or test sets, preventing data leakage between subsets. Pixel values were clipped to [0, 255] after augmentation and then normalized using the corresponding EfficientNetV2 preprocessing function. Regarding the iU-Net implementation described above, the ASPP module uses 192 filters and parallel branches with dilation rates of 6, 12, and 18, together with 1 × 1 convolution and global average pooling. The Deformable Attention module generates spatial attention weights via a 1 × 1 convolution with sigmoid activation, then combines them with features processed by a 3 × 3 separable convolution Appendix 1 (Supplementary Material).
Evaluation and Interpretation
Three common metrics in semantic segmentation, dice loss, mean dice coefficient, and mean intersection over union (mIoU), were used to evaluate the models’ performance.
Dice Loss
Is commonly used, especially when classes are imbalanced. It measures the match between the ground-truth masks and the masks predicted by the model in terms of shape and overlap. Its range is between [0,1], with 0 indicating a perfect match between the segmentation masks.
Mean Dice Coefficient
Is a metric used to evaluate the accuracy of models that segment or classify pixels into different classes. Its value ranges between [0,1], with 1 indicating a perfect match between segmentation masks.
Mean IoU
Is another widely used metric to evaluate the accuracy of semantic segmentation models. It provides a clear, balanced view of the model’s performance across all classes and remains robust in situations with class imbalance. Its value ranges from (0,1), where values close to 1 indicate excellent segmentation performance and high accuracy in class prediction. The overall accuracy (OA) metric has not been fully considered for evaluation and comparison because OA can be high even if small classes are poorly segmented (Müller et al., 2022). In practical terms, the model’s purpose is to interpret its predictions and provide useful information for decision-making. Equation 1 is useful for calculating weed coverage (Zou et al., 2021):

The weed area is the number of pixels belonging to each category provided by the model’s semantic segmentation mask. The total area is the number of pixels in the whole image. Figure 2 illustrates the entire weed quantification process, including UAV image acquisition, division into 128 × 128 pixel sub-images, semantic segmentation of weeds, visualization, and weed coverage calculation.
Figure 2. The entire process for automatic weed quantification from UAV images using the best U-Net model. Adapted from (Vinueza et al., 2025).
Figura 2. Proceso completo de cuantificación automática de malezas a partir de imágenes UAV utilizando el mejor modelo U-Net (Vinueza et al., 2025).
Results
U-Net Performance Metrics
Table 3 summarizes the evaluation metrics on the original dataset (unbalanced).
Table 3. Evaluation metrics achieved by the six versions of U-Net (except iU-Net) on the validation set (10%).
Tabla 3. Métricas de evaluación alcanzadas en las seis versiones de U-Net (excepto iU-Net) en el conjunto de validación (10%).

The top values of mIoU are in bold.
Los valores más altos de mIoU están en negrita.
AU-Net showed the lowest mIoU (0.6150), whereas Residual U-Net achieved the highest performance among these configurations, reaching an mIoU = 0.7755 on the original dataset (unbalanced). Thus, this model was also trained on the extended dataset (more balanced), which is 56% larger, achieving better performance with an mIoU of 0.8053, reflecting high accuracy in weed segmentation. The class balancing in the dataset achieved a 3.8% higher mIoU. On this basis, the improved U-Net (iU-Net), with an EfficientNetV2 backbone, was also trained using only the balanced dataset and compared with the Residual U-Net model. Table 4 presents the IoU metric for each class in the balanced dataset using the Residual U-Net and improved U-Net (iU-Net) models on the test set (10%, 210 images), which was not seen during training.
Table 4. IoU results for each class of Residual U-Net and iU-Net on the test set (10%).
Tabla 4. Resultados de IoU para cada clase de U-Net residual e iU-Net en el conjunto de prueba (10%).

The Residual U-Net achieved an mIoU of 0.8021. After architectural improvements, iU-Net with EfficientNetV2-B0 achieved 0.8606, and iU-Net with EfficientNetV2-Small achieved the highest mIoU (0.8871) among the evaluated configurations. These results represent point estimates from single training runs and are therefore interpreted descriptively rather than as evidence of statistically significant differences among architectures.
Figure 3 shows the learning curves of the best model, iU-Net (Small version), over 140 training epochs.
Figure 3. Learning curves of the best model, iU-Net (Small version), for the evaluation metrics.
Figura 3. Curvas de aprendizaje del mejor modelo iU-Net (versión pequeña) para las métricas de evaluación.
Figure 4 shows RGB images, ground truth masks, and predictions of the best version of the iU-Net on four example sub-images of 128×128.
Kikuyu weed appears in yellow, Dandelion in orange, Broadleaf dock in blue, Potato crop in green, and other weeds in purple.
La hierba Kikuyu aparece en amarillo, el diente de león en naranja, la lengua de vaca en azul, el cultivo de papa en verde y otras malezas en púrpura.
Figure 4. RGB image examples (first row), Ground truth (second row), and our improved iU-Net prediction (third row) on four examples of 128×128 sub-images.
Figura 4. Ejemplos de imágenes RGB (primera fila), Ground truth (segunda fila) y predicción de iU-Net mejorada (tercera fila) en cuatro subimágenes de 128×128.
The iU-Net model was trained on Google Colab Pro+ on an Nvidia A100 GPU for 140 epochs in 27 minutes, with a fast inference time of 11.34 ms (88.18 FPS) for a 128×128 image and a model size of 107 MB.
As complementary work, the best model was deployed on a simple web application on the Azure cloud (free plan) in a user-friendly and visually appealing manner Appendix 2 (Supplementary Material).
Discussion
This research explored six versions of the U-Net CNN, adapting them to the semantic segmentation of native weeds in potato crops, which has received even less attention (Lu et al., 2025). It aims to make the upsampling masks (decoder) better fit plant silhouettes and fine details, which is a very challenging task with UAV images. Several experiments were conducted, varying training hyperparameters and certain architecture components to identify the optimal model for this task. The models were trained on a custom, diverse dataset, allowing them to learn robust, discriminative features.
According to table 4, the three models (Residual U-Net, iU-Net B0, iU-Net Small) achieved an mIoU greater than 0.80, indicating that they segment all six classes well in unseen data and could be considered adequate for practical applications (Sandoval-Pillajo et al., 2025). However, the best model on our dataset is the iU-Net with EfficientNetV2-Small as its backbone, reaching an mIoU of 0.8871. Specifically, the class with the highest IoU (0.9571) is the background, which agrees with results from other researchers (Cai et al., 2023) because it is present in all images. The class with the lowest IoU (0.7227) is “other weeds” because it is small and encompasses different weed types with heterogeneous visual characteristics (textures and patterns) that cannot be visually identified as a specific category. The remaining weed classes exhibit adequate and similar segmentation among them (IoU > 0.9). The iU-Net version (small) outperforms the B0 version by 3.06%, representing a significant improvement in weed segmentation. However, the small version is heavier than B0, with approximately 28 million parameters (107 MB) and 13.5 million parameters (52 MB), respectively.
Table 5 compares our results against different current state-of-the-art methods used in weed segmentation utilizing UAV images on the test set, using mainly the mIoU metric, which is critical for practical applications (Kong et al., 2024) and more robust than overall accuracy (OA) (Müller et al., 2022) as mentioned.
Table 5. Comparison of the iU-Net and current methods used in weed segmentation with UAV images.
Tabla 5. Comparación entre iU-Net y los métodos actuales para la segmentación de malezas en imágenes de UAV.

Direct comparison with previous studies should be interpreted cautiously because the reported models were evaluated on different datasets, crops, weed species, numbers of classes, sensors, and image acquisition conditions. Therefore, the results in table 5 provide contextual rather than strictly controlled comparisons.
Firstly, with respect to multiclass segmentation (> 2 classes) using UAV images, our iU-Net model, achieves an mIoU of 0.8871, exceeding the performance of several multiclass approaches evaluated using UAV imagery, being higher, in term of mIoU, to the MSEA-Net (Syed et al., 2025) with 0.8742, hybrid CNN-transformer (Wei et al., 2025) with 0.7869, modified ResNeXt50 (Vinueza et al., 2025) with 0.7350, U-Net (Amarasingam et al., 2024) with 0.7320, U-Net model (Gao et al., 2024) with 0.617, SSU-Net (Machidon et al., 2025) with 0.58, YOLOv8 (Lu et al., 2025) with 0.5089, and SSMR-Net (Mei et al., 2025) with 0.865. However, the iU-Net is inferior compared to DeepLabV3+ with an Xception backbone (Chao et al., 2025), with an mIoU of 0.947. Although iU-Net is much lighter (28M parameters) than the DeepLabV3+ (55M parameters). Additionally, iU-Net performs well on small plants (crops and weeds), whereas the DeepLabV3+ here is designed for large trees ranging from 4 to 5 meters in height.
Considering the number of classes, our work identifies six classes (multiple weed species), which exceeds the rest, with 2 and 3 categories, indicating competitive performance for multiclass weed segmentation under uncontrolled field conditions. Compared to our previous studies, ResNeXt50-based model (Vinueza et al., 2025) and Residual U-net model (Sandoval-Pillajo et al., 2026b), the iU-Net model achieves a significant improvement of 20.69% and 10.60%, respectively. This may be due to the model’s training on an extended dataset by 56%, the class balancing, and the enhanced variant of the iU-Net architecture.
Secondly, regarding works based on binary segmentation (crop and weeds), our iU-Net (mIoU = 0.8871) is slightly inferior to ECSNet in (Kong et al., 2024) with an mIoU of 0.9090, but it is superior in terms of mIoU to U-Net++ (Asuka et al., 2025) with an mIoU of 0.7060, Segforer-b0-S (J. Zhang et al., 2025) with 0.7928, and SSL-UNet (Guo et al., 2025) with 0.855. This agrees with (Lu et al., 2025), which states that the lower the number of classes addressed, the higher the performance metric.
In general, the improved iU-Net model presents adequate performance, comparable to that found in the existing literature using UAV imagery. According to (Sandoval-Pillajo et al., 2025), an mIoU > 0.70 can be considered acceptable for practical applications, while values above 0.80 (as in our work) indicate high performance even in challenging conditions. However, the “other weeds” class still penalizes the model’s overall performance. It can be associated with its heterogeneous composition, since it groups low-frequency, small, or visually ambiguous weed species. Unlike the three predominant weed classes, this category encompasses greater intra-class variability, making the learning of consistent visual features more difficult.
Although the iU-net model predicts all classes well on average, there are certain atypical images in the test set where the coverage prediction differs substantially from the actual coverage, as shown in figure 5. This could be due to several factors related to visual characteristics of plants (size, shape, density), variability in outdoor lighting conditions, capture angles, presence of shadows, overlapping plants, abrupt changes in the texture, species less represented in the training data, and noise in the images (mislabeled, blurry examples).
Ground truth (first row) and predicted (second row) with the largest differences.
Reales (primera fila) y predichas (segunda fila) con las mayores diferencias.
Figure 5. RGB images.
Figura 5. Imágenes RGB.
Regarding the limitations of this study, the dataset remains relatively limited and is restricted to six classes and a specific crop growth stage (15-40 days), which may constrain model generalization to other locations and agricultural conditions. The “other weeds” class is inherently heterogeneous, and manual pixel-level annotation may introduce subjectivity, particularly for small, overlapping, or visually ambiguous plants. Moreover, inter-annotator agreement was not assessed. Regarding the experimental comparison, training conditions were not fully standardized across all architectures, since batch size, model complexity, and some training settings differed among models. Consequently, performance differences cannot be attributed exclusively to architectural changes. Furthermore, the reported metrics correspond to single training runs; therefore, training variability and confidence intervals were not estimated. Differences among architectures should thus be interpreted as performance differences among the evaluated configurations rather than as statistically significant superiority.
Operational deployment may also be affected by variations in illumination, plant density, occlusion, UAV image acquisition conditions, and computational resources. Although the use of a low-cost UAV and RGB imagery provides an affordable approach (Zou et al., 2021), further field validation across additional locations, growth stages, and weed populations is required. From an agronomic perspective, multiclass weed identification and coverage estimation could support more targeted weed management by providing information on the presence and distribution of predominant weed types.
Conclusions
This study evaluated U-Net-based architectures for multiclass weed segmentation in potato crops using UAV imagery acquired under uncontrolled field conditions. Among the evaluated configurations, iU-Net with EfficientNetV2-Small achieved the highest segmentation performance, with an mIoU of 0.8871. The main scientific contribution lies in the evaluation of an improved U-Net architecture for distinguishing multiple weed categories together with potato plants under variable field conditions, while also enabling automatic estimation of weed coverage from the resulting segmentation masks. These findings support the potential use of multiclass segmentation as a basis for more targeted weed management in potato crops.
Future work should focus on increasing dataset diversity across weed species, crop growth stages, locations, and environmental conditions, while maintaining balanced class distributions and incorporating independent annotations by multiple experts. Further field validation is also required to assess model generalization and its applicability under operational agricultural conditions.
Acknowledgement
The authors thank Ms. Masciel Sevilla-Erazo and Mr. Diego Recalde-Varela for their assistance during the model training.
Amarasingam, N., Kelly, J., Sandino, J., Hamilton, M., Gonzalez, F., L Dehaan, R., Zheng, L., & Cherry, H. (2024). Bitou bush detection and mapping using UAV-based multispectral and hyperspectral imagery and artificial intelligence. Remote Sensing Applications: Society and Environment, 34, 101151. https://doi.org/10.1016/j.rsase.2024.101151
Asuka, S., Nakamura, T., Shimizu, I., Ookawa, T., & Nakajo, H. (2025). Ensemble Learning-Based Weed Detection from a Duck’s Perspective Using an Aquatic Drone in Rice Paddies. Applied Sciences, 15(13), 7440. https://doi.org/10.3390/app15137440
Bretas, I. L., Dubeux, J. C. B., Zhao, C., Queiroz, L. M. D., Flynn, S., Ingram, S., Oduor, K. T., Cruz, P. J. R., Ruiz‐Moreno, M., Loures, D. R. S., Valente, D. S. M., & Chizzotti, F. H. M. (2024). Detection and mapping of Amaranthus spinosus L. in bermudagrass pastures using drone imagery and deep learning for a site‐specific weed management. Agronomy Journal, 116(3), 990-1002. https://doi.org/10.1002/agj2.21545
Cai, Y., Zeng, F., Xiao, J., Ai, W., Kang, G., Lin, Y., Cai, Z., Shi, H., Zhong, S., & Yue, X. (2023). Attention-aided semantic segmentation network for weed identification in pineapple field. Computers and Electronics in Agriculture, 210, 107881. https://doi.org/10.1016/j.compag.2023.107881
Córdoba, M.; Vallone, R.; Paccioretti, P.; Corvalán, F.; Balzarini, M. (2025). Data-driven Method for the Delimitation of Viticultural Zones: Application in the Mendoza River Oasis, Argentina. Revista de la Facultad de Ciencias Agrarias. Universidad Nacional de Cuyo. 57(2): 57-68. DOI: https://doi.org/10.48162/rev.39.171
Cevallos, M., Sandoval-Pillajo, L., Caranqui-Sánchez, V., Ortega-Bustamante, C., Pusdá-Chulde, M., & García-Santillán, I. (2025). Morphological Defects Classification in Coffee Beans Based on Convolutional Neural Networks. 3-15. https://doi.org/10.1007/978-3-031-75702-0_1
Chao, J., Wang, K., Xu, B., Harty, M., Wang, W., & McDonnell, K. (2025). Invasive plants detection and distribution patterns analysis through self-attention enhanced semantic segmentation in UAV imagery and Moran’s index. Computers and Electronics in Agriculture, 229, 109811. https://doi.org/10.1016/j.compag.2024.109811
Chen, L.-C., Zhu, Y., Papandreou, G., Schroff, F., & Adam, H. (2018). Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation (Versión 3). arXiv. https://doi.org/10.48550/ARXIV.1802.02611
Gao, J., Liao, W., Nuyttens, D., Lootens, P., Xue, W., Alexandersson, E., & Pieters, J. (2024). Cross-domain transfer learning for weed segmentation and mapping in precision farming using ground and UAV images. Expert Systems with Applications, 246, 122980. https://doi.org/10.1016/j.eswa.2023.122980
Garibaldi-Márquez, F., Flores, G., & Valentín-Coronado, L. M. (2025). Leveraging deep semantic segmentation for assisted weed detection. Journal of Agricultural Engineering. https://doi.org/10.4081/jae.2025.1741
Guo, Z., Xue, Y., Wang, C., Geng, Y., Lu, R., Li, H., Sun, D., Lou, Z., Chen, T., Shi, J., & Quan, L. (2025). Efficient weed segmentation in maize fields: A semi-supervised approach for precision weed management with reduced annotation overhead. Computers and Electronics in Agriculture, 229, 109707. https://doi.org/10.1016/j.compag.2024.109707
Jabed, Md. A., & Azmi Murad, M. A. (2024). Crop yield prediction in agriculture: A comprehensive review of machine learning and deep learning approaches, with insights for future research and sustainability. Heliyon, 10(24), e40836. https://doi.org/10.1016/j.heliyon.2024.e40836
Jha, D., Riegler, M. A., Johansen, D., Halvorsen, P., & Johansen, H. D. (2020). DoubleU-Net: A Deep Convolutional Neural Network for Medical Image Segmentation. 2020 IEEE 33rd International Symposium on Computer-Based Medical Systems (CBMS), 558-564. https://doi.org/10.1109/CBMS49503.2020.00111
Kong, X., Liu, T., Chen, X., Jin, X., Li, A., & Yu, J. (2024). Efficient crop segmentation net and novel weed detection method. European Journal of Agronomy, 161. https://doi.org/10.1016/j.eja.2024.127367
Lu, C., Gehring, K., Kopfinger, S., Bernhardt, H., Beck, M., Walther, S., Ebertseder, T., Minceva, M., Hu, Y., & Yu, K. (2025). Weed instance segmentation from UAV Orthomosaic Images based on Deep Learning. Smart Agricultural Technology, 11, 100966. https://doi.org/10.1016/j.atech.2025.100966
Machidon, A. L., Krašovec, A., Pejović, V., & Machidon, O. M. (2025). SqueezeSlimU-Net: An Adaptive and Efficient Segmentation Architecture for Real-Time UAV Weed Detection. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 18, 5749-5764. https://doi.org/10.1109/JSTARS.2025.3536175
Mei, X., Li, C., Jiao, Y., Zhang, G., Zhou, L., Wu, X., & Cai, T. (2025). SSMR-Net and Across Feature Mapping Attention are jointly applied to the UAV imagery semantic segmentation task of weeds in early-stage wheat fields. Smart Agricultural Technology, 12, 101077. https://doi.org/10.1016/j.atech.2025.101077
Montenegro, S., Pusdá-Chulde, M., Caranqui-Sánchez, V., Herrera-Tapia, J., Ortega-Bustamante, C., & García-Santillán, I. (2023). Android Mobile Application for Cattle Body Condition Score Using Convolutional Neural Networks. 91-105. https://doi.org/10.1007/978-3-031-32213-6_7
Müller, D., Soto-Rey, I., & Kramer, F. (2022). Towards a guideline for evaluation metrics in medical image segmentation. BMC Research Notes, 15(1), 210. https://doi.org/10.1186/s13104-022-06096-y
Rai, N., & Sun, X. (2024). WeedVision: A single-stage deep learning architecture to perform weed detection and segmentation using drone-acquired images. Computers and Electronics in Agriculture, 219, 108792. https://doi.org/10.1016/j.compag.2024.108792
Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional Networks for Biomedical Image Segmentation. https://doi.org/10.48550/arXiv.1505.04597
Sandoval-Pillajo, L., García-Santillán, I., Pusdá-Chulde, M., & Giret, A. (2025). Weed detection based on deep learning from UAV imagery: A review. Smart Agricultural Technology, 12, 101147. https://doi.org/10.1016/j.atech.2025.101147
Sandoval-Pillajo, L., Perugachi-Chávez, L., Pusdá-Chulde, M., Giret-Boggino, A., & García-Santillán, I. (2026a). Multi-class weed detection based on deep learning using unmanned aerial vehicle images in potato fields. Open Computer Science, 16(1), 20250058. https://doi.org/10.1515/comp-2025-0058
Sandoval-Pillajo, L., Pusdá-Chulde, M., Pazos-Morillo, J., Granda-Gudiño, P., & García-Santillán, I. (2026b). Multi-Class Weed Quantification Based on U-Net Convolutional Neural Networks Using UAV Imagery. Applied Sciences, 16(7), 3149. https://doi.org/10.3390/app16073149
Shafiee, G., Edalat, M., Shirzadifar, A., & Pourghasemi, H. R. (2025). Early season dominant weed mapping in maize field using unmanned aerial vehicle (UAV) imagery: Towards developing prescription map. Smart Agricultural Technology, 11, 100956. https://doi.org/10.1016/j.atech.2025.100956
Syed, A., Chen, B., Abbasi, A. A., Butt, S. A., & Fang, X. (2025). MSEA-Net: Multi-Scale and Edge-Aware Network for Weed Segmentation. AgriEngineering, 7(4), 103. https://doi.org/10.3390/agriengineering7040103
Tan, M., & Le, Q. V. (2021). EfficientNetV2: Smaller Models and Faster Training. https://doi.org/10.48550/ARXIV.2104.00298
Tian, F., Ransom, C. J., Zhou, J., Wilson, B., & Sudduth, K. A. (2024). Assessing the impact of soil and field conditions on cotton crop emergence using UAV-based imagery. Computers and Electronics in Agriculture, 218, 108738. https://doi.org/10.1016/j.compag.2024.108738
Vinueza, K., Sandoval-Pillajo, L., Giret-Boggino, A., Trejo-España, D., Pusdá-Chulde, M., & García-Santillán, I. (2025). Automatic weed quantification in potato crops based on a modified convolutional neural network using drone images. Data and Metadata. 4(194). https://doi.org/10.56294/dm2025194
Wei, Y., Feng, Y., Zu, D., & Zhang, X. (2025). A hybrid CNN-transformer network: Accurate and efficient semantic segmentation of crops and weeds on resource-constrained embedded devices. Crop Protection, 188, 107018. https://doi.org/10.1016/j.cropro.2024.107018
Yuan, J., Wang, L., Wang, T., Bashir, A. K., Al Dabel, M. M., Wang, J., Feng, H., Fang, K., & Wang, W. (2025). YOLOv8-RD: High-Robust Pine Wilt Disease Detection Method Based on Residual Fuzzy YOLOv8. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 18, 385-397. https://doi.org/10.1109/JSTARS.2024.3494838
Zhang, Z., Liu, Q., & Wang, Y. (2018). Road Extraction by Deep Residual U-Net. IEEE Geoscience and Remote Sensing Letters, 15(5), 749-753. https://doi.org/10.1109/LGRS.2018.2802944
Zhang, S., & Zhang, C. (2023). Modified U-Net for plant diseased leaf image segmentation. Computers and Electronics in Agriculture, 204. https://doi.org/10.1016/j.compag.2022.107511
Zhang, J., Lu, X., Yang, R., Xu, H., Huai, Y., & Liu, F. (2025). Weakly supervised dual-mask marginal segmentation and variable path planning method for bean weed based on UAV remote sensing. Computers and Electronics in Agriculture, 230, 109786. https://doi.org/10.1016/j.compag.2024.109786
Zhu, X., Su, W., Lu, L., Li, B., Wang, X., & Dai, J. (2020). Deformable DETR: Deformable Transformers for Endto-End Object Detection (Versión 4). arXiv. https://doi.org/10.48550/ARXIV.2010.04159
Zou, K., Chen, X., Zhang, F., Zhou, H., & Zhang, C. (2021). A Field Weed Density Evaluation Method Based on UAV Imaging and Modified U-Net. Remote Sensing, 13(2), 310. https://doi.org/10.3390/rs13020310
Declaration of the use of artificial intelligence (AI)
During the preparation of this manuscript, the authors used Grammarly solely for English language editing, including grammar, spelling, and readability improvements. The authors reviewed and approved all suggested changes and take full responsibility for the manuscript’s content.
Funding
This research was mostly funded by Universitat Politècnica de València and partially by the Universidad Técnica del Norte, Ibarra, Ecuador, under Grant Number: InvestigaUTN-2025-1516.