Automated tomato ripeness detection faces significant challenges in greenhouse environments due to variable lighting conditions, leaf occlusion, and multi-scale fruit distribution. This study presents DTBi-YOLOv8-seg (Dual-Transformer-BiFPN-YOLOv8-seg), a dual-backbone deep learning framework that enhances YOLOv8s-seg architecture for robust tomato maturity classification and instance segmentation. The proposed method integrates a CNN pathway incorporating FasterNetBlock and CBAM for local feature extraction, Swin-Transformer pathway for global context modeling, and BiFPN for multi-scale feature fusion. A comprehensive dataset comprising 1875 images was collected from a modern agricultural park in Chengdu, containing approximately 9000 polygon-annotated tomato instances with pixel-level segmentation masks across ripe, semi-ripe, and unripe stages. Experimental results demonstrate significant performance improvements over the baseline YOLOv8s-seg, with Box mAP@0.5 increasing from 89.4% to 98.9%, Mask mAP@0.5 from 87.8% to 97.6%, and F1-score from 84.5% to 97.6%. Further comparison against five mainstream segmentation models shows that DTBi-YOLOv8-seg outperforms the best-performing baseline, YOLOv11-seg, by 9.2% in recall and 8.1% in F1-score, while maintaining practical edge deployment viability at only 8.7 W power consumption. These results demonstrate that DTBi-YOLOv8-seg provides a reliable and computationally efficient solution for automated tomato maturity grading in real greenhouse environments, with strong potential for extension to other horticultural crops and integration with multimodal sensing modalities such as depth imaging and multispectral data to further enhance robustness under challenging field conditions.
Zhao et al. (Wed,) studied this question.