Crop Detection and Maturity Classification Using a YOLOv5-Based Image Analysis

Viviana Moya, Angélica Quito, Andrea Pilco, Juan P. Vásconez, Christian Vargas


In recent years, the accurate identification of chili maturity stages has become essential for optimizing cultivation processes. Conventional methodologies, primarily reliant on manual assessments or rudimentary detection systems, often fall short of reflecting the plant’s natural environment, leading to inefficiencies and prolonged harvest periods. Such methods may be imprecise and time-consuming. With the rise of computer vision and pattern recognition technologies, new opportunities in image recognition have emerged, offering solutions to these challenges. This research proposes an affordable solution for object detection and classification, specifically through version 5 of the You Only Look Once (YOLOv5) model, to determine the location and maturity state of rocoto chili peppers cultivated in Ecuador. To enhance the model’s efficacy, we introduce a novel dataset comprising images of chili peppers in their authentic states, spanning both immature and mature stages, all while preserving their natural settings and potential environmental impediments. This methodology ensures that the dataset closely replicates real-world conditions encountered by a detection system. Upon testing the model with this dataset, it achieved an accuracy of 99.99% for the classification task and an 84% accuracy rate for the detection of the crops. These promising outcomes highlight the model’s potential, indicating a game-changing technique for chili small-scale farmers, especially in Ecuador, with prospects for broader applications in agriculture.


Doi: 10.28991/ESJ-2024-08-02-08

Full Text: PDF


Chili Peppers; Dataset; Detection; Classification; YOLOv5.


Hou, X., Li, J., Yin, S., & Yuan, H. (2022). Evolution of Agricultural Innovation Ecosystem in County Areas: A Life-Cycle Perspective of Cases in Hebei Province. Mathematical Problems in Engineering, 2022, 1–21. doi:10.1155/2022/5262248.

Godfray, H. C. J., Crute, I. R., Haddad, L., Muir, J. F., Nisbett, N., Lawrence, D., Pretty, J., Robinson, S., Toulmin, C., & Whiteley, R. (2010). The future of the global food system. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1554), 2769–2777. doi:10.1098/rstb.2010.0180.

Durán, Y., Gómez-Valenzuela, V., & Ramírez, K. (2023). Socio-technical transitions and sustainable agriculture in Latin America and the Caribbean: a systematic review of the literature 2010–2021. Frontiers in Sustainable Food Systems, 7, 1-13. doi:10.3389/fsufs.2023.1145263.

Sharma, R. (2021). Artificial Intelligence in Agriculture: A Review. 2021 5th International Conference on Intelligent Computing and Control Systems (ICICCS), Madurai, India. doi:10.1109/iciccs51141.2021.9432187.

Li, J., Chen, D., Qi, X., Li, Z., Huang, Y., Morris, D., & Tan, X. (2023). Label-efficient learning in agriculture: A comprehensive review. Computers and Electronics in Agriculture, 215, 108412. doi:10.1016/j.compag.2023.108412.

Bharman, P., Ahmad Saad, S., Khan, S., Jahan, I., Ray, M., & Biswas, M. (2022). Deep Learning in Agriculture: A Review. Asian Journal of Research in Computer Science, 13(2), 28–47. doi:10.9734/ajrcos/2022/v13i230311.

Benos, L., Tagarakis, A. C., Dolias, G., Berruto, R., Kateris, D., & Bochtis, D. (2021). Machine learning in agriculture: A comprehensive updated review. Sensors, 21(11), 3758. doi:10.3390/s21113758.

Mukhiddinov, M., Muminov, A., & Cho, J. (2022). Improved Classification Approach for Fruits and Vegetables Freshness Based on Deep Learning. Sensors, 22(21), 8192. doi:10.3390/s22218192.

Dubey, S. R., & Jalal, A. S. (2013). Species and variety detection of fruits and vegetables from images. International Journal of Applied Pattern Recognition, 1(1), 108. doi:10.1504/ijapr.2013.052343.

Tripathi, M. K., & Maktedar, D. D. (2021). Detection of various categories of fruits and vegetables through various descriptors using machine learning techniques. International Journal of Computational Intelligence Studies, 10(1), 36. doi:10.1504/ijcistudies.2021.113819.

Rahmadian, R., & Widyartono, M. (2020). Autonomous Robotic in Agriculture: A Review. 2020 Third International Conference on Vocational Education and Electrical Engineering (ICVEE), Surabaya, Indonesia. doi:10.1109/icvee50212.2020.9243253.

Abubeker, K. M., Akhil, S., VK, A. K., & Jose, B. K. (2023). Computer Vision Assisted Real-Time Bird Eye Chili Classification Using YOLO V5 Framework. Journal of Artificial Intelligence and Technology, 1-13. doi:10.37965/jait.2023.0251.

Habib, Md. T., Raza, D. M., Islam, Md. M., Victor, D. B., & Arif, Md. A. I. (2022). Applications of Computer Vision and Machine Learning in Agriculture: A State-of-the-Art Glimpse. 2022 International Conference on Innovative Trends in Information Technology (ICITIIT). doi:10.1109/icitiit54346.2022.9744150.

Badeka, E., Karapatzak, E., Karampatea, A., Bouloumpasi, E., Kalathas, I., Lytridis, C., Tziolas, E., Tsakalidou, V. N., & Kaburlasos, V. G. (2023). A Deep Learning Approach for Precision Viticulture, Assessing Grape Maturity via YOLOv7. Sensors, 23(19). doi:10.3390/s23198126.

Jiang, P., Ergu, D., Liu, F., Cai, Y., & Ma, B. (2022). A Review of Yolo Algorithm Developments. Procedia Computer Science, 199, 1066–1073. doi:10.1016/j.procs.2022.01.135.

Li, Y., Feng, X., Liu, Y., & Han, X. (2021). Apple quality identification and classification by image processing based on convolutional neural networks. Scientific Reports, 11(1), 16618. doi:10.1038/s41598-021-96103-2.

Xuan, G., Gao, C., Shao, Y., Zhang, M., Wang, Y., Zhong, J., Li, Q., & Peng, H. (2020). Apple Detection in Natural Environment Using Deep Learning Algorithms. IEEE Access, 8, 216772–216780. doi:10.1109/ACCESS.2020.3040423.

Xiao, J.-R., Chung, P.-C., Wu, H.-Y., Phan, Q.-H., Yeh, J.-L. A., & Hou, M. T.-K. (2020). Detection of Strawberry Diseases Using a Convolutional Neural Network. Plants, 10(1), 31. doi:10.3390/plants10010031.

Patil, A., & Lad, K. (2021). Chili Plant Leaf Disease Detection Using SVM and KNN Classification. Rising Threats in Expert Applications and Solutions. Advances in Intelligent Systems and Computing, 1187. Springer, Singapore. doi:10.1007/978-981-15-6014-9_26.

Khalid, M., Sarfraz, M. S., Iqbal, U., Aftab, M. U., Niedbała, G., & Rauf, H. T. (2023). Real-Time Plant Health Detection Using Deep Convolutional Neural Networks. Agriculture (Switzerland), 13(2), 2–16. doi:10.3390/agriculture13020510.

Ahmad, A., Saraswat, D., & El Gamal, A. (2023). A survey on using deep learning techniques for plant disease diagnosis and recommendations for development of appropriate tools. Smart Agricultural Technology, 3, 2772–3775. doi:10.1016/j.atech.2022.100083.

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 (Switzerland), 11(5), 1–13. doi:10.3390/agriculture11050387.

Manish Lad, A., Mani Bharathi, K., Akash Saravanan, B., & Karthik, R. (2022). Factors affecting agriculture and estimation of crop yield using supervised learning algorithms. Materials Today: Proceedings, 62(7), 4629–4634. doi:10.1016/j.matpr.2022.03.080.

Kamilaris, A., & Prenafeta-Boldú, F. X. (2018). Deep learning in agriculture: A survey. Computers and Electronics in Agriculture, 147, 70–90. doi:10.1016/j.compag.2018.02.016.

Solis-Charcopa, K. F., Quiroz-Ponce, F., Vernaza-Quiñonez, L. M., & Carrera-Villacrés, F. (2017). Biofertilizers an ecological alternative for agriculture in the face of climate change in Ecuador. Dominio de Las Ciencias, 3(4), 75–88. doi:10.23857/DOM.CIEN.POCAIP.2017.3.4.OCT.75-88. (In Spanish).

Jacob, A., Edward, E. O., & Yaw, B. O. A. (2016). Efficiency of chili pepper production in the Volta region of Ghana. Journal of Agricultural Extension and Rural Development, 8(6), 99–110. doi:10.5897/jaerd2016.0765.

Ekawaty, Y., Indrabayu, & Areni, I. S. (2019). Automatic Cacao Pod Detection under Outdoor Condition Using Computer Vision. 2019 4th International Conference on Information Technology, Information Systems and Electrical Engineering (ICITISEE). doi:10.1109/icitisee48480.2019.9003733.

Sihombing, Y. F., Septiarini, A., Kridalaksana, A. H., & Puspitasari, N. (2022). Chili Classification Using Shape and Color Features Based on Image Processing. Scientific Journal of Informatics, 9(1), 42–50. doi:10.15294/sji.v9i1.33658.

Pang, F., & Chen, X. (2023). MS-YOLOv5: a lightweight algorithm for strawberry ripeness detection based on deep learning. Systems Science & Control Engineering, 11(1), 1–11. doi:10.1080/21642583.2023.2285292.

Liu, M., Wang, Y., Li, X., Han, W., & Chen, W. (2023). Multi-task Tomato Fruit and Bunch Maturity Detection Approach Based on Improved YOLOv7. 2023 IEEE 9th International Conference on Cloud Computing and Intelligent Systems (CCIS), Dali, China. doi:10.1109/ccis59572.2023.10262866.

Han, W., Hao, W., Sun, J., Xue, Y., & Li, W. (2022). Tomatoes Maturity Detection Approach Based on YOLOv5 and Attention Mechanisms. 2022 IEEE 4th International Conference on Civil Aviation Safety and Information Technology (ICCASIT), Dali, China. doi:10.1109/iccasit55263.2022.9986640.

Yang, Y., Han, Y., Li, S., Li, H., & Zhang, M. (2022). Multi-Growth Period Tomato Fruit Detection Using Improved Yolov5. International Journal of Robotics and Automation Technology, 9, 44–55. doi:10.31875/2409-9694.2022.09.06.

Sun, L., Hu, G., Chen, C., Cai, H., Li, C., Zhang, S., & Chen, J. (2022). Lightweight Apple Detection in Complex Orchards Using YOLOV5-PRE. Horticulturae, 8(12), 1–15. doi:10.3390/horticulturae8121169.

Alharbi, A. G., & Arif, M. (2020). Detection And Classification of Apple Diseases using Convolutional Neural Networks. 2020 2nd International Conference on Computer and Information Sciences (ICCIS), Sakaka, Saudi Arabia. doi:10.1109/iccis49240.2020.9257640.

Sharma, R., & Kukreja, V. (2022). Amalgamated convolutional long term network (CLTN) model for Lemon Citrus Canker Disease Multi-classification. 2022 International Conference on Decision Aid Sciences and Applications, DASA 2022, 326–329. doi:10.1109/DASA54658.2022.9765005.

Jahanbakhshi, A., Momeny, M., Mahmoudi, M., & Zhang, Y. D. (2020). Classification of sour lemons based on apparent defects using stochastic pooling mechanism in deep convolutional neural networks. Scientia Horticulturae, 263, 1–10. doi:10.1016/j.scienta.2019.109133.

Wang, Y., Yang, L., Chen, H., Hussain, A., Ma, C., & Al-gabri, M. (2022). Mushroom-YOLO: A deep learning algorithm for mushroom growth recognition based on improved YOLOv5 in agriculture 4.0. 2022 IEEE 20th International Conference on Industrial Informatics (INDIN), Perth, Australia. doi:10.1109/indin51773.2022.9976155.

Sevilla, W. H., Hernandez, R. M., Ligayo, M. A. D., Costa, M. T., & Quismundo, A. Q. (2022). Machine Vision Recognition System of Edible and Poisonous Mushrooms Using a Small Training Set-Based Deep Transfer Learning. 2022 International Conference on Decision Aid Sciences and Applications (DASA), Chiangrai, Thailand. doi:10.1109/dasa54658.2022.9765046.

Behera, S. K., Rath, A. K., & Sethy, P. K. (2021). Maturity status classification of papaya fruits based on machine learning and transfer learning approach. Information Processing in Agriculture, 8(2), 244–250. doi:10.1016/j.inpa.2020.05.003.

Islam, Md. A., Islam, Md. S., Hossen, Md. S., Emon, M. U., Keya, M. S., & Habib, A. (2020). Machine Learning based Image Classification of Papaya Disease Recognition. 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, India. doi:10.1109/iceca49313.2020.9297570.

Patil, A., & Lad, K. (2022). Feature Selection for Chili Leaf Disease Identification Using GLCM Algorithm. Smart Innovation, Systems and Technologies, 251, 359–365. doi:10.1007/978-981-16-3945-6_35.

Aminuddin, N. F., Joret, A., Zulkifli, S. A., Abdul Kadir, H., Morsin, M., & Tukiran, Z. (2023). Computational Approaches Based on Image Processingfor Automated Disease Identification on Chili Leaf Images: A Review. Emerging Advances in Integrated Technology, 3(2), 11–26. doi:10.30880/emait.2022.03.02.002.

Tan, J., Sutanto, B. C., Marvelim, D., Pratama, G. D., & Hasana, S. (2023). Chili Plant Health Status Classification Using Random Forest. 2023 4th International Conference on Artificial Intelligence and Data Sciences (AiDAS), IPOH, Malaysia. doi:10.1109/aidas60501.2023.10284701.

Anbananthen, K. S. M., Subbiah, S., Baskar, S. G., Selvaraj, R., Krishnan, J., Kannan, S., & Chelliah, D. (2023). The Eye: A Light Weight Mobile Application for Visually Challenged People Using Improved YOLOv5l Algorithm. Emerging Science Journal, 7(5), 1636-1652. doi:10.28991/ESJ-2023-07-05-011.

Cruz-Domínguez, O., Carrera-Escobedo, J. L., Guzmán-Valdivia, C. H., Ortiz-Rivera, A., García-Ruiz, M., Durán-Muñoz, H. A., Vidales-Basurto, C. A., & Castaño, V. M. (2021). A novel method for dried chili pepper classification using artificial intelligence. Journal of Agriculture and Food Research, 3. doi:10.1016/j.jafr.2021.100099.

Aldabbagh, A. D. A., Hairu, C., & Hanafi, M. (2020). Classification of Chili Plant Growth using Deep Learning. 2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), Shah Alam, Malaysia. doi:10.1109/icset51301.2020.9265351.

Saad, W. H. M., Karim, S. A. A., Razak, M. S. J. A., Radzi, S. A., & Yussof, Z. M. (2020). Classification and detection of chili and its flower using deep learning approach. Journal of Physics: Conference Series, 1502. doi:10.1088/1742-6596/1502/1/012055.

Purwaningsih, T., Anjani, I. A., & Utami, P. B. (2018). Convolutional Neural Networks Implementation for Chili Classification. International Symposium on Advanced Intelligent Informatics (SAIN), Yogyakarta, Indonesia. doi:10.1109/sain.2018.8673373.

Ram, P. P. V. S., Yaswanth, K. V. S., Kamepalli, S., Sankar, B. S., & Madupalli, M. (2023). Deep Learning Model YOLOv5 for Red Chilies Detection from Chilly Crop Images. 2023 IEEE 8th International Conference for Convergence in Technology (I2CT), Lonavla, India. doi:10.1109/i2ct57861.2023.10126327.

Yin, L. L., Zainudin, M. N. S., Saad, W. H. M., Sulaiman, N. A., Idris, M. I., Kamarudin, M. R., Mohamed, R., & Razak, M. S. J. A. (2023). Analysis Recognition of Ghost Pepper and Cili-Padi using Mask-RCNN and YOLO. Przeglad Elektrotechniczny, 2023(8), 92–97. doi:10.15199/48.2023.08.15.

Mayalekshmi, K. M., Ranjan, A., & Machavaram, R. (2023). In-field Chilli Crop Disease Detection Using YOLOv5 Deep Learning Technique. 2023 IEEE 8th International Conference for Convergence in Technology (I2CT), Lonavla, India. doi:10.1109/I2CT57861.2023.10126468.

Hing, Y. S., Wan, W. Y., & Nugroho, H. (2021). Objective Tool for Chili Grading Using Convolutional Neural Network and Color Analysis. In Advances in Robotics, Automation and Data Analytics: Selected Papers from iCITES 2020, 315-324. doi:10.1007/978-3-030-70917-4_30.

Ibrahim, M. F., Zainudin, M. S., Idris, M. I., Saad, W. M., Kamarudin, M. R., Sulaiman, N. A., & Mohamed, R. (2023). Detection and Classifying of Chili Fruits Variations using YOLOv5. KZYJC, 38(4), 1363-1376.

Zainudin, M. S., Azlan, M. S., Yin, L. L., Saad, W. M., Idris, M. I., Muhammad, S., & Razak, M. S. J. A. (2022). Analysis on localization and prediction of depth chili fruits images using YOLOv5. International Journal of Advanced Technology and Engineering Exploration, 9(97), 1786. doi:10.19101/IJATEE.2021.876501.

Tan, Z., Chen, B., Sun, L., Xu, H., Zhang, K., & Chen, F. (2023). Pepper Target Recognition and Detection Based on Improved YOLO v4. Information Technology and Control, 52(4), 878–886. doi:10.5755/j01.itc.52.4.34183.

Hespeler, S. C., Nemati, H., & Dehghan-Niri, E. (2021). Non-destructive thermal imaging for object detection via advanced deep learning for robotic inspection and harvesting of chili peppers. Artificial Intelligence in Agriculture, 5, 102–117. doi:10.1016/j.aiia.2021.05.003.

Manan, A. A. A., Razman, M. A. M., Khairuddin, I. M., & Shapiee, M. N. A. (2020). Chili Plant Classification using Transfer Learning models through Object Detection. Mekatronika, 2(2), 23-27. doi:10.1007/978-981-19-2095-0_46.

Sudianto, Herdiyeni, Y., Haristu, A., & Hardhienata, M. (2020). Chilli Quality Classification using Deep Learning. 2020 International Conference on Computer Science and Its Application in Agriculture (ICOSICA), Bogor, Indonesia. doi:10.1109/icosica49951.2020.9243176.

Xu, R., Lin, H., Lu, K., Cao, L., & Liu, Y. (2021). A forest fire detection system based on ensemble learning. Forests, 12(2), 217. doi:10.3390/f12020217.

Wang, C.-Y., Mark Liao, H.-Y., Wu, Y.-H., Chen, P.-Y., Hsieh, J.-W., & Yeh, I.-H. (2020). CSPNet: A New Backbone that can Enhance Learning Capability of CNN. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), Seattle, United States. doi:10.1109/cvprw50498.2020.00203.

Wang, K., Liew, J. H., Zou, Y., Zhou, D., & Feng, J. (2019). PANet: Few-Shot Image Semantic Segmentation with Prototype Alignment. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Korea (South). doi:10.1109/iccv.2019.00929.

Ren, S., He, K., Girshick, R., & Sun, J. (2017). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6), 1137–1149. doi:10.1109/TPAMI.2016.2577031.

Aishwarya, N., Manoj Prabhakaran, K., Debebe, F. T., Reddy, M. S. S. A., & Pranavee, P. (2023). Skin Cancer diagnosis with Yolo Deep Neural Network. Procedia Computer Science, 220, 651–658. doi:10.1016/j.procs.2023.03.083.

Full Text: PDF

DOI: 10.28991/ESJ-2024-08-02-08


  • There are currently no refbacks.

Copyright (c) 2024 Viviana Isabel Moya, Angélica Quito, Christian Vargas, Juan Pablo Vásconez, Andrea Pilco