Abstract:
Various diseases have often posed a serious threat on the tomato growth. The yield and quality of fruits can also be reduced, even leading to the large-scale yield reduction and economic loss. In this study, an improved YOLOv8n model was proposed to facilitate the early identification and prevention of the tomato diseases. The recognition speed and accuracy were also improved to reduce the excessive size of the model parameter. Eight prevalent diseases of the tomato leaf were selected to differentiate from the healthy leaves. Firstly, a lightweight C2f_GDC (C2f_Ghost dynamic convolution) module was designed and then implemented within the backbone network. The dynamic convolution was utilized to adjust the operations. Aiming to reduce the computational load and parameters while maintaining the model performance.Secondly, a triplet attention mechanism was seamlessly integrated into the neck of the network. The capacity of the model was further enhanced to capture the fine details for the high accuracy of recognition. The high performance was achieved to capture the interaction of the input tensors between spatial attention and channel dimensions. The feature information was effectively extracted without dimensionality reduction. Thirdly, the original CIoU Loss function was replaced with the Focaler-SIoU Loss, in order to optimize the model training. As such, the model was performed better to recognize the small targets. The Focaler-SIoU Loss function was characterized by the difficult-to-classify samples. The challenging instances were learnt more effectively for the better overall performance. The experimental results demonstrated that the effectiveness of the improved YOLOv8n model was achieved in the 91.5% mean average precision at a 0.5 threshold (mAP
0.5) and a 79.5% mean average precision across 0.5-0.95 thresholds (mAP
0.5-0.95), among which the mAP
0.5 for the Tomato Mosaic Virus reached 99.5%. Specifically, the accuracy, recall rate, mAP
0.5, mAP
0.5-0.95, and F1 score increased by 2.6, 2.8, 3.0, 2.9, and 2.7 percentage points, respectively, compared with the original YOLOv8n model. Moreover, the detection time, the model size and the number of parameters were reduced by 31.6%, 12.9% and 13.3%, respectively. The improved YOLOv8n model was compared with six mainstream models, including Faster R-CNN (Region-based Convolutional Neural Network), RT-DETR (Real-Time Detection Transformer), YOLOv5s, YOLOv6, YOLOv7 and YOLOv11 models. The mAP
0.5 of the improved model increased by 32.3, 3.6, 2.7, 3.9, 4.4, and 2.2 percentage points, respectively. The real environment tests show that the improved model shared a recognition accuracy of 91.0%. An inference time of 118.8 ms was 17.8% lower than the original YOLOv8n model. In summary, the improved YOLOv8n model was significantly enhanced the key features for the better recognition of subtle disease spots on the tomato leaves. Thereby the accuracy and detection precision were remarkably improved for the small targets. Its lightweight framework was effectively reduced the number of parameters and computational costs, highly applicable to the real-time scenarios, such as the automatic detection of agricultural diseases. The visualization test was also validated its effectiveness. Thus, the finding can also provide a valuable reference for the future research on the disease recognition of the tomato leaves.