UAV Based Weed Pressure Detection Through Relative Labelling
Abstract
Highlights
- A novel labelling approach using relative differences in weed pressure was developed to train a CNN ordinal regression model for weed detection.
- The model achieved strong performance, successfully detecting weed pressure gradients in potato fields.
- The proposed method significantly reduces data labelling time and effort while maintaining high prediction accuracy.
- The approach enables flexible, site-specific weed management decisions, supporting more sustainable and environmentally friendly agricultural practices.
Abstract
1. Introduction
2. Materials and Methods
2.1. The Dataset
2.1.1. UAV Data Acquisition
2.1.2. Data Preprocessing
2.2. Ordinal Regression Model
2.2.1. Architecture
- The initial convolutional blocks:The number of convolutional blocks is configurable as hyperparameter, ranging from two to six blocks. Each convolutional block consists of (i) a 2D convolutional layer for feature extraction (like edges, textures, etc. form the input data), (ii) a 2D max-pooling layer to down sample the feature map, (iii) a group normalization layer (to separate the channels into four groups) and (iv) a ReLU (rectified linear unit) activation function to introduce non-linearity. The number of filters (feature maps) can be further defined as hyperparameters for the first convolutional layer (default value of 32) and subsequent convolutional layers (default value of 64 for convolutional layer two up to six, depending on the total number of specified convolutional blocks).
- The final convolutional layer:The last convolutional layer either outputs a single channel (default setting) or continues to a fully connected head. In the latter case, the model has two additional fully connected layers (with a ReLU activation function in between) after the convolution layers.
- 3.
- The receptive field calculation:In order to understand the learning process of the model better, a code was developed to calculate and visualize the receptive field of the last convolutional layer before the final output. When an image x passes through the convolutional blocks (forward pass), the receptive field can be returned for this last stage (if wanted). This allows us to determine how much of the input image that each output unit is “seeing” and helps to ensure proper design for spatial dependencies in the images. Its size is determined by the chosen kernel sizes, strides and dilations within the convolutional backbone.
2.2.2. Optimizer and Loss Functions
- The Adam optimizer is used to learn the weights and biases. It combines the benefits of Adaptive Gradient Descent and RMSprop, whereby it maintains separate learning rates for each parameter and updates them based on both the first and second moments of the gradients. The default learning rate can be specified as hyperparameter, with a default value of 0.001.
- The loss function used is a form of the Hinge Loss function. The type of Hinge Loss can be set as a hyperparameter, but the default value is set to 2. This exponentiates the difference, making it a squared hinge loss (L2) by default. Hinge Loss is commonly used for ranking or classification tasks. In this case, it computes the difference (d) between two output values z1 and z0, which represent the relative ranking (i.e., the amount of weeds in image 1 vs. image 0). The function applies the ReLU (1 − d) operation, which ensures that the loss is only computed when z1 is less than z0 by more than 1, encouraging the model to rank the images correctly.
2.3. Model Performance Evaluation
- During training, the squared hinge loss of each batch of image pairs and the pairwise accuracy are calculated for both the training and validation set. The pairwise accuracy is the number of instances where the pairwise ranks are correctly predicted divided by the total number of instances. The pairwise accuracy could also be calculated for an independent test set but was not used in this case.
- For the 100 segmented image subsections, the linearity and the rank consistency were evaluated by determining the Pearson, Spearman’s rank and Kendal rank correlation coefficients between the predicted weed score (z) per image subsection and the number of pixels segmented as “weed”.
- Lastly, the validation set was binary labelled into subsections with label 1 (weeds present) and 0 (no weeds present). F1-scores, overall accuracy, precision and recall were calculated for a range of different thresholds on the predicted z-scores (ranging from 0.5 to 1.6, with a step of 0.01, based on the structure of this dataset) to evaluate classification performance. A Mann–Whitney U test with asymptotic approximation with tie correction was used to see if the image subsections with label 0 had a significantly higher predicted weed (z) score compared to image subsections with label 1. Statistical tests were performed with the SciPy package [35].
3. Results
3.1. Model Performance
3.1.1. The Pairwise Accuracy
3.1.2. Binary Validation
3.1.3. Rank Consistency
3.2. Receptive Field Calculation: Peeking into the Black Box
4. Discussion
4.1. Challenges of Deep Learning Algorithms
4.2. The Dataset
- rankings are complicated by poor data quality in one or both image subsections (differences in lightning, shadow effects, blurred images, not enough spatial resolution to detect very small weed plants),
- an image subsection pair has similar or very similar weed pressure rate.
4.3. The Model
- It is a lightweight model that can be easily trained with a relatively small dataset.
- It makes it easy to shorten or lengthen both the convolutional backbone (for feature extraction) and the specific architecture (one node versus two fully connected layers). The end user can modify this design depending on the complexity of image dataset and the data availability.
- The receptive field calculation of the last convolutional block allows for better evaluation of the model.
4.4. Evaluation Metrics
4.5. Further Recommendations
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Parameter | Value |
---|---|
Learning rate | 0.0001 |
Loss function | squared Hinge Loss |
Final convolutional layer | single channel |
Number of convolutional blocks | 4 |
Number of filters in the 1st layer | 32 |
Number of filters in the 2nd, 3rd and 4th layer | 64 |
Image size | 256 × 256 pixels |
Batch size | 100 |
Maximum number of workers | 12 |
Maximum number of epochs | 100 |
Early stopping rule | When the validation loss does not further decrease after 10 epochs (patience) from the local minimum (to avoid overfitting) |
Appendix B
References
- Loddo, D.; McElroy, J.S.; Giannini, V. Problems and perspectives in weed management. Ital. J. Agron. 2021, 16, 1854. [Google Scholar] [CrossRef]
- Hu, K.; Wang, Z.; Coleman, G.; Bender, A.; Yao, T.; Zeng, S.; Song, D.; Schumann, A.; Walsh, M. Deep learning techniques for in-crop weed recognition in large-scale grain production systems: A review. Precis. Agric. 2024, 25, 1–29. [Google Scholar] [CrossRef]
- Zhang, J.; Yu, F.; Zhang, Q.; Wang, M.; Yu, J.; Tan, Y. Advancements of UAV and Deep Learning Technologies for Weed Management in Farmland. Agronomy 2024, 14, 494. [Google Scholar] [CrossRef]
- Mattivi, P.; Pappalardo, S.E.; Nikolić, N.; Mandolesi, L.; Persichetti, A.; De Marchi, M.; Masin, R. Can commercial low-cost drones and open-source gis technologies be suitable for semi-automatic weed mapping for smart farming? A case study in NE Italy. Remote Sens. 2021, 13, 1869. [Google Scholar] [CrossRef]
- Coulibaly, S.; Kamsu-Foguem, B.; Kamissoko, D.; Traore, D. Deep learning for precision agriculture: A bibliometric analysis. Intell. Syst. Appl. 2022, 16, 200102. [Google Scholar] [CrossRef]
- Hasan, A.S.M.M.; Sohel, F.; Diepeveen, D.; Laga, H.; Jones, M.G.K. A survey of deep learning techniques for weed detection from images. Comput. Electron. Agric. 2021, 184, 106067. [Google Scholar] [CrossRef]
- Su, J.; Zhu, X.; Li, S.; Chen, W.H. AI meets UAVs: A survey on AI empowered UAV perception systems for precision agriculture. Neurocomputing 2023, 518, 242–270. [Google Scholar] [CrossRef]
- Dos Ferreira, S.; Freitas, M.; da Silva, G.; Pistori, H.; Theophilo Folhes, M. Weed detection in soybean crops using ConvNets. Comput. Electron. Agric. 2017, 143, 314–324. [Google Scholar] [CrossRef]
- Steininger, D.; Trondl, A.; Croonen, G.; Simon, J.; Widhalm, V. The CropAndWeed Dataset: A Multi-Modal Learning Approach for Efficient Crop and Weed Manipulation. In Proceedings of the 2023 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Waikoloa, HI, USA, 2–7 January 2023. [Google Scholar] [CrossRef]
- Shahi, T.B.; Dahal, S.; Sitaula, C.; Neupane, A.; Guo, W. Deep Learning-Based Weed Detection Using UAV Images: A Comparative Study. Drones 2023, 7, 624–642. [Google Scholar] [CrossRef]
- Bah, M.D.; Hafiane, A.; Canals, R. Deep Learning with Unsupervised Data Labeling for Weed Detection in Line Crops in UAV Images. Remote Sens. 2018, 10, 1690. [Google Scholar] [CrossRef]
- Genze, N.; Ajekwe, R.; Güreli, Z.; Haselbeck, F.; Grieb, M.; Grimm, D.G. Deep learning-based early weed segmentation using motion blurred UAV images of sorghum fields. Comput. Electron. Agric. 2022, 202, 107388. [Google Scholar] [CrossRef]
- Giakoumoglou, N.; Pechlivani, E.M.; Tzovaras, D. Generate-Paste-Blend-Detect: Synthetic dataset for object detection in the agriculture domain. Smart Agric. Technol. 2023, 5, 100258. [Google Scholar] [CrossRef]
- Seiche, A.T.; Wittstruck, L.; Jarmer, T. Weed Detection from Unmanned Aerial Vehicle Imagery Using Deep Learning—A Comparison between High-End and Low-Cost Multispectral Sensors. Sensors 2024, 24, 1544. [Google Scholar] [CrossRef]
- Ragu, N.; Teo, J. Object detection and classification using few-shot learning in smart agriculture: A scoping mini review. Front. Sustain. Food Syst. 2023, 6, 1039299. [Google Scholar] [CrossRef]
- Belissent, N.; Peña, J.M.; Mesías-Ruiz, G.A.; Shawe-Taylor, J.; Pérez-Ortiz, M. Transfer and zero-shot learning for scalable weed detection and classification in UAV images. Knowl.-Based Systems. 2024, 292, 111586. [Google Scholar] [CrossRef]
- Wang, S.; Han, Y.; Chen, Y.; He, X.; Zhang, Z.; Liu, X.; Zhang, K. Weed Density Extraction Based on Few-Shot Learning Through UAV Remote Sensing RGB and Multispectral Images in Ecological Irrigation Area. Front. Plant Sci. 2022, 12, 735230. [Google Scholar] [CrossRef]
- Bhattacharya, A.R.; Chakraborty, S. Deep Active Learning with Range Feedback for Facial Age Estimation. In Proceedings of the International Joint Conference on Neural Networks, Padua, Italy, 18–23 July 2022; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2022; pp. 1–9. [Google Scholar] [CrossRef]
- Singh, A.; Chakraborty, S. Deep Active Learning with Relative Label Feedback: An Application to Facial Age Estimation. In Proceedings of the International Joint Conference on Neural Networks, Online, 18–22 July 2021; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2021. [Google Scholar] [CrossRef]
- Cao, W.; Mirjalili, V.; Raschka, S. Rank consistent ordinal regression for neural networks with application to age estimation. Pattern Recognit. Lett. 2020, 140, 325–331. [Google Scholar] [CrossRef]
- Parikh, D.; Grauman, K. Relative Attributes. In Proceedings of the International Conference on Computer Vision (ICCV), Barcelona, Spain, 6–13 November 2011. [Google Scholar] [CrossRef]
- Shi, X.; Cao, W.; Raschka, S. Deep Neural Networks for Rank-Consistent Ordinal Regression Based on Conditional Probabilities. Pattern Anal. Applic. 2023, 26, 941–955. [Google Scholar] [CrossRef]
- Xun, L.; Zhang, H.; Yan, Q.; Wu, Q.; Zhang, J. VISOR-NET: Visibility Estimation Based on Deep Ordinal Relative Learning under Discrete-Level Labels. Sensors 2022, 22, 6227. [Google Scholar] [CrossRef]
- AgiSoft Metashape Professional (Software). 2016. Available online: http://www.agisoft.com/downloads/installer/ (accessed on 7 March 2025).
- QGIS.org. (Software). (2022). QGIS Geographic Information System. QGIS Association. Available online: http://www.qgis.org (accessed on 7 March 2025).
- Van Rossum, G.; Drake, F.L. Python 3 Reference Manual; CreateSpace: Scotts Valley, CA, USA, 2009. [Google Scholar]
- Woebbecke, D.M.; Meyer, G.E.; Von Bargen, K.; Mortensen, D.A. Plant Species Identification, Size, and Enumeration Using Machine Vision Techniques on Near Binary Images; DeShazer, J.A., Meyer, G.E., Eds.; International Society for Optics and Photonics: Bellingham, WA, USA, 1993; pp. 208–219. [Google Scholar] [CrossRef]
- Kluyver, T.; Ragan-Kelley, B.; Pérez, F.; Granger, B.E.; Bussonnier, M.; Frederic, J.; Kelley, K.; Hamrick, J.; Grout, J.; Corlay, S.; et al. Jupyter Notebooks—A publishing format for reproducible computational workflows. In Positioning and Power in Academic Publishing: Players, Agents and Agendas; Loizides, F., Schmidt, B., Eds.; IOS Press: Amsterdam, The Netherlands, 2016; pp. 87–90. [Google Scholar] [CrossRef]
- NumPy Develpers. (Software). 2022. Available online: https://numpy.org/doc/stable/license.html (accessed on 7 March 2025).
- Clark, A. Pillow (PIL Fork) Documentation; Read the Docs: Portland, OR, USA, 2015; Available online: https://buildmedia.readthedocs.org/media/pdf/pillow/latest/pillow.pdf (accessed on 7 March 2025).
- Bradski, G. The OpenCV Library. Dr. Dobb’s Journal of Software Tools. 2000. Available online: https://github.com/opencv/opencv (accessed on 7 March 2025).
- Pasiok, R. Serval—Raster Editing Tools. Lutra Consulting. Available online: https://github.com/lutraconsulting/serval/blob/master/Serval/docs/user_manual.md (accessed on 7 March 2025).
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32; Wallach, H., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E., Garnett, R., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2019; pp. 8024–8035. [Google Scholar] [CrossRef]
- Falcon, W.; Borovec, J.; Wälchli, A.; Eggert, N.; Schock, J.; Jordan, J.; Skafte, N.; Ir1dXD; Bereznyuk, V.; Harris, E.; et al. PyToch Lightning. 2019. Available online: https://github.com/Lightning-AI/lightning (accessed on 7 March 2025).
- Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Van Mulbregt, P.; SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods 2020, 17, 261–272. [Google Scholar] [CrossRef]
- Efimov, V. Introducing to Ranking Algorithms. Towards Data Science. 2023. Available online: https://towardsdatascience.com/introduction-to-ranking-algorithms-4e4639d65b8/ (accessed on 7 March 2025).
- Ferrara, A.; Bonchi, F.; Fabbri, F.; Karimi, F.; Wagner, C. Bias-aware ranking from pairwise comparisons. Data Min. Knowl. Disc. 2024, 38, 2062–2086. [Google Scholar] [CrossRef]
- Dosovitsky, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2021, arXiv:2010.11929v2. [Google Scholar] [CrossRef]
- Lei, L.; Yang, Q.; Yang, L.; Shen, T.; Wang, R.; Fu, C. Deep learning implementation of image segmentation in agricultural applications: A comprehensive review. Artif. Intell. Rev. 2024, 57, 149. [Google Scholar] [CrossRef]
- Han, K.; Wang, Y.; Guo, J.; Tang, Y.; Wu, E. Vision gnn: An image is worth graph of nodes. Adv. Neural Inf. Process. Syst. 2022, 35, 8291–8303. [Google Scholar] [CrossRef]
- Zhang, J.; Maleski, J.; Jespersen, D.; Waltz, F.C., Jr.; Rains, G.; Schwartz, B. Unmanned Aerial System-Based Weed Mapping in Sod Production Using a Convolutional Neural Network. Front. Plant Sci. 2021, 12, 702626. [Google Scholar] [CrossRef]
- Lauwers, M.; De Cauwer, B.; Nuyttens, D.; Maes, W.H.; Pieters, J.G. Multispectral UAV Image Classification of JimsonWeed (Datura stramonium L.) in Common Bean (Phaseolus vulgaris L.). Remote Sens. 2024, 16, 3538. [Google Scholar] [CrossRef]
- Lee, J.; Vajjala, S. A Neural Pairwise Ranking Model for Readability Assessment. In Findings of the Association for Computational Linguistics; Association for Computational Linguistics: Dublin, Ireland, 2022; pp. 3802–3813. [Google Scholar] [CrossRef]
- Yan, T. Ranking in the generalized Bradley-Terry models when the strong connection condition fails. Commun. Stat. Theory Methods 2016, 45, 340–353. [Google Scholar] [CrossRef]
No Herbicide | Herbicide |
---|---|
N1 = 427 | N2 = 1328 |
U1 = 35,617 | U2 = 531,012 |
Median = 0.54 | Median = 1.85 |
IQR = 0.62 | IQR = 1.22 |
p-value | 4.99 × 10−163 |
Statistic | Symbol | Estimate | p-Value (α = 0.05) |
---|---|---|---|
Pearson correlation coefficient | rp | 0.81 | 2.61 × 10−24 |
Spearman’s rank correlation coefficient | rs | 0.87 | 2.01 ×10−32 |
Kendall rank correlation coefficient | τ | 0.69 | 2.38 ×10−24 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Verbesselt, S.; Daems, R.; Willekens, A.; Van Beek, J. UAV Based Weed Pressure Detection Through Relative Labelling. Remote Sens. 2025, 17, 3434. https://doi.org/10.3390/rs17203434
Verbesselt S, Daems R, Willekens A, Van Beek J. UAV Based Weed Pressure Detection Through Relative Labelling. Remote Sensing. 2025; 17(20):3434. https://doi.org/10.3390/rs17203434
Chicago/Turabian StyleVerbesselt, Sebastiaan, Rembert Daems, Axel Willekens, and Jonathan Van Beek. 2025. "UAV Based Weed Pressure Detection Through Relative Labelling" Remote Sensing 17, no. 20: 3434. https://doi.org/10.3390/rs17203434
APA StyleVerbesselt, S., Daems, R., Willekens, A., & Van Beek, J. (2025). UAV Based Weed Pressure Detection Through Relative Labelling. Remote Sensing, 17(20), 3434. https://doi.org/10.3390/rs17203434