Computer Vision-Based Lettuce and Plantweed Segmentation Using YOLO and Segment Anything for Precision Agriculture
Keywords:
YOLO11s; Segment Anything Model; Image Segmentation; Computer Vision; Precision Agriculture
Abstract
The presence of weeds in lettuce cultivation areas can reduce plant productivity because they compete for nutrients, water, and light. Manual weed identification requires considerable time and effort, so an automated system based on computer vision is needed . This study proposes the integration of the YOLO11s model and the Segment Anything Model (SAM) to detect and segment lettuce plants and weeds in agricultural environments. The dataset used consists of 741 training images , 212 validation images , and 106 testing images with two object classes, namely Lettuce and Plantweed . The YOLO11s model was trained for 100 epochs using an image size of 640 × 640 pixels and a batch size of 106 . 16. The training results show that the model obtained an mAP@50 value of 87.8%. And mAP@50–95 was 80.0% , indicating good object detection capability. Furthermore, the bounding box coordinates of the detection results were used as prompts in the Segment Anything Model to generate mask -shaped segmentations that follow the object contours more precisely. The experimental results show that the integration of YOLO11s and SAM is able to produce more detailed object representations compared to detection using bounding boxes alone. This approach has the potential to support various precision agriculture applications, such as plant morphology analysis, leaf area estimation, and the development of automated weed control systems .
Downloads
References
[1] Iwan Patria, “Transformasi Pertanian Presisi Berbasis Digital di Indonesia: Tinjauan Sistematis Peluang dan Tantangan,” INSOLOGI J. Sains dan Teknol., vol. 4, no. 6, pp. 1462–1477, Dec. 2025, doi: 10.55123/insologi.v4i6.6319.
[2] R. Rosidi, “Pengembangan Pertanian Presisi Berbasis Teknologi Digital di Indonesia Perspektif Al-Qur’an,” Alashriyyah, vol. 11, no. 2, pp. 345–364, Oct. 2025, doi: 10.53038/alashriyyah.v11i2.282.
[3] F. R. Aminda, H. Anggrasari, and A. K. Sari, “Study of Horticultural Crop Leading Commodities Development in Banjarnegara Regency, Central Java Province,” Agritech J. Fak. Pertan. Univ. Muhammadiyah Purwokerto, vol. 25, no. 2, p. 163, Feb. 2024, doi: 10.30595/agritech.v25i2.19566.
[4] R. Sabtu and S. Kisman, “IDENTIFIKASI GULMA PADA LAHAN PERCONTOHAN PKK KELURAHAN MALIARO KOTA TERNATE,” SAINTIFIK@ J. Pendidik. MIPA, vol. 9, no. 2, pp. 1–11, Nov. 2024, doi: 10.33387/saintifik.v9i2.8958.
[5] P. L. Tarigan, A. Fitrianti, A. W. Wardhana, V. Gabrielle, S. I. Andisha, and N. Ayni, “Analisis Vegetasi Gulma Tanaman Mawar pada Lahan Dataran Tinggi dan Rendah,” J-Plantasimbiosa, vol. 7, no. 1, pp. 38–44, May 2025, doi: 10.25181/jplantasimbiosa.v7i1.3880.
[6] D. R. Tobergte and S. Curtis, Algorithms for image prcessing and computer vision, vol. 53, no. 9. 2013. doi: 10.1017/CBO9781107415324.004.
[7] D. S. Alfan and I. Kumalasari, “Implementasi Model Deep Learning MobileNetV2 untuk Klasifikasi Citra Melanoma Berbasis Web,” vol. 7, no. 3, pp. 670–680, 2026, doi: 10.47065/josh.v7i3.8848.
[8] Reni Triyaningsih, Pradita Eko Prasetyo Utomo, and Benedika Ferdian Hutabarat, “Application of You Only Look Once (YOLO) Method for Sign Language Identification,” J. Nas. Tek. Elektro dan Teknol. Inf., vol. 14, no. 4, pp. 254–262, Nov. 2025, doi: 10.22146/jnteti.v14i4.21931.
[9] I. A. Zulkarnain and K. Kusrini, “Optimasi Yolov11 Melalui Hyperparameter Tuning dan Data Augmentasi untuk Meningkatkan Akurasi Deteksi Kendaraan pada Kondisi Malam Hari: Yolov11 Optimization Through Hyperparameter Tuning and Data Augmentation to Improve Vehicle Detection Accuracy at Night,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 5, no. 4, pp. 294–1303, 2025, doi: 10.57152/malcom.v5i4.2250.
[10] K. Krisdianto, Elta Sonalitha, and Yandhika Surya Akbar Gumilang, “Deteksi penyakit padi menggunakan YOLO,” Uranus J. Ilm. Tek. Elektro, Sains dan Inform., vol. 2, no. 3, pp. 125–134, Jul. 2024, doi: 10.61132/uranus.v2i3.259.
[11] H. Herdianto, H. Hafni, D. Nasution, and S. Ramadhan, “Implementasi Metode Yolo pada Deteksi Objek Manusia,” METHOMIKA J. Manaj. Inform. dan Komputerisasi Akunt., vol. 8, no. 2, pp. 234–240, Oct. 2024, doi: 10.46880/jmika.Vol8No2.pp234-240.
[12] S. Minaee, Y. Y. Boykov, F. Porikli, A. J. Plaza, N. Kehtarnavaz, and D. Terzopoulos, “Image Segmentation Using Deep Learning: A Survey,” IEEE Trans. Pattern Anal. Mach. Intell., pp. 1–1, 2021, doi: 10.1109/TPAMI.2021.3059968.
[13] A. Kirillov et al., “Segment Anything,” 2023.
[14] L. Zhang, X. Deng, and Y. Lu, “Segment Anything Model (SAM) for Medical Image Segmentation: A Preliminary Review,” in 2023 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), IEEE, Dec. 2023, pp. 4187–4194. doi: 10.1109/BIBM58861.2023.10386032.
[15] M. Luo, T. Zhang, S. Wei, and S. Ji, “SAM-RSIS: Progressively Adapting SAM With Box Prompting to Remote Sensing Image Instance Segmentation,” IEEE Trans. Geosci. Remote Sens., vol. 62, pp. 1–14, 2024, doi: 10.1109/TGRS.2024.3460085.
[16] P. Ghose, A. Bashir, Y. Wang, C. Bua, and A. Zahid, “YOLO-SAM AgriScan: A Unified Framework for Ripe Strawberry Detection and Segmentation with Few-Shot and Zero-Shot Learning,” Sensors, vol. 25, no. 24, p. 7678, Dec. 2025, doi: 10.3390/s25247678.
[17] R. Khanam and M. Hussain, “YOLOv11: An Overview of the Key Architectural Enhancements,” vol. 2024, pp. 1–9, 2024, [Online]. Available: http://arxiv.org/abs/2410.17725
[18] Z. Wang et al., “PC-YOLO11s: A Lightweight and Effective Feature Extraction Method for Small Target Image Detection,” Sensors, vol. 25, no. 2, p. 348, Jan. 2025, doi: 10.3390/s25020348.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Akhmad Jayadi, Adi Ahmad Fauzi, Muhammad Ikhsan, Jaka Persada Sembiring, Ahmad Rofi'i

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish in Hanif Journal of Information Systems agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
Most read articles by the same author(s)
- Akhmad Jayadi, Kurniawan Saputra, Ahmad Rofi'i, Improving the Accuracy of Lettuce and Weed Classification Based on MobileNetV2 Features Through Segmentation , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
Similar Articles
- Akhmad Jayadi, Kurniawan Saputra, Ahmad Rofi'i, Improving the Accuracy of Lettuce and Weed Classification Based on MobileNetV2 Features Through Segmentation , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
- Ilham Prastia, Mulkan Azhari, Development of Virtual Reality-Based Computer Assembly Simulation Learning Media , Hanif Journal of Information Systems : Vol. 3 No. 1 (2025): August Edition
- Sumita Wardani, Sartika Mandasari, Meisarah Riandini, Predicting Student Dropout Risk Using XGBoost and Explainable AI , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
- nurkumalalubis, Mulkan Azhari, Machine Learning-Based Phishing Email Detection: A Comparative Study of Support Vector Machine and Random Forest , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
- Andi Zulherry, Al-Khowarizmi, Implementation of Multi-Room Computer Laboratory Network Infrastructure Based on Star Topology in an Educational Environment , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
- Pastima Simanjuntak, Rika Harman, Predicting Non-Performing Loan Levels Using XGBoost and Explainable Data Mining , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
- Maswitha Maswitha, Syahriol Sitorus, Application of Jackson Network Queue Model on Visitor Queue at Population and Civil Registration Service of Batubara District , Hanif Journal of Information Systems : Vol. 2 No. 2 (2025): February Edition
- Perdinal Nasution, Mulkan Azhari, Application of Data Mining to Determine the Performance of Family Planning Field Officers (PLKB) Using the C4.5 Algorithm , Hanif Journal of Information Systems : Vol. 3 No. 1 (2025): August Edition
- Ahmad Asadel, Andi Zulherry, Detecting Zero-Width Characters Obfuscated in Phishing URLs using the XGBOOST Algorithm , Hanif Journal of Information Systems : Vol. 3 No. 1 (2025): August Edition
- Zulkifli Hasibuan, Implementation of the Least Significant Bit (LSB) Method for Data Security in a Mandailing Language Dictionary , Hanif Journal of Information Systems : Vol. 3 No. 2 (2026): February Edition
You may also start an advanced similarity search for this article.









