Fruit Ripeness Detection Using a YOLO-Based Machine Learning Framework (Comprehensive Journal of Science, 2026)
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.