Development of a computer vision system based on a convolutional neural network for automated sorting of apple fruits
https://doi.org/10.31676/0235-2591-2026-2-48-59
Abstract
This article presents a smart system for automated sorting of apple fruits based on YOLO convolutional neural network architectures. A software package that integrates detection, instance segmentation, object tracking, and real-time fruit quality analysis has been developed. The system, implemented in Python using OpenCV, PyQt5, NumPy, and other libraries, supports video stream processing from industrial conveyor lines. A comparative study of the YOLO12s (for detection) and YOLO11m-seg (for segmentation) models was conducted using such key metrics as Precision, Recall, mAP, F1-score, MOTA, IDF1, and FPS. The analysis of experimental data established the following optimal operating modes: for YOLO12s, conveyor speed up to 0.18 m/s at MOTA > 0.75 and FPS ≈ 38 frames/s; for YOLO11m-seg, conveyor speed up to 0.15 m/s at MOTA > 0.65 and FPS ≈ 25 frames/s. The software package recognizes eight classes of objects, including rot, scab, and mechanical damage. The system allows the degree of ripeness to be assessed using HSV histograms and fruit sizes to be measured. Tracking is performed using the ByteTrack algorithm, which ensures preservation of object identifiers during movement, thus minimizing erroneous ID reassignment in conditions of partial overlap and high conveyor speeds. The system software is a ready-made solution for the digitalization of the sorting process. By ensuring real-time operation, automatic defect recognition, and statistical data collection, the software increases production efficiency and labor productivity compared to conventional visual inspection methods.
About the Authors
А. I. KutyrevRussian Federation
Kutyrev A. I., PhD (Eng.), Head of the Laboratory of Intelligent Digital Systems for Monitoring, Diagnostics and Process Control in Agricultural Production
1st Institutsky Proyezd, 5, Moscow, 109428
N. A. Potapenkov
Russian Federation
Potapenkov N. A., Engineer of the Laboratory of Intelligent Digital Systems for Monitoring, Diagnostics and Process Control in Agricultural Production
Moscow
References
1. Baneh N. M., Navid H., Kafashan J., Fouladi H., Gonzales-Barrón U. Development and Evaluation of a Small-Scale Apple Sorting Machine Equipped with a Smart Vision System, AgriEngineering. 2023;5(1):473-487. DOI: 10.3390/agriengi-neering5010031.
2. Baneh N. M., Navid H., Kafashan J. Mechatronic components in apple sorting machines with computer vision, J. Food Meas. Charact. 2018;12:1135-1155. DOI: 10.1007/s11694-018-9728-1.
3. Kleynen O., Leemans V., Destain, M. F. Development of a multi-spectral vision system for the detection of defects on apples, J. Food Eng. 2005;69(1):41-49. DOI: 10.1016/j.jfoodeng.2004.07.008.
4. Qin J., Burks T. F., Zhao X., Niphadkar N., Ritenour M. A. Development of a two-band spectral imaging system for real-time citrus canker detection, J. Food Eng. 2012;108(1):87-93. DOI: 10.1016/j.jfoodeng.2011.07.022.
5. Grabska J., Beć K. B., Ueno N., Huck C. W. Analyzing the Quality Parameters of Apples by Spectroscopy from Vis/NIR to NIR Region: A Comprehensive Review, Foods. 2023;12(10):1946. DOI: 10.3390/foods12101946.
6. Khort D. O., Kutyrev A. I., Smirnov I. G., Voronkov I. V. Development of an Automated Control System for Agricultural Technologies in Horticulture, Agricultural machinery and technologies. 2021;15(2):61-68. DOI: 10.22314/2073-7599-2021-152-61-68. (in Russ.).
7. Ekramirad N., Khaled A. Y., Doyle L. E., Loeb J. R., Donohue K. D., Villanueva R. T., Adedeji A. A. Nondestructive Detection of Codling Moth Infestation in Apples Using PixelBased NIR Hyperspectral Imaging with Machine Learning and Feature Selection, Foods. 2022;11(1):8. DOI: 10.3390/foods11010008.
8. Lichman G. I., Smirnov I. G., Khort D. O., Filippov R. A. Application of Machine Vision Systemsin Horticultural Computer Technologies, Machinery and equipment for rural area. 2017;6:10-17. (in Russ.).
9. Bhatt A. K., Pant D. Automatic apple grading model development based on back propagation neural network and machine vision, and its performance evaluation, AI & Society. 2015;30(1):45-56. DOI: 10.1007/s00146-013-0516-5.
10. Hu X., Hu Y., Cai W., Xu Z., Zhao P., Liu X., She Q., Hu Y., Li J. Automatic Detection of Small Sample Apple Surface Defects Using ASDINet, Foods. 2023;12(6):1352. DOI: 10.3390/foods12061352.
11. Liang X., Jia X., Huang W., He X., Li L., Fan S., Li J., Zhao C., Zhang C. Real-Time Grading of Defect Apples Using Semantic Segmentation Combination with a Pruned YOLO V4 Network, Foods. 2022;11(19):3150. DOI: 10.3390/foods11193150.
12. Shi Z., Wu F., Han C., Song D., Wu Y. Detection Model for Cotton Picker Fire Recognition Based on Lightweight Improved YOLOv11, Agriculture. 2025;15(15):1608. DOI: 10.3390/agri-culture15151608.
13. Smirnov I. G., Dyshekov A. I., Devyatkin F. V. Algorithm for an autonomous robotic weed monitoring system, Electrical engineering and electrical equipment in agriculture. 2024;71:1(54):71-75. DOI: 10.22314/2658-4859-2024-71-171-75. (in Russ.).
14. Wang M., Li F. Real-Time Accurate Apple Detection Based on Improved YOLOv8n in Complex Natural Environments, Plants. 2025;14(3):365. DOI: 10.3390/plants14030365.
15. Gao F., Fang W., Sun X., Wu Z., Zhao G., Li G., Li R., Fu L., Zhang Q. A novel apple fruit detection and counting methodology based on deep learning and trunk tracking in modern orchard, Comput. Electron. Agric. 2022;197:107000. DOI: 10.1016/j.compag.2022.107000.
16. Khort D. O., Kutyrev A. I., Smirnov I. G., Filippov R. A., Vershinin R. V. Development of Algorithms for the Recognition System of Garden Strawberry Berries during Robotic Harvesting, Electrical engineering and electrical equipment in agriculture. 2020;67:1(38):133-141. (in Russ.).
17. Yan B., Fan P., Lei X., Liu Z., Yang F. A Real-Time Apple Targets Detection Method for Picking Robot Based on Improved YOLOv5, Remote Sensing. 2021;13(9):1619. DOI: 10.3390/rs13091619.
18. Apolo-Apolo O. E., Martínez-Guanter J., Egea G., Raja P., Pérez-Ruiz M. Deep Learning Techniques for Estimation of the Yield and Size of Citrus Fruits Using a UAV, Eur. J. Agron. 2020;115:126030. DOI: 10.1016/j.eja.2020.126030.
19. Sekharamantry P. K., Melgani F., Malacarne J., Ricci R., de Almeida Silva R., Marcato Junior J. A Seamless Deep Learning Approach for Apple Detection, Depth Estimation, and Tracking Using YOLO Models Enhanced by Multi-Head Attention Mechanism, Computers. 2024;13(3):83. DOI: 10.3390/computers13030083.
20. You L., Chen Y., Xiao C., Sun C., Li R. Multi-Object Vehicle Detection and Tracking Algorithm Based on Improved YOLOv8 and ByteTrack, Electronics. 2024;13(15):3033. DOI: 10.3390/electronics13153033.
21. Fu H., Guo Z., Feng Q., Xie F., Zuo Y., Li T. MSOAR-YOLOv10: Multi-Scale Occluded Apple Detection for Enhanced Harvest Robotics, Horticulturae. 2024;10(12):1246. DOI: 10.3390/horticulturae10121246.
Review
For citations:
Kutyrev А.I., Potapenkov N.A. Development of a computer vision system based on a convolutional neural network for automated sorting of apple fruits. Horticulture and viticulture. 2026;(2):48-59. (In Russ.) https://doi.org/10.31676/0235-2591-2026-2-48-59
JATS XML





























