APPLE FRUIT QUALITY DETECTION (GOOD AND ROTTEN) USING THE YOLOV5 METHOD

 Fathir Adisyar, Mohamad Ilyas Abas, Widya Eka Pranata, Rizal Lamusu, Syahrial Syahrial, Irawan Ibrahim

Abstract


Fruit quality is an important factor that affects nutritional value, consumption safety, and market value of agricultural products. Apples, as one of the most widely consumed fruits, are prone to quality degradation due to spoilage, which is often difficult to accurately identify through human visual observation. Manual sorting of apples is subjective, time-consuming, and prone to errors. Therefore, this study aims to develop an automatic apple quality detection and classification system using the You Only Look Once version 5 (YOLOv5) deep learning method. Apple quality is classified into two categories, namely fresh apples and rotten apples, based on digital images. The dataset used in this study consists of 4,035 images obtained from the Roboflow platform, comprising 2,925 training images, 707 validation images, and 403 testing images. All images were resized to 640 × 640 pixels without data augmentation. The model was trained for 50 epochs using GPU acceleration on Google Colab. Model performance was evaluated using a confusion matrix on the testing dataset. The experimental results show that the YOLOv5 model successfully classified all testing images correctly without any misclassification, indicating excellent detection and classification performance. These results demonstrate that YOLOv5 is an effective and reliable method for automatic apple quality detection and has strong potential for application in agriculture and the food industry to improve efficiency and accuracy in fruit quality inspection.

Full Text:

PDF

References


T. Zhang and M. Mhamed, “Apple varieties , diseases , and distinguishing between fresh and rotten through deep learning approaches,” pp. 1–26, 2025, doi: 10.1371/journal.pone.0322586.

B. Xu, X. Cui, W. Ji, H. Yuan, and J. Wang, “Apple Grading Method Design and Implementation for Automatic Grader Based on Improved YOLOv5,” 2023.

L. Lusiana, A. Wibowo, and K. Dewi, “Vol . 11 No . 1 , Bulan Maret Tahun 2023 Implementasi Algoritma Deep

Learning You Only Look Once ( YOLOv5 ) Untuk Deteksi Buah Segar Dan Busuk,” vol. 11, no. 1, pp. 123–130, 2023.

E. Aenun, N. Munfaati, and A. Witanti, “Klasifikasi Buah dan Sayuran Segar atau Busuk Menggunakan Convolutional Neural Network,” vol. 9, no. 1, pp. 27–38, 2024.

D. C. Agustin, M. A. Rosid, and N. Ariyanti, “IMPLEMENTASI CONVOLUTIONAL NEURAL NETWORK UNTUK DETEKSI KESEGARAN PADA APEL,” vol. 13, no. 2, pp. 145–150, 2023.

A. Technology, “Apple Detection Using Filters Under Varying Lighting Conditions,” 2025.

X. Ren and J. Wang, “Research on Improved Apple Quality Detection based on Yolov5 Model,” vol. 9, no. 4, pp. 257– 261, 2023, doi: 10.6919/ICJE.202304.

Y. Xue, “YOLO Models for Fresh Fruit Classification from Digital Videos,” 2023.

G. Hu et al., “Infield Apple Detection and Grading Based on Multi-Feature Fusion,” 2021.

P. F. Valdez, “A PPLE DEFECT DETECTION USING D EEP L EARNING -,” no. 2017, pp. 1–5, 2020.

L. Lv, Y. Yilihamu, and Y. Ye, “Apple surface defect detection based on lightweight improved Apple surface defect

detection based on lightweight improved YOLOv5s Lijun Lv , Yaermaimaiti Yilihamu * and Yalin Ye,” no. June, 2024.

D. Klasifikasi, B. Segar, and D. A. N. Busuk, “Penggunaan algoritma random forest dalam klasifikasi buah segar dan busuk,” vol. 3, no. 1, pp. 133–140, 2022.

N. N. Models, “Classification of Tomato Fruit Using Yolov5 and Convolutional Neural Network Models,” pp. 1–15

W. Hong and B. Lin, “Extraction and Recognition of Robotic Apple Picking Image Features Based on YOLOv5 Detection Models,” pp. 0–17, 2024.

R. Yang, Y. Hu, Y. Yao, M. Gao, and R. Liu, “Fruit Target Detection Based on BCo-YOLOv5 Model,” vol. 2022, 2022, doi: 10.1155/2022/8457173.

G. Xuan et al., “Apple Detection in Natural Environment Using Deep Learning Algorithms,” vol. 8, 2020, doi: 10.1109/ACCESS.2020.3040423.

O. M. Lawal, S. Zhu, and K. Cheng, “An improved YOLOv5s model using feature concatenation with attention mechanism for real- time fruit detection and counting,” no. June, pp. 1–11, 2023, doi: 10.3389/fpls.2023.1153505.

U. T. Pembangunan and U. S. Maret, “Journal of Applied Agricultural Science and Technology,” vol. 9, no. 1, pp. 40– 52, 2025.

F. Amirah, A. Aqsa, A. Ab, I. Hamiza, and A. M. Asmawi, “Enhancing Fruit Quality Assessment : A Real-Time Grading System Based on YOLO and Image Processing,” vol. 37, no. 7, pp. 3421–3430, 2025.

“S0168169922000321.”

R. G. Wijanarko, A. I. Pradana, and D. Hartanti, “IMPLEMENTASI DETEKSI DRONE MENGGUNAKAN YOLO (

You Only Look Once ),” vol. 14, no. 2, pp. 437–442, 2024.

B. Seshakagari, H. Reddy, and R. V. L. Jayasree, “Enhancing Apple Fruit Quality Detection with Augmented YOLOv3 Deep Learning Algorithm,” pp. 386–396, 2025, doi: 10.5281/zenodo.14998944.

Z. Cove and L. Voska, “Enhanced Apple Quality Detection Algorithm Based on Improved YOLOv5 with Coordinate Attention Mechanism,” vol. 4, no. 2, 2025.

X. Liang et al., “Real-Time Grading of Defect Apples Using Semantic Segmentation Combination with a Pruned YOLO V4 Network,” 2022.

Abas MI, Syarif S, Nurtanio I, Tahir Z. Detection of corn plant diseases using convolutional neural network: A review. AIP Conf Proc [Internet]. 2024 Jul 23;2952(1):40001. Available from: https://doi.org/10.1063/5.0211960.

S. N. Appe, G. Arulselvi, and B. Gn, “CAM-YOLO : tomato detection and classification based on improved YOLOv5 using combining attention mechanism,” pp. 1–18, 2023, doi: 10.7717/peerj-cs.1463.

J. Liu, “Apple orchard visual inspection based on YOLOv5,” no. November 2024, 2026, doi: 10.1145/3718751.3718816.


DOI: http://dx.doi.org/10.31314/juik.v6i1.5539

Article metrics

Abstract views : 144 | views : 84

Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 Jurnal Ilmu Komputer (JUIK)

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.