journal article·2025-11-07Open access

Automatic Fruit Grading System with High Adaptability Using Machine Learning Method

Peixian Zhang, Xiuhong Li

Applied Sciences· Volume 15· Issue 22

Abstract

Fruit quality plays an important role in the agricultural economy. However, low efficiency and inaccurate detection in manual fruit grading has led to reduced fruit quality assurance. To solve these problems, an automatic fruit grading system for several kinds of fruits based on ML is proposed. In this research, four kinds of fruit are rapidly divided into three grades, depending on this automatic fruit grading system, through three steps. Firstly, the features with a large impact on fruit grading are extracted from fruit—the texture, shape, color, size, and defects. Then, the extracted fruit features are input into a Random Forest algorithm to train the fruit grading model. Finally, the grades of four kinds of fruit are predicted by this fruit grading model. The dataset contained 666 images from Kaggle of purchased fruit, including 270 images of apples, 170 images of pomegranates, 114 images of oranges, and 112 images of loquats. A 70% training set and 30% testing set split was used, and a ten-fold cross-validation (ten-fold CV) strategy was employed to evaluate the model. The experimental results show that the RF algorithm demonstrates the best stability and accuracy in classifying the four types of fruit, with accuracies of 98.6%, 95.3%, 98.1%, and 99.1% for apples, loquats, pomegranates, and oranges, respectively. Compared with other ML methods, RF performed the best in the multi-fruit classification task.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Smart Agriculture and AI · Spectroscopy and Chemometric Analyses · Plant Disease Management Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Digital Art Industry, Hubei University of Technology, Wuhan 430068, China

Hubei Key Laboratory of Modern Manufacturing Qualtity Engineering, School of Mechanical Engineering, Hubei University of Technology, Wuhan 430068, China

Funding

Natural Science Foundation of Hubei Province of China · National Natural Science Foundation of China · Doctoral Scientific Research Foundation of Hubei University of Technology · Hubei Key Laboratory of Modern Manufacturing Quality Engineering Foundation

References (29)

Show source-provided references
1. Grading and sorting technique of dragon fruits using machine learning algorithms
2. AEGD: Arabic essay grading dataset for machine learning
3. Tarbă, N., Boiangiu, C.-A., and Voncilă, M.-L. (2025). State-of-the-Art Document Image Binarization Using a Decision Tree Ensemble Trained on Classic Local Binarization Algorithms and Image Statistics. Appl. Sci., 15.10.3390/app15158374 ↗
4. Bai, X., Li, Z., Li, W., Zhao, Y., Li, M., Chen, H., Wei, S., Jiang, Y., Yang, G., and Zhu, X. (2021). Comparison of machine-learning and casa models for predicting apple fruit yields from time-series planet imageries. Remote Sens., 13.10.3390/rs13163073 ↗
5. Fruit spirits fingerprint pointed out through artificial intelligence and FT-Raman spectroscopy10.1016/j.foodcont.2021.108630 ↗
6. Automatic classification of the ripeness stage of mango fruit using a machine learning approach10.3390/agriengineering4010003 ↗
7. Machine learning–based detection and sorting of multiple vegetables and fruits10.1007/s12161-021-02086-1 ↗
8. Mo, Y., Bai, S., and Chen, W. (2025). ASHM-YOLOv9: A Detection Model for Strawberry in Greenhouses at Multiple Stages. Appl. Sci., 15.10.3390/app15158244 ↗
9. Hu, G., Zhang, E., Zhou, J., Zhao, J., Gao, Z., Sugirbay, A., Jin, H., Zhang, S., and Chen, J. (2021). Infield apple detection and grading based on multi-feature fusion. Horticulturae, 7.10.3390/horticulturae7090276 ↗
10. Classification and grading of multiple varieties of apple fruit10.1007/s12161-021-01970-0 ↗
11. Efficient fruit grading system using spectrophotometry and machine learning approaches10.1109/JSEN.2021.3075465 ↗
12. Automated fruit grading using optimal feature selection and hybrid classification by self-adaptive chicken swarm optimization: Grading of mango10.1007/s00521-021-06473-x ↗
13. A Review of External Quality Inspection for Fruit Grading Using CNN Models
14. An Intelligent Multi-Modal Neural Framework for Accurate Fruit Grading Localization and Yield Estimation10.1016/j.eswa.2024.126366 ↗
15. Song, J.-Y., Qin, Z.-S., Xue, C.-W., Bian, L.-F., and Yang, C. (2024). Fruit Grading System by Reconstructed 3D Hyperspectral Full-Surface Images. Postharvest Biol. Technol., 212.10.1016/j.postharvbio.2024.112898 ↗
16. FruitVision: A Deep Learning Based Automatic Fruit Grading System10.1515/opag-2022-0276 ↗
17. Vision based volume estimation method for automatic mango grading system10.1016/j.biosystemseng.2020.08.021 ↗
18. Electronic-nose applications for fruit identification, ripeness and quality grading10.3390/s150100899 ↗
19. Qu, H., Xiang, R., Obsie, E.Y., Wei, D., and Drummond, F. (2021). Parameterization and calibration of wild blueberry machine learning models to predict fruit-set in the northeast china bog blueberry agroecosystem. Agronomy, 11.10.3390/agronomy11091736 ↗
20. An Automated Tomato Maturity Grading System Using Transfer Learning Based AlexNet10.18280/isi.260206 ↗
21. Real-time visual inspection system for grading fruits using computer vision and deep learning techniques
22. Albarrak, K., Gulzar, Y., Hamid, Y., Mehmood, A., and Soomro, A.B. (2022). A deep learning-based model for date fruit classification. Sustainability, 14.10.3390/su14106339 ↗
23. Color, flavor, texture, and nutritional quality of fresh-cut fruits and vegetables: Desirable levels, instrumental and sensory measurement, and the effects of processing10.1080/10408391003626322 ↗
24. Machine vision technology for detecting the external defects of fruits—A review10.1179/1743131X14Y.0000000088 ↗
25. A comparison of random forest variable selection methods for classification prediction modeling10.1016/j.eswa.2019.05.028 ↗
26. Machine Vision and Machine Learning based Fruit Quality Monitoring
27. Implementation of transfer learning using VGG16 on fruit ripeness detection
28. Vgg16 transfer learning architecture for salak fruit quality classification10.31315/telematika.v18i1.4025 ↗
29. Dates Fruit Recognition: From Classical Fusion to Deep Learning10.32604/csse.2022.017931 ↗