Automatic Polygon Annotation of Plant Objects for Training Dataset Preparation in Green Biomass Segmentation Tasks
Abstract
1. Introduction
- An automatic algorithm for polygonal annotation of plant objects in field images is developed;
- An integral quality metric is proposed for selecting the optimal segmentation mask during iterative narrowing of the color range;
- The performance of YOLO11-seg segmentation models trained on datasets generated using the proposed algorithm is evaluated.
2. Materials and Methods
2.1. Dataset Description
- Duplication of bounding boxes for the same object;
- Inaccurate positioning or oversized bounding boxes;
- Incorrect object classification;
- Frequent mislabeling of non-plant objects (e.g., stones and soil artifacts) as weeds.
2.2. Preprocessing and Object Extraction
2.3. Adaptive Color Segmentation in HSV Space
2.4. Integral Mask Quality Metric
2.5. Quantitative Evaluation of Annotation Quality and Selection of Weighting Coefficients
2.6. Contour Approximation
2.7. Algorithm Formalization and Implementation Parameters
| Algorithm 1. Polygon Annotation Generation |
| Input: image I, bounding box B Output: polygon P 1: I_crop = crop(I, B) 2: I_hsv = convert_to_HSV(I_crop) 3: H_ranges = {(22 + i, 85)}, i = 0, …, 15 4: best_score = −1 5: history = [] 6: for each (H_low, H_high) in H_ranges do 7: mask = threshold(I_hsv, H_low, H_high, S = [20, 255], V = [20, 240]) 8: mask = morphology_close(mask, kernel = 3 × 3, iter = 2) 9: mask = morphology_open(mask, kernel = 3 × 3, iter = 1) 10: contours = find_contours(mask) 11: if contours is empty then continue 12: C = max_area_contour(contours) 13: area = contour_area(C) 14: if area < 50 then continue 15: bbox = bounding_rect(C) 16: k_shape = (bbox.w * bbox.h)/(I_crop.w * I_crop.h) 17: if first iteration then 18: k_area = 1 19: else 20: k_area = area/prev_area 21: score = 0.7 * k_area + 0.3 * k_shape 22: prev_area = area 23: store (mask, score) in history 24: best_idx = find_first_significant_drop(history, 0.2) 25: best_mask = history[best_idx].mask 26: C_best = max_contour(best_mask) 27: epsilon = 0.0015 * perimeter(C_best) 28: P = approx_polygon(C_best, epsilon) 29: return P |
- HSV hue range: H ∈ [22, 85] with a step of 1 (14 iterations);
- Saturation and value ranges: S ∈ [20, 255], V ∈ [20, 240];
- Morphological processing:
- Closing (kernel 3 × 3, 2 iterations);
- Opening (kernel 3 × 3, 1 iteration).
- Minimum contour area: 50 pixels;
- Scoring function: = 0.7· + 0.3·;
- Selection criterion: first significant drop in (20% of score range);
- Douglas–Peucker approximation parameter: ε = 0.0015·perimeter.
2.8. Neural Network Architecture and Training Parameters
3. Results and Discussion
3.1. Annotation Quality Evaluation
- HSV-based threshold segmentation;
- Otsu global binarization;
- Adaptive thresholding;
- K-Means clustering.
3.2. Evaluation of the Quality of Neural Network Training
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Banerjee, S.; Ramos, P.; Reberg-Horton, C.; Mirsky, S.; Locke, A.; Lobaton, E. A Multiple Instance Learning Approach to Study Leaf Wilt in Soybean Plants. Agriculture 2025, 15, 614. [Google Scholar] [CrossRef]
- Bumbaca, S.; Borgogno-Mondino, E. On the Minimum Dataset Requirements for Fine-Tuning an Object Detector for Arable Crop Plant Counting: A Case Study on Maize Seedlings. Remote Sens. 2025, 17, 2190. [Google Scholar] [CrossRef]
- Belova, Y.V.; Razveeva, I.F.; Rakhimbaeva, E.O. Development of an Algorithm for Semantic Segmentation of Earth Remote Sensing Data to Determine Phytoplankton Populations. Adv. Eng. Res. 2024, 24, 283–292. [Google Scholar] [CrossRef]
- Pallottino, F.; Menesatti, P.; Figorilli, S.; Antonucci, F.; Tomasone, R.; Colantoni, A.; Costa, C. Machine Vision Retrofit System for Mechanical Weed Control in Precision Agriculture Applications. Sustainability 2018, 10, 2209. [Google Scholar] [CrossRef]
- Wang, X.; Wang, Q.; Qiao, Y.; Zhang, X.; Lu, C.; Wang, C. Precision Weed Management for Straw-Mulched Maize Field: Advanced Weed Detection and Targeted Spraying Based on Enhanced YOLO v5s. Agriculture 2024, 14, 2134. [Google Scholar] [CrossRef]
- Donskoy, D.; Gvindjiliya, V.; Ivliev, E. TinyML Classification for Agriculture Objects with ESP32. Digital 2025, 5, 48. [Google Scholar] [CrossRef]
- Sapkota, B.; Singh, V.; Cope, D.; Valasek, J.; Bagavathiannan, M. Mapping and Estimating Weeds in Cotton Using Unmanned Aerial Systems-Borne Imagery. AgriEngineering 2020, 2, 350–366. [Google Scholar] [CrossRef]
- Peerbhay, K.; Devsaran, N.; Lottering, R.; Agjee, N.; Parag, M. Mapping Commercial Forests Infected by the Novel Variant of Elsinoë masingae, Using Unmanned Aerial Technology in Southern Africa. Forests 2025, 16, 966. [Google Scholar] [CrossRef]
- Celikkan, E.; Kunzmann, T.; Yeskaliyev, Y.; Itzerott, S.; Klein, N.; Herold, M. WeedsGalore: A Multispectral and Multitemporal UAV-Based Dataset for Crop and Weed Segmentation in Agricultural Maize Fields. In Proceedings of the 2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Tucson, AZ, USA, 26 February–6 March 2025; IEEE: Piscataway, NJ, USA, 2025; pp. 4767–4777. [Google Scholar] [CrossRef]
- Guo, Z.; Xue, Y.; Wang, C.; Geng, Y.; Lu, R.; Li, H.; Sun, D.; Lou, Z.; Chen, T.; Shi, J.; et al. Efficient weed segmentation in maize fields: A semi-supervised approach for precision weed management with reduced annotation overhead. Comput. Electron. Agric. 2025, 229, 109707. [Google Scholar] [CrossRef]
- Semenova, E.V.; Boyko, A.P.; Novikova, L.Y.; Vishnyakova, M.A. Phenotypic traits differentiating the genetic resources of pea (Pisum sativum L.) by the type of use. Vavilov J. Genet. Breed. 2022, 26, 599–608. [Google Scholar] [CrossRef] [PubMed]
- Safonova, A.; Guirado, E.; Maglinets, Y.; Alcaraz-Segura, D.; Tabik, S. Olive Tree Biovolume from UAV Multi-Resolution Image Segmentation with Mask R-CNN. Sensors 2021, 21, 1617. [Google Scholar] [CrossRef]
- Henke, M.; Neumann, K.; Altmann, T.; Gladilin, E. Semi-Automated Ground Truth Segmentation and Phenotyping of Plant Structures Using k-Means Clustering of Eigen-Colors (kmSeg). Agriculture 2021, 11, 1098. [Google Scholar] [CrossRef]
- Okyere, F.G.; Cudjoe, D.; Sadeghi-Tehran, P.; Virlet, N.; Riche, A.B.; Castle, M.; Greche, L.; Mohareb, F.; Simms, D.; Mhada, M.; et al. Machine Learning Methods for Automatic Segmentation of Images of Field- and Glasshouse-Based Plants for High-Throughput Phenotyping. Plants 2023, 12, 2035. [Google Scholar] [CrossRef]
- Kozhekin, M.V.; Genaev, M.A.; Komyshev, E.G.; Zavyalov, Z.A.; Afonnikov, D.A. Plant Detection in RGB Images from Unmanned Aerial Vehicles Using Segmentation by Deep Learning and an Impact of Model Accuracy on Downstream Analysis. J. Imaging 2025, 11, 28. [Google Scholar] [CrossRef]
- Mudarisov, S.G.; Miftakhov, I.R.; Farkhutdinov, I.M. Automated sugar beet seedling detection and mapping using a UAV-borne RGB camera and deep learning techniques. Agric. Eng. 2025, 27, 4–16. [Google Scholar] [CrossRef]
- Wang, X.; Lv, X.; Xing, X.; Qiao, X.; Yang, Y.; Zhang, K.; Liu, Y.; Yang, Y.; Yang, Y.; Luo, B.; et al. Automatic annotation and performance evaluation of orchard pear fruit using SAM-based zero-shot segmentation. Smart Agric. Technol. 2026, 13, 101826. [Google Scholar] [CrossRef]
- Ivliev, E.; Demchenko, V.; Obukhov, P. Automatic Monitoring of Smart Greenhouse Parameters and Detection of Plant Diseases by Neural Networks. In Robotics, Machinery and Engineering Technology for Precision Agriculture; Smart Innovation, Systems and Technologies; Shamtsyan, M., Pasetti, M., Beskopylny, A., Eds.; Springer: Singapore, 2022; Volume 247, pp. 37–45. [Google Scholar] [CrossRef]
- Chen, C.; Zang, Y.; Jiao, J.; Yan, D.; Fan, Z.; Cui, Z.; Zhang, M. An Efficient Group Convolution and Feature Fusion Method for Weed Detection. Agriculture 2025, 15, 37. [Google Scholar] [CrossRef]
- López-Correa, J.M.; Moreno, H.; Ribeiro, A.; Andújar, D. Intelligent Weed Management Based on Object Detection Neural Networks in Tomato Crops. Agronomy 2022, 12, 2953. [Google Scholar] [CrossRef]
- Sodjinou, S.G.; Mahama, A.T.S.; Gouton, P. Automatic Segmentation of Plants and Weeds in Wide-Band Multispectral Imaging (WMI). J. Imaging 2025, 11, 85. [Google Scholar] [CrossRef] [PubMed]
- Darbyshire, M.; Salazar-Gomez, A.; Gao, J.; Sklar, E.I.; Parsons, S. Towards practical object detection for weed spraying in precision agriculture. Front. Plant Sci. 2023, 14, 1183277. [Google Scholar] [CrossRef] [PubMed]
- Douglas, D.H.; Peucker, T.K. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. Can. Cartogr. 1973, 10, 112–122. [Google Scholar] [CrossRef]
- Luo, R.; Zhao, R.; Yi, B. Enhanced YOLO11n-Seg with Attention Mechanism and Geometric Metric Optimization for Instance Segmentation of Ripe Blueberries in Complex Greenhouse Environments. Agriculture 2025, 15, 1697. [Google Scholar] [CrossRef]
- Qiu, Z.; Huang, X.; Sun, Z.; Li, S.; Wang, J. GS-YOLO-Seg: A Lightweight Instance Segmentation Method for Low-Grade Graphite Ore Sorting Based on Improved YOLO11-Seg. Sustainability 2025, 17, 5663. [Google Scholar] [CrossRef]



















| Dataset Version | Images | Crops | Weeds |
|---|---|---|---|
| Original dataset | 3876 | 14,403 | 19,692 |
| Cleaned dataset | 3876 | 13,547 | 18,877 |
| , % | , % | ||
|---|---|---|---|
| 1.0 | 0.0 | 90.19 | 94.61 |
| 0.9 | 0.1 | 91.22 | 95.18 |
| 0.8 | 0.2 | 92.01 | 95.63 |
| 0.7 | 0.3 | 93.22 | 96.30 |
| 0.6 | 0.4 | 92.41 | 95.86 |
| 0.5 | 0.5 | 91.35 | 95.27 |
| 0.4 | 0.6 | 90.10 | 94.54 |
| 0.3 | 0.7 | 89.05 | 93.93 |
| 0.2 | 0.8 | 88.12 | 93.36 |
| 0.1 | 0.9 | 87.28 | 92.87 |
| 0.0 | 1.0 | 84.23 | 91.08 |
| Model | FLOPS (×109) | Parameters (×106) |
|---|---|---|
| YOLO11n-seg | 9.7 | 2.9 |
| YOLO11s-seg | 33.0 | 10.1 |
| YOLO11m-seg | 113.2 | 22.4 |
| YOLO11l-seg | 132.2 | 27.6 |
| YOLO11x-seg | 296.4 | 62.1 |
| Method | , % | |
|---|---|---|
| The proposed method | 93.22 | 96.30 |
| HSV thresholding | 76.42 | 85.53 |
| K-Means | 47.84 | 63.29 |
| Adaptive threshold | 43.49 | 59.64 |
| Otsu binarization | 39.76 | 55.22 |
| Model | Precision | Recall | mAP@0.5 | mAP@0.5:0.95 | F1-Score |
|---|---|---|---|---|---|
| YOLO11n-seg | 0.774 | 0.755 | 0.814 | 0.579 | 0.764 |
| YOLO11s-seg | 0.787 | 0.735 | 0.819 | 0.583 | 0.760 |
| YOLO11m-seg | 0.783 | 0.761 | 0.819 | 0.592 | 0.772 |
| YOLO11l-seg | 0.770 | 0.760 | 0.822 | 0.594 | 0.765 |
| YOLO11x-seg | 0.764 | 0.755 | 0.822 | 0.596 | 0.759 |
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. |
© 2026 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.
Share and Cite
Ivliev, E.; Gvindjiliya, V.; Donskoy, D.; Chayka, Y. Automatic Polygon Annotation of Plant Objects for Training Dataset Preparation in Green Biomass Segmentation Tasks. J. Imaging 2026, 12, 192. https://doi.org/10.3390/jimaging12050192
Ivliev E, Gvindjiliya V, Donskoy D, Chayka Y. Automatic Polygon Annotation of Plant Objects for Training Dataset Preparation in Green Biomass Segmentation Tasks. Journal of Imaging. 2026; 12(5):192. https://doi.org/10.3390/jimaging12050192
Chicago/Turabian StyleIvliev, Evgeniy, Valery Gvindjiliya, Danila Donskoy, and Yevgeniy Chayka. 2026. "Automatic Polygon Annotation of Plant Objects for Training Dataset Preparation in Green Biomass Segmentation Tasks" Journal of Imaging 12, no. 5: 192. https://doi.org/10.3390/jimaging12050192
APA StyleIvliev, E., Gvindjiliya, V., Donskoy, D., & Chayka, Y. (2026). Automatic Polygon Annotation of Plant Objects for Training Dataset Preparation in Green Biomass Segmentation Tasks. Journal of Imaging, 12(5), 192. https://doi.org/10.3390/jimaging12050192

