In this study, we propose a multi-scale feature fusion network based on an improved RT-DETR model for the efficient detection of tomato leaf disease. Our model combines the multi-scale extended residual module by capturing contextual information at various scales and the multi-scale feature pyramid network by integrating feature information from different levels, which improves feature extraction capability and reduces the interference of complex backgrounds on feature extraction, thereby improving information transmission efficiency and the accuracy of the model. In addition, the novel loss function called adaptive focal loss (AFL) was used, which is based on traditional focal loss with the introduction of attenuation factors to focus the model’s attention to high-loss features to alleviate overfitting and of dynamic weight adjustment mechanisms to focus on the more important features during the training process to improve the overall learning performance. Another significant advantage of AFL is that it can more efficiently improve the detection accuracy on imbalanced datasets than on balanced datasets. These innovations optimized the learning strategy of the model, making AP@0.50 up to 97.9% on detecting the categories of tomato diseases. In addition, this model also achieves the high detection accuracy of 85.4% on other crop diseases. These results provide valuable references for agriculture applications.
Varieties show their unique characteristics in morphology, growth, and fruits. Tomato maturity is related to multiple dimensional characteristics including color, texture, smell, etc. An effective classification method of tomato variety and maturity is crucial for evaluating its growth and yield. However, due to the complex growth environment, some problems such as leaf occlusion and fruit shaded by each other make it difficult to accurately and efficiently identify them. To solve these problems, this study innovatively proposes a simultaneous detection model on tomato variety and maturity based on improved YOLOv8n, with the combination of frequency-adaptive dilated convolution (FADC) feature extraction module and the high-level screening-feature path aggregation network (HSPAN) with the aim of local and global feature fusion by the channel attention module and feature selection fusion mechanism. In addition, we use the Powerful-IoU (PIoU) loss function to replace the original Complete IoU (CIoU) to enhance the accuracy of bounding boxes. We also introduce a dynamic detection head as the final output of the model, which can adaptively adjust the focus of feature extraction according to the color and size of tomato fruits, thereby improving the recognition accuracy. Experimental results show that our model with better global perception capability achieves the highest detection accuracy and lower computation complexity among the comparative models.