PERTANIKA JOURNAL OF SCIENCE AND TECHNOLOGY

 

e-ISSN 2231-8526
ISSN 0128-7680

Home / Regular Issue / JST Vol. 33 (S3) 2025 / JST(S)-0647-2024

 

Weeds Detection for Agriculture Using Convolutional Neural Network (CNN) Algorithm for Sustainable Productivity

Khairun Nisa Mohammad Nasir, Hasiah Mohamed, Norshuhani Zamin and Rajeswari Raju

Pertanika Journal of Science & Technology, Volume 33, Issue S3, December 2025

DOI: https://doi.org/10.47836/pjst.33.S3.02

Keywords: Agriculture, CNN, detection, hyperparameters, performance, weed

Published on: 2025-04-24

This project aims to develop a weed detection prototype for agricultural settings using the Convolutional Neural Networks (CNN) algorithm. The project thoroughly analyses and optimises CNN hyperparameters to improve accuracy and efficiency, empowering efficient weed control practices. The potential of this algorithm in weed detection is immense, offering a promising future for sustainable productivity in agriculture. Adopting innovative and sustainable agricultural practices is essential for building a robust and productive agriculture sector that can meet future food demands while protecting the environment. The research then assesses how well the CNN model generalises to various agricultural environments that support multiple crop situations. The dataset comprises 360 images of weeds, broadleaf, maise plants, soil and cotton crops. The images underwent four preprocessing phases: image scaling, normalisation, filtering, and segmentation. The proposed model achieved an accuracy of 89.82% utilizing the Convolutional Neural Network (CNN) algorithm, with the dataset partitioned into 80% for training and 20% for testing. Furthermore, the model attained an F1 score of 88.08%, indicating a high degree of alignment between predicted positive instances and actual positive samples. In addition to technological innovations in agriculture, this CNN-based weed detection prototype is a reliable resource for agriculturalists. AI-driven weed detection optimizes resource use, ensuring that pesticides and herbicides are applied only where necessary, reducing chemical overuse. This is in line with the United Nation Sustainable Development Goal (SDG) No. 12.

  • Anwar, M. P., Islam, A. M., Yeasmin, S., Rashid, M. H., Juraimi, A. S., Ahmed, S., & Shrestha, A. (2021). Weeds and their responses to management efforts in a changing climate. Agronomy, 11(10), 1921. https://doi.org/10.3390/agronomy11101921. https://www.mdpi.com/2073-4395/11/10/1921

    Asad, M. H., & Bais, A. (2020). Weed detection in canola fields using maximum likelihood classification and deep convolutional neural network. Information Processing in Agriculture, 7(4), 535-545. https://doi.org/10.1016/j.inpa.2019.12.002

    Boliko, M. C. (2019). FAO and the situation of food security and nutrition in the world. Journal of Nutritional Science and Vitaminology, 65(Supplement), S4-S8. https://doi.org/10.3177/jnsv.65.s4

    Chegini, H., Beltran, F., & Mahanti, A. (2023). Designing and developing a weed detection model for California Thistle. ACM Transactions on Internet Technology (TOIT), 23(3), 1-9. https://doi.org/10.1145/3544491

    Cox, G., Lowe, P., & Winter, M. (2019). Agriculture: People and policies (Vol. 5). Routledge. https://doi.org/10.4324/9780429340949

    Darwin, B., Dharmaraj, P., Prince, S., Popescu, D. E., & Hemanth, D. J. (2021). Recognition of bloom/yield in crop images using deep learning models for smart agriculture: A review. Agronomy, 11(4), 646. https://doi.org/10.3390/agronomy11040646

    De Clercq, M., Vats, A., & Biel, A. (2018). Agriculture 4.0: The future of farming technology. Proceedings of the World Government Summit, 1-30.

    Dong, H., Zhang, L., & Zou, B. (2021). Exploring vision transformers for polarimetric SAR image classification. IEEE Transactions on Geoscience and Remote Sensing, 60, 1-15. https://doi.org/10.1109/TGRS.2021.3137383

    Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., & Gelly, S. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929

    Edwards, N. (2024). Weeds. Reaktion Books.

    Farooq, A., Hu, J., & Jia, X. (2018). Weed classification in hyperspectral remote sensing images via deep convolutional neural network. In IGARSS 2018-2018 IEEE International Geoscience and Remote Sensing Symposium (pp. 3816-3819). IEEE. https://doi.org/10.1109/IGARSS.2018.8518541

    Ghazal, S., Munir, A., & Qureshi, W. S. (2024). Computer vision in smart agriculture and precision farming: Techniques and applications. Artificial Intelligence in Agriculture, 13, 64-83. https://doi.org/10.1016/j.aiia.2024.06.004

    Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. MIT Press.

    Gu, J., Wang, Z., Kuen, J., Ma, L., Shahroudy, A., Shuai, B., Liu, T., Wang, X., Wang, G., & Cai, J. (2018). Recent advances in convolutional neural networks. Pattern Recognition, 77, 354-377. https://doi.org/10.1016/j.patcog.2017.10.013

    Haichen, J., Qingrui, C., & Zheng Guang, L. (2020). Weeds and crops classification using deep convolutional neural network. In Proceedings of the 3rd International Conference on Control and Computer Vision (pp. 40-44). Association for Computing Machinery. https://doi.org/10.1145/3425577.3425585

    Hall, D., Dayoub, F., Skinner, J., Zhang, H., Miller, D., Corke, P., Carneiro, G., Angelova, A., & Sünderhauf, N. (2020). Probabilistic object detection: Definition and evaluation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (pp. 1031-1040). IEEE. https://doi.org/10.1109/WACV45572.2020.9093599

    Hamuda, E. A. (2019). Signal and image processing technology for smart agriculture. NUI Galway.

    Harwood, R. R. (2020). A history of sustainable agriculture. In Sustainable agricultural systems (pp. 3-19). CRC Press. https://doi.org/10.1201/9781003070474-2

    Henaff, O. J., Srinivas, A., De Fauw, J., Razavi, A., Doersch, C., Eslami, S. M. A., & Van Den Oord, A. (2020). Data-efficient image recognition with contrastive predictive coding. In Proceedings of the 37th International Conference on Machine Learning (pp. 4182-4192). JMLR.org.

    Hu, D., Ma, C., Tian, Z., Shen, G., & Li, L. (2021). Rice weed detection method on YOLOv4 convolutional neural network. In 2021 International Conference on Artificial Intelligence, Big Data and Algorithms (CAIBDA) (pp. 41-45). IEEE. https://doi.org/10.1109/CAIBDA53561.2021.00016

    Islam, N., Rashid, M. M., Wibowo, S., Xu, C.-Y., Morshed, A., Wasimi, S. A., Moore, S., & Rahman, S. M. (2021). Early weed detection using image processing and machine learning techniques in an Australian chilli farm. Agriculture, 11(5), 387. https://doi.org/10.3390/agriculture11050387

    Jinglei, T., Ronghui, M., Zhiyong, Z., Jing, X., & Dong, W. (2017). Distance-based separability criterion of ROI in classification of farmland hyper-spectral images. International Journal of Agricultural and Biological Engineering, 10(5), 177-185. https://doi.org/10.25165/j.ijabe.20171005.2264

    Katel, S., Yadav, S. P. S., Khadka, A., Karki, N., & Neupane, S. (2023). Cereal import and consumption patterns in Nepal–Analysis of rice, wheat, maize, and millet: A review. Russian Journal of Agricultural and Socio-Economic Sciences, 139(7), 16-32. https://doi.org/10.18551/rjoas.2023-07.03

    Klerkx, L., Jakku, E., & Labarthe, P. (2019). A review of social science on digital agriculture, smart farming, and Agriculture 4.0: New contributions and a future research agenda. NJAS - Wageningen Journal of Life Sciences, 90, 100315. https://doi.org/10.1016/j.njas.2019.100315

    Komarek, A. M., De Pinto, A., & Smith, V. H. (2020). A review of types of risks in agriculture: What we know and what we need to know. Agricultural Systems, 178, 102738. https://doi.org/10.1016/j.agsy.2019.102738

    Li, K., Wan, G., Cheng, G., Meng, L., & Han, J. (2020). Object detection in optical remote sensing images: A survey and a new benchmark. ISPRS Journal of Photogrammetry and Remote Sensing, 159, 296-307. https://doi.org/10.1016/j.isprsjprs.2019.11.023

    Lottes, P., Behley, J., Milioto, A., & Stachniss, C. (2018). Fully convolutional networks with sequential information for robust crop and weed detection in precision farming. IEEE Robotics and Automation Letters, 3(4), 2870-2877. https://doi.org/10.1109/LRA.2018.2846289

    Lowry, C. J., & Smith, R. G. (2018). Weed control through crop plant manipulations. In K. Jabran & B. S. Chauhan (Eds.), Non-chemical weed control (pp. 73-96). Academic Press. https://doi.org/10.1016/B978-0-12-809881-3.00005-X

    Mohan, A., & Poobal, S. (2018). Crack detection using image processing: A critical review and analysis. Alexandria Engineering Journal, 57(2), 787-798. https://doi.org/10.1016/j.aej.2017.01.020

    Murthy, C. B., Hashmi, M. F., Bokde, N. D., & Geem, Z. W. (2020). Investigations of object detection in images/videos using various deep learning techniques and embedded platforms—A comprehensive review. Applied Sciences, 10(9), 3280. https://doi.org/10.3390/app10093280

    Otsuka, K., & Fan, S. (Eds.) (2021). Agricultural development: New perspectives in a changing world. International Food Policy Research Institute. https://doi.org/10.2499/9780896293830

    Patidar, S., Singh, U., & Sharma, S. K. (2020). Weed seedling detection using mask regional convolutional neural network. In 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC) (pp. 311-316). IEEE. https://doi.org/10.1109/ICESC48915.2020.9155701

    Patton, B. A. (2023). Control of annual grasses using new Sorghum Herbicides [Master’s thesis, Texas Tech University]. https://ttu-ir.tdl.org/server/api/core/bitstreams/b44e9489-b099-4944-84da-95140f3e15d9/content

    Pervaiz, R. (2024). Herbicide strategies for weed control in rice cultivation: Current practices and future directions. Haya: Saudi Journal of Life Sciences, 9(4), 114-129. https://doi.org/10.36348/sjls.2024.v09i04.004

    Powers, D. M. W. (2011). Evaluation: From precision, recall and F-measure to ROC, informedness, markedness & correlation. Journal of Machine Learning Technologies, 2(1), 37–63.

    Prathima, S. Y., & Varshini, V. (2024). Integrating IoT sensors and deep learning for robust crop and weed discrimination in dynamic agricultural environments. In 2024 2nd International Conference on Networking and Communications (ICNWC) (pp. 1-6). IEEE. https://doi.org/10.1109/icnwc60771.2024.10537300

    Qiao, S., Shen, W., Zhang, Z., Wang, B., & Yuille, A. (2018). Deep co-training for semi-supervised image recognition. In V. Ferrari, M. Hebert, C. Sminchisescu & Y. Weiss (Eds.), Proceedings of the European Conference on Computer Vision (ECCV) (pp. 142-159). Springer. https://doi.org/10.1007/978-3-030-01267-0_9

    Ramli, Z., Juraimi, A. S., Motmainna, M., Che’Ya, N. N., Roslim, M. H. M., Noor, N. M., & Ahmad, A. (2024). Weed management using UAV and remote sensing in Malaysia paddy field: A review. Pertanika Journal of Science & Technology, 33(3), 1219-1241. https://doi.org/10.47836/pjst.32.3.13

    Razfar, N., True, J., Bassiouny, R., Venkatesh, V., & Kashef, R. (2022). Weed detection in soybean crops using custom lightweight deep learning models. Journal of Agriculture and Food Research, 8, 100308. https://doi.org/10.1016/j.jafr.2022.100308

    Saleh, A. Y., Chin, C. K., & Rosdi, R. A. (2024). Transfer learning for lung nodules classification with CNN and random forest. Pertanika Journal of Science & Technology, 32(1), 463-479. https://doi.org/10.47836/pjst.32.1.25

    Sarvini, T., Sneha, T., GS, S. G., Sushmitha, S., & Kumaraswamy, R. (2019). Performance comparison of weed detection algorithms. In 2019 International Conference on Communication and Signal Processing (ICCSP) (pp. 0843-0847). IEEE. https://doi.org/10.1109/iccsp.2019.8698094

    Shorewala, S., Ashfaque, A., Sidharth, R., & Verma, U. (2021). Weed density and distribution estimation for precision agriculture using semi-supervised learning. IEEE Access, 9, 27971-27986. https://doi.org/10.1109/ACCESS.2021.3057912

    Singh, V., Gourisaria, M. K., GM, H., & Choudhury, T. (2023). Weed detection in soybean crop using Deep Neural Network. Pertanika Journal of Science & Technology, 31(1), 401-423. https://doi.org/10.47836/pjst.31.1.24

    Tan, K. K. H., Wong, Y. W., & Nugroho, H. (2022). Image classification for edge-cloud setting: A comparison study for OCR application. Pertanika Journal of Science & Technology, 30(2), 157-1170. https://doi.org/10.47836/pjst.30.2.17

    Tan, M., & Le, Q. (2019). Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning (pp. 6105-6114). PMLR.

    Traore, B. B., Kamsu-Foguem, B., & Tangara, F. (2018). Deep convolution neural network for image recognition. Ecological Informatics, 48, 257-268. https://doi.org/10.1016/j.ecoinf.2018.10.002

    Ukaegbu, U. F., Tartibu, L. K., Okwu, M. O., & Olayode, I. O. (2021). Deep learning application in diverse fields with plant weed detection as a case study. In Proceedings of the International Conference on Artificial Intelligence and its Applications (pp. 1-9). Association for Computing Machinery. https://doi.org/10.1145/3487923.3487926

    Umamaheswari, S., Arjun, R., & Meganathan, D. (2018). Weed detection in farm crops using parallel image processing. In 2018 Conference on Information and Communication Technology (CICT) (pp. 1-4). IEEE. https://doi.org/10.1109/INFOCOMTECH.2018.8722369

    Ustuner, T., Sakran, A., & Almhemed, K. (2020). Effect of herbicides on living organisms in the ecosystem and available alternative control methods. International Journal of Scientific and Research Publications, 10(8), 633-641. https://doi.org/10.29322/IJSRP.10.08.2020.p10480

    Vasileiou, M., Kyriakos, L. S., Kleisiari, C., Kleftodimos, G., Vlontzos, G., Belhouchette, H., & Pardalos, P. M. (2023). Transforming weed management in sustainable agriculture with artificial intelligence: A systematic literature review towards weed identification and deep learning. Crop Protection, 176, 106522. https://doi.org/10.1016/j.cropro.2023.106522

    Voutos, Y., Mylonas, P., Katheniotis, J., & Sofou, A. (2019). A survey on intelligent agricultural information handling methodologies. Sustainability, 11(12), 3278. https://doi.org/10.3390/su11123278

    Westwood, J. H., Charudattan, R., Duke, S. O., Fennimore, S. A., Marrone, P., Slaughter, D. C., Swanton, C., & Zollinger, R. (2018). Weed management in 2050: Perspectives on the future of weed science. Weed Science, 66(3), 275-285. https://doi.org/10.1017/wsc.2017.78

    Woyessa, D. (2022). Weed control methods used in agriculture. American Journal of Life Science and Innovation, 1(1), 19-26. https://doi.org/10.54536/ajlsi.v1i1.413

    Wu, J., Li, B., & Wu, Z. (2019). Detection of crop pests and diseases based on deep convolutional neural network and improved algorithm. In Proceedings of the 2019 4th International Conference on Machine Learning Technologies (pp. 20-27). Association for Computing Machinery. https://doi.org/10.1145/3340997.3341010

    Xiao, Y., Tian, Z., Yu, J., Zhang, Y., Liu, S., Du, S., & Lan, X. (2020). A review of object detection based on deep learning. Multimedia Tools and Applications, 79, 23729-23791. https://doi.org/10.1007/s11042-020-08976-6

    Xie, C., Tan, M., Gong, B., Wang, J., Yuille, A. L., & Le, Q. V. (2020). Adversarial examples improve image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 816-825). IEEE. https://doi.org/10.1109/CVPR42600.2020.00090

    Xu, K., Shu, L., Xie, Q., Song, M., Zhu, Y., Cao, W., & Ni, J. (2023). Precision weed detection in wheat fields for agriculture 4.0: A survey of enabling technologies, methods, and research challenges. Computers and Electronics in Agriculture, 212, 108106. https://doi.org/10.1016/j.compag.2023.108106

    Yamashita, R., Nishio, M., Do, R. K. G., & Togashi, K. (2018). Convolutional neural networks: An overview and application in radiology. Insights into Imaging, 9, 611-629. https://doi.org/10.1007/s13244-018-0639-9

    Zhou, D.-X. (2020). Theory of deep convolutional neural networks: Downsampling. Neural Networks, 124, 319-327. https://doi.org/10.1016/j.neunet.2020.01.018

    Zoph, B., Vasudevan, V., Shlens, J., & Le, Q. V. (2018). Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 8697-8710). IEEE. https://doi.org/10.1109/CVPR.2018.00907

ISSN 0128-7680

e-ISSN 2231-8526

Article ID

JST(S)-0647-2024

Download Full Article PDF

Share this article

Related Articles