DOI: 10.1093/ijfood/vvag164 ISSN: 0950-5423

Online Detection and Grading of Tomato External Quality Based on Machine Vision

Ranran Li, Lei Zhang, Fanghong Liu, Hesheng Yin

Abstract

Tomato shape and mass are key indicators for external quality evaluation, while manual inspection is inefficient and subjective. This study proposes an online method for tomato external quality detection and grading based on machine vision. Images of 1,000 tomato samples were collected using grading equipment to construct a shape-mass dataset. For contour extraction, a refinement method combining YOLO11n-seg and GrabCut was developed to improve segmentation accuracy while satisfying real-time processing requirements. Based on the refined contours, 11 geometric features, including 3 morphological and 8 size features, were extracted to characterise tomato morphology. A rule-based method using circularity and aspect ratio was adopted for normal/abnormal shape classification. For mass prediction, several regression models were compared, and linear regression with selected key features was established as the optimal model. Finally, a shape-mass fusion strategy was developed for online three-grade tomato grading. The results showed that the proposed segmentation method improved accuracy by approximately 6% compared with YOLO segmentation alone, with an average processing time of 343 ms. Shape classification achieved 97% accuracy, and mass prediction obtained an R2 of 0.9632 and an RMSE of 6.68 g. In online testing with 150 samples, the grading accuracy reached 90.7%, indicating good application potential.

More from our Archive