Tomato grading and harvesting robots often face several difficulties while working under complex field conditions, such as dense fruit growth, partial occlusion, changing viewing angles, low segmentation accuracy, high fruit-missing rates, and poor boundary detection. To overcome these challenges, there is a need for a fast, accurate, and reliable visual instance segmentation model that can support automatic tomato quality evaluation and robotic harvesting.
This study proposed TQVGModel, also known as the Tomato Quality Visual Grading Model, which is a Mask R-CNN-based deep learning network designed for tomato quality grading and instance segmentation. The model uses a multi-branch IncepConvV2 backbone developed with ConvNeXt architecture and large-kernel convolution decomposition. This helps improve segmentation accuracy while maintaining efficient real-time performance. To reduce the chances of missing difficult or less-represented tomato classes, the model applies Class Balanced Focal Loss in the classification branch. In addition, an Enhanced Sobel operator is integrated with boundary prediction and an edge loss function to improve the accuracy of tomato edge localization, which is important for reliable quality assessment. The study also developed a tomato quality grading subsystem to automate fruit evaluation and support further applications such as robotic harvesting and crop growth monitoring. A high-quality tomato instance segmentation dataset named Tomato-Seg was also prepared for testing the model in complex field scenarios. Experimental results showed that the TQVGModel-Tiny version achieved 80.05% mean average precision, which was 7.04% higher than the original Mask R-CNN model. It also required fewer parameters and provided faster inference speed, with 33.98 million parameters and 53.38 ms processing time per image. Overall, the results indicate that TQVGModel provides better accuracy, faster detection, lower miss rate, and improved edge localization. Therefore, this model can be useful for intelligent tomato quality grading, robotic harvesting, and smart monitoring systems under complex agricultural environments.