Automated fruit sorting system integrating image processing and support vector machine techniques

Traditional fruit grading methods are mostly time-consuming and subjective, thereby limiting efficiency in the agricultural sector. To address these problems, this paper presents the design and implementation of an automated fruit sorting system for classifying certain fruits, namely oranges, tomatoes, and mangoes, using image processing and support vector machine (SVM) techniques. An ESP32 camera was used to capture images of the fruits, which were later passed through algorithms in Python. Extracted features were then fed into a SVM model for the classification process of fruits. The model demonstrated excellent performance, achieving an accuracy of 100%, a precision of 96%, a recall of 92%, and an F1 score of 89%. The results indicated that incorporating multiple features significantly increases the accuracy of the classification. Moreover, the performance was optimized by selecting an appropriate regularization parameter during the training of the model and the use of polynomial kernel functions. Finally, the whole automated system was assembled to physically sort the classified fruits into different containers. This research highlights the potential of integrating image processing and machine learning technologies to revolutionize fruit classification processes, thereby improving both efficiency and quality control in agriculture.

- Ibeawuchi II, Okoli NA, Alagba RA, et al. Fruit and vegetable crop production in Nigeria: The gains, challenges and the way forward. J Biol Agric Healthc. 2015;5:194-208.
- Tian H, Wang T, Liu Y, Qiao X, Li Y. Computer vision technology in agricultural automation-a review. Inf Process Agric. 2020;7(1):1-19. doi: 10.1016/j.inpa.2019.09.006
- Li D, Song Z, Quan C, Xu X, Liu C. Recent advances in image fusion technology in agriculture. Comput Electron Agr. 2021;191:106491. doi: 10.1016/j.compag.2021.106491
- Gupta S, Tripathi AK. Fruit and vegetable disease detection and classification: Recent trends, challenges, and future opportunities. Eng Appl Artif Intell. 2024;133:108260. doi: 10.1016/j.engappai.2024.108260
- Kaushal S, Tammineni DK, Rana P, Sharma M, SridharK, Chen H. Computer vision and deep learning-based approaches for detection of food nutrients/nutrition: New insights and advances. Trends Food Sci Technol. 2024;146:104408. doi: 10.1016/j.tifs.2024.104408
- Pauzi NAM, Mustaza SM, Zainal N, Zaman MHM, Moubark AM. Artificial Intelligence in precision agriculture: A review. J Kejuruter. 2025;37(2):1025-1047. doi: 10.17576/jkukm-2025-37(2)-38
- Iano Y. Image processing-based via agridrones for agriculture fields. In: Intelligent Designs, Innovations and Sustainability in Agriculture 4.0. United States: CRC Press; 2025. p. 214. doi: 10.1201/9781003380801
- Amin R, Amin S. Machine learning techniques for increasing the productivity of high-quality food products. In: Artificial Intelligence in the Food Industry. United States: CRC Press; 2025. p. 239-259. doi: 10.1201/9781032633602
- Kheiralipour K, Kazemi A. A new method to determine morphological properties of fruits and vegetables by image processing technique and non-linear multivariate modeling. Int. J. Food Prop. 2020;23(1):368-374. doi: 10.1080/10942912.2020.1729177
- Han B, Lu Z, Dong L, Zhang J. Lightweight non-destructive detection of diseased apples based on structural re-parameterization technique. Appl Sci. 2023;14(5):1907. doi: 10.3390/app14051907
- Wang W, Zhu A, Wei H, Yu L. A novel method for vegetable and fruit classification based on using diffusion maps and machine learning. CRFS. 2024;8:100737. doi: 10.1016/j.crfs.2024.100737
- Shen C, Wang R, Nawazish H, Wang B, Cai K, Xu B. Machine vision combined with deep learning-based approaches for food authentication: An integrative review and new insights. Compr Rev Food Sci Food Saf. 2024;23(6):e70054. doi: 10.1111/1541-4337.70054
- Usman U, Yunita F, Ridha MR. Improving classification accuracy of local coconut fruits with image augmentation and deep learning algorithm convolutional neural networks (CNN). JADS. 2025;6(1):1-19. doi: 10.47738/jads.v6i1.389
- Safari Y, Nakatumba-Nabende J, Nakasi R, NakibuuleR. A Review on automated detection and assessment of fruit damage using machine learning. IEEE Access. 2024;12:21358- 21381. doi: 10.1109/ACCESS.2024.3362230
- Anjali JA, Bamola A, Mishra S, et al. State-of-the-art non-destructive approaches for maturity index determination in fruits and vegetables: Principles, applications, and future directions. Food Prod Process Nutr. 2024;6(1):56. doi: 10.1186/s43014-023-00205-5
- Ercan U, Kabas O, Kabaş A, Moiceanu G. Classification of dragon fruit varieties based on morphological properties: Multi-class classification approach. Sustainability. 2024;17(6):2629. doi: 10.3390/su17062629
- Barbosa JMR, Santos RGD, Sales LDA, Vargas RBS, Deltsidis A, Oliveira LPD. Image-based and ML-driven analysis for assessing blueberry fruit quality. Heliyon. 2025;11(3):e42288. doi: 10.1016/j.heliyon.2025.e42288
- Pathare PB, Opara UL, editors. Mechanical Damage in Fresh Horticultural Produce: Measurement, Analysis and Control. Germany: Springer Nature; 2024. doi: 10.1007/978-981-99-7096-4
- Hofman PJ, Bower J, Woolf A, Defilippi BG, Olivares D, García-Rojas M. Harvesting, packing, postharvest technology, transport and processing. In: The Avocado: Botany, Production and Uses. United Kingdom: CABI; 2024. p. 622-683. doi: 10.1079/9781800621824.0015
- Khatun T, Nirob MAS, Bishshash P, Akter M, Uddin MS. A comprehensive dragon fruit image dataset for detecting the maturity and quality grading of dragon fruit. Data in Brief. 2024;52:109936. doi: 10.1016/j.dib.2023.109936
- Dutta SK, Bhutia B, Misra T, Mishra VK, Singh SK, Patel VB. Application and prospects of artificial intelligence (AI)-based technologies in fruit production systems. Appl Fruit Sci. 2025;67(1):1-18. doi: 10.1007/s10341-024-01223-4
- Supekar AD, Wakode M. Multi-parameter based mango grading using image processing and machine learning techniques. NFOCOMP JCS. 2020;19(2):175-187.
- Worasawate D, Sakunasinha P, Chiangga S. Automatic classification of the ripeness stage of mango fruit using a machine learning approach. AgriEngineering. 2022;4(1):32-47. doi: 10.3390/agriengineering4010003
- Doan TN, Le-Thi DN. A Novel mango grading system based on image processing and machine learning methods. IJACSA. 2023;14(5):1118-1129. doi: 10.14569/IJACSA.2023.01405115
- Tripathi MK, Neelakantappa M, Mahalle PN, Channapattana SV, Deshmukh G, Prashant G. Detection and classification of mango fruit-based on feature extraction applying optimized hybrid LA-FF algorithms. In: Data-Centric Artificial Intelligence for Multidisciplinary Applications. Boca Raton, FL, USA: Chapman and Hall/CRC; 2024. p. 177-185. doi: 10.1201/9781003461500
- Kiran PR, Aradwad P, Arunkumar TV, Parray RA. Enhancing mango quality control: A novel approach to spongy tissue inspection through image clustering and machine learning models via X-ray imaging. J. Food Process Eng. 2024;47(6):e14664. doi: 10.1111/jfpe.14664
- Azeez TB. An automatic mango quality grading system in smart agriculture using novel adaptive feature vector and ensemble learning. Multimed Tools Appl. 2025;84:1-26. doi: 10.1007/s11042-025-20688-3
- Siddiquee A, Islam MS, Ud Dowla MY, Rezaul KM, Grout V. Detection, quantification and classification of ripened tomatoes: A comparative analysis of image processing and machine learning. IET Image Processing. 2020;14(11):2442-2456. doi: 10.1049/iet-ipr.2019.0738
- Ropelewska E, Piecko J. Discrimination of tomato seeds belonging to different cultivars using machine learning. Eur Food Res Technol. 2022;248:685-705. doi: 10.1007/s00217-021-03920-w
- Bai Y, Mao S, Zhou J, Zhang B. Clustered tomato detection and picking point location using machine learning-aided image analysis for automatic robotic harvesting. Precis Agric. 2023;24(2):727-743. doi: 10.1007/s11119-022-09972-6
- Vo HT, Mui KC, Thien NN, Tien PP. Automating tomato ripeness classification and counting with YOLOv9. Int J Adv Comput Sci Appl. 2024;15(4):1120-1128.
- Moya V, Quito A, Pilco A, Vásconez JP, Vargas C. Crop detection and maturity classification using a yolov5-based image analysis. Emerg Sci J. 2024;8(2):496-512. doi: 10.28991/ESJ-2024-08-02-08
- Bhargava A, Bansal A. Automatic detection and grading of multiple fruits by machine learning. Food Anal Methods. 2020;13:751-761. doi: 10.1007/s12161-019-01690-6
- Ismail N, Malik OA. Real-time visual inspection system for grading fruits using computer vision and deep learning techniques. Inf Process Agric. 2022;9(1):24-37. doi: 10.1016/j.inpa.2021.01.005
- Chakraborty SK, Subeesh A, Dubey K, et al. Development of an optimally designed real-time automatic citrus fruit grading-sorting machine leveraging computer vision-based adaptive deep learning model. Eng Appl Artif Intell. 2023;120:105826. doi: 10.1016/j.engappai.2023.105826
- Raza SM, Raza A, Babeker MIA, Haq ZU, Islam MA, Li S. Efficient citrus fruit image classification via a hybrid hierarchical CNN and transfer learning framework. J Food Meas Charact. 2025;19(1):356-377. doi: 10.1007/s11694-024-02973-1
- Huong PT, Hien LT, Son NM, Tuan HC, Nguyen TQ. Enhancing deep convolutional neural network models for orange quality classification using MobileNetV2 and data augmentation techniques. J Algorithms Comput Technol. 2025;19:1-22. doi: 10.1177/17483026241309070
- Lord M. Validation of an invariant embedding method for Fredholm integral equations. Appl Math Comput. 1980;7(1):1-7. doi: 10.1016/0096-3003(80)90030-2
- Nantomah K, Ege I. A lambda analogue of the gamma function and its properties. Res Math. 2022;30(2):18-29. doi: 10.15421/242209
- Coulembier K. Homological kernels of monoidal functors. Sel Math New Ser. 2023;29(2):24. doi: 10.1007/s00029-023-00829-y
- Singh P, Singh N, Singh KK, Singh A. Diagnosing of disease using machine learning. In: Machine Learning and the Internet of Medical Things in Healthcare. United States: Academic Press; 2020. p. 89-111. doi: 10.1016/B978-0-12-821229-5.00003-3
- Obi JC. A comparative study of several classification metrics and their performances on data. WJAETS. 2023;8(1):308-314. doi: 10.30574/wjaets.2023.8.1.0054
- Sathyanarayanan S, Tantri BR. Confusion matrix-based performance evaluation metrics. Afr J Biomed Res. 2024;27:4023-4031. doi: 10.53555/AJBR.v27i4S.4345
- Humphrey A, Kuberski W, Bialek J, et al. Machine-learning classification of astronomical sources: estimating F1-score in the absence of ground truth. MNRAS Lett. 2022;517(1):L116-L120. doi: 10.1093/mnrasl/slac120
- Chithra PL, Henila M. Fruits classification using image processing techniques. IJCSE. 2019;7(5):131-135. doi: 10.26438/ijcse/v7si5.131135
- Naskar S, Bhattacharya T. A fruit recognition technique using multiple features and artificial neural network. Int J Comput Appl. 2015;116:20. doi: 10.5120/20453-2808
- Bahaghighat M, Abedini F, S’hoyan M, Molnar AJ. Vision inspection of bottle caps in drink factories using convolutional neural networks. In: 2019 IEEE 15th International Conference on Intelligent Computer Communication and Processing (ICCP). United States: IEEE; 2019. p. 381-385. doi: 10.1109/ICCP48234.2019.8959737
- Yekkehkhany B, Safari A, Homayouni S, Hasanlou M. A comparison study of different kernel functions for SVM-based classification of multi-temporal polarimetry SAR data. ISPRS Arch. 2014;40:281-285. doi: 10.5194/isprsarchives-XL-2-W3-281-2014, 2014