Fruit Ripeness Detection Using a YOLO-Based Machine Learning Framework
DOI:
https://doi.org/10.65405/ptwzd630الملخص
Accurately and efficiently assessing fruit ripeness is crucial for optimising harvesting, reducing post-harvest losses, and ensuring consistent product quality. This study introduces a robust fruit ripeness detection framework based on the You Only Look Once (YOLO) architecture, combining real-time object detection with ripeness classification. A dataset covering multiple fruit types, including apples, bananas, and tomatoes, was created and annotated across four ripeness stages: unripe, partially ripe, ripe, and rotten. To enhance model robustness under varying lighting, occlu- sion, and background conditions, extensive data augmentation and preprocessing techniques were applied. The YOLO-based model achieved strong performance, with a mean Average Precision (mAP) of 96.4%, precision of 95.7%, recall of 94.8%, and an overall ripeness classification accuracy of 96.1%. Comparisons with YOLOv3 and YOLOv5 variants demonstrated that YOLOv8 offered the highest detection and classification accuracy while maintaining low inference latency, making it suitable for real-time deployment in both field and greenhouse environments. Qualitative tests also confirmed reliable detection under complex lighting and background scenarios. This framework holds particular promise for application in Libya, where agriculture is a key sector of the economy. By enabling fast, objective, and consistent assessment of fruit quality, the system supports the modernisation of Libyan agriculture and contributes to improved productivity, sustainability, and post-harvest management. Integrating detection and classification into a unified, real-time system offers a scalable solution for smart farming, yield optimisation, and quality control.
التنزيلات
المراجع
[1] M Wankhade and UW Hore. “A survey on fruit ripeness classification Based on image processing with machine learning”. In: International Journal of Advanced Research in Science, Communi- cation and Technology 5.1 (2021), pp. 73–78.
[2] Mohamad Haniff Junos and Anis Salwa Mohd Khairuddin. “YOLO-MMS for aerial object de- tection model based on hybrid feature extractor and improved multi-scale prediction”. In: The Visual Computer 41.7 (2025), pp. 4759–4778.
[3] Siti Nur Aisyah Binti Mohd Robi, Mohd Azri Bin Mohd Izhar, Norulhusna Binti Ahmad, et al. “Image detection and classification of oil palm fruit bunches”. In: 2022 4th International Conference on Smart Sensors and Application (ICSSA). IEEE. 2022, pp. 108–113.
[4] Chengjuan Wan, Yuxuan Pang, and Shanzhen Lan. “Overview of yolo object detection algo- rithm”. In: International Journal of Computing and Information Technology 2.1 (2022), pp. 11– 11.
[5] Xiaohan Cong et al. “A review of YOLO object detection algorithms based on deep learning”. In: Frontiers in Computing and Intelligent Systems 4.2 (2023), pp. 17–20.
[6] Rifki Rosada, Zidane Muhammad Hussein, and Ledya Novamizanti. “Evaluating YOLO Variants for Real-Time Multi-Object Detection of Strawberry Quality and Ripeness”. In: 2025 IEEE In- ternational Conference on Industry 4.0, Artificial Intelligence, and Communications Technology (IAICT). IEEE. 2025, pp. 483–490.
[7] Seetharam Nagesh Appe, G Arulselvi, and GN Balaji. “CAM-YOLO: tomato detection and classification based on improved YOLOv5 using combining attention mechanism”. In: PeerJ Computer Science 9 (2023), e1463.
[8] Dito Eka Cahya et al. “Ripeness classification of cavendish bananas using multi-object detection approach”. In: 2023 International Conference on Radar, Antenna, Microwave, Electronics, and Telecommunications (ICRAMET). IEEE. 2023, pp. 146–151.
[9] Zhaobo Huang et al. “ORD-YOLO: A Ripeness Recognition Method for Citrus Fruits in Complex Environments”. In: Agriculture 15.15 (2025), p. 1711.
[10] Wenyuan Huang et al. “AITP-YOLO: improved tomato ripeness detection model based on mul- tiple strategies”. In: Frontiers in Plant Science 16 (2025), p. 1596739.
[11] ALfordaga, M., & Omer, A. I. (2026). Real-Time Requirements Analysis in Smart Healthcare Monitoring Systems: A Case Study of an ATmega328P-Based Health Monitoring Device. Al-Farooq Journal of Sciences, 2(3), 1216-1236.
[12] Mohamad Haniff Junos et al. “Improved hybrid feature extractor in lightweight convolutional neural network for postharvesting technology: automated oil palm fruit grading”. In: Neural Computing and Applications 36.32 (2024), pp. 20473–20491.
[13] Wenbai Chen et al. “MTD-YOLO: Multi-task deep convolutional neural network for cherry tomato fruit bunch maturity detection”. In: Computers and Electronics in Agriculture 216 (2024),
p. 108533.
[14] Zewen Xie et al. “A lightweight deep learning semantic segmentation model for optical-image- based post-harvest fruit ripeness analysis of sugar apples (Annona squamosa)”. In: Agriculture
14.4 (2024), p. 591.
[15] Bo-Jin Chen et al. “AFBF-YOLO: An Improved YOLO11n Algorithm for Detecting Bunch and Maturity of Cherry Tomatoes in Greenhouse Environments”. In: Plants 14.16 (2025), p. 2587.
[16] Jun Yuan et al. “Deployment of CES-YOLO: An Optimized YOLO-Based Model for Blueberry Ripeness Detection on Edge Devices”. In: Agronomy 15.8 (2025), p. 1948.
[17] Nada Theyab Alharbi et al. “Deep Learning Approach for Classifying Date Fruits Using YOLO: A Comparative Analysis”. In: 2024 17th International Conference on Development in eSystem Engineering (DeSE). IEEE. 2024, pp. 503–508.
[18] Aichen Wang et al. “NVW-YOLOv8s: An improved YOLOv8s network for real-time detection and segmentation of tomato fruits at different ripeness stages”. In: Computers and Electronics in Agriculture 219 (2024), p. 108833.
[19] Joseph Redmon and Ali Farhadi. “Yolov3: An incremental improvement”. In: arXiv preprint arXiv:1804.02767 (2018).
[20] Joseph Redmon et al. “You only look once: Unified, real-time object detection”. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2016, pp. 779–788.
[21] Zihan Ni et al. “LIGHT YOLO for high-speed gesture recognition”. In: 2018 25th IEEE Inter- national Conference on Image Processing (ICIP). IEEE. 2018, pp. 3099–3103.
[22] Hazem Ashor Amran Abolholl, Tom-Robin Teschner, and Irene Moulitsas. “Surface line inte- gral convolution-based vortex detection using computer vision”. In: Journal of Computing and Information Science in Engineering 23.5 (2023), p. 051002.
[23] Sonay Duman, Abdullah Elewi, and Zeki Yetgin. “Distance estimation from a monocular camera using face and body features”. In: Arabian Journal for Science and Engineering 47.2 (2022),
pp. 1547–1557.
[24] Qiwei Wang et al. “Deep learning approach to peripheral leukocyte recognition”. In: PloS one
14.6 (2019), e0218808.
[25] Zhang Yi, Shen Yongliang, and Zhang Jun. “An improved tiny-yolov3 pedestrian detection al- gorithm”. In: Optik 183 (2019), pp. 17–23.
[26] Ning Lv, Jian Xiao, and Yujing Qiao. “Object detection algorithm for surface defects based on a novel YOLOv3 model”. In: Processes 10.4 (2022), p. 701.
[27] Jesse Davis and Mark Goadrich. “The relationship between Precision-Recall and ROC curves”. In: Proceedings of the 23rd international conference on Machine learning. 2006, pp. 233–240.
[28] Agila, F. E. S. (2026). Insecticidal effectiveness of seed and leaf oil extract of neem (Azadirachta indica) against larvae and adults of Anopheles stephensi. Al-Farooq Journal of Sciences, 2(3), 429-441.
[29] Shahzad Ali Khan and Zeeshan Ali Rana. “Evaluating performance of software defect predic- tion models using area under precision-Recall curve (AUC-PR)”. In: 2019 2nd International Conference on Advancements in Computational Sciences (ICACS). IEEE. 2019, pp. 1–6.
[30] Simon Edstr¨om. Object detection for autonomous trash and litter collection. 2022.
[31] Pengjun Xiang et al. “FFTCA: a Feature Fusion Mechanism Based on Fast Fourier Transform for Rapid Classification of Apple Damage and Real-Time Sorting by Robots”. In: Food and Bioprocess Technology 18.2 (2025), pp. 1631–1655.











