Abstract:
Tomato maturity recognition is an important visual perception task for automated tomato harvesting. However, tomato maturity recognition in greenhouse environments is still affected by non-uniform illumination, weak light, uneven illumination and reflection, fruit overlap, cross-row plant interference, and the similarity between immature fruits and leaves. RGB images can provide rich color and texture information, but their feature representation is easily degraded under changing illumination. Near-infrared (NIR) images are less sensitive to visible light variation and can provide complementary spectral information, but their texture details are relatively weak. This study aimed to improve the robustness and adaptability of tomato maturity recognition under complex greenhouse conditions by using Red-Green-Blue and Near-Infrared (RGB-NIR) multimodal feature fusion. A dual-backbone tomato maturity recognition model named MDD-YOLOv11 was proposed on the basis of YOLOv11n-L3L4. The model was designed to enhance feature extraction, occluded target modeling, and cross-modal feature fusion. Firstly, a multi-branch convolution module (MConv) was introduced into the dual-backbone network. Multi-scale convolution branches were used to extract features with different receptive fields, so that the RGB branch could better adapt to illumination changes and the NIR branch could enhance weak feature representation. Secondly, a C3k2_DCNv4 module was embedded into the backbone and neck networks. Deformable convolution v4 was used to adaptively adjust feature sampling positions according to the geometric structure of tomato targets. This module was used to alleviate incomplete target representation caused by stems, cross-row plants, and fruit overlap, and to improve the local modeling ability for irregular and partially occluded fruits. Thirdly, a deformable cross-modal attention fusion module (DCAF) was designed at the L3 and L4 feature layers. The DCAF module used deformable alignment to reduce spatial misalignment between RGB and NIR features, and adopted window cross-attention to suppress redundant information and mine complementary features between the two modalities. In this way, more discriminative fused features were obtained for tomato maturity recognition. The public RGB-NIR tomato dataset was used in this study. The original dataset contained four illumination conditions—natural light, artificial light, weak light, and sodium yellow light—with 1,000 RGB-NIR image pairs for each condition, totaling 4,000 pairs. This study selected 2,550 image pairs from the natural light, artificial light, and weak light scenes. To reduce data leakage caused by adjacent video frames, every five consecutive RGB-NIR image pairs were grouped as one sampling unit. Using a fixed random seed, the sampling units were divided into a training set of 2,100 image pairs and a validation set of 450 image pairs. All compared models were trained and evaluated using the same dataset split and training settings. Experimental results showed that MDD-YOLOv11 achieved a Precision of 94.8%, a Recall of 94.5%, an
F1 score of 94.65%, an mAP
0.5 of 98.7%, and an mAP
0.5:0.95 of 86.3% on the mixed illumination val set. Compared with the baseline YOLOv11n-L3L4 model, these indicators increased by 1.7, 1.6, 1.7, 1.6, and 3.4 percentage points, respectively. The number of parameters, floating-point operations (FLOPs), and model size of MDD-YOLOv11 were 4.1 M, 11.1 G, and 8.1 MB, respectively. The inference speed reached 72.7 frames/s, and the average inference latency for a single image was
0.0138 s on an NVIDIA RTX3090 GPU platform with a batch size of 1. The ablation experiments showed that MConv, C3k2_DCNv4, and DCAF all improved recognition performance. In particular, DCAF improved mAP
0.5:0.95 by 2.0 percentage points when used alone, indicating that cross-modal feature alignment and fusion were effective for RGB-NIR tomato maturity recognition. Visualization results and error statistics further showed that the proposed model reduced false detections and missed detections under natural light, weak light, occlusion, and artificial light conditions. To further evaluate the adaptability of the model to different acquisition environments, a self-built HBAUT dataset containing 331 RGB-NIR image pairs after screening was used as an external test set, without participating in model training, validation, or hyperparameter tuning. MDD-YOLOv11 achieved an mAP
0.5 of 95.4% and an mAP
0.5:0.95 of 83.4%, which were 2.1 and 2.7 percentage points higher than those of YOLOv11n-L3L4, respectively. These results indicate that MDD-YOLOv11 can improve the robustness and adaptability of tomato maturity recognition in complex greenhouse environments, providing technical support for the visual perception stage of automated tomato harvesting.