# A Study on Tomato Disease and Pest Detection Method
## 7 Conclusions  
To address the problems of large model size and low detection performance of existing models, this paper proposes an improved tomato pest and disease detection algorithm called YOLOv5n-VCW, based on YOLOv5n. First, EfficientViT is used to replace the feature extraction module of the original YOLOv5, which significantly reduces the computational and parameter costs of the model. Second, the nearest neighbor interpolation upsampling module is replaced with the CARAFE upsampling module to reduce the loss of feature information during upsampling. Finally, the WIoU Loss is used to replace the CIoU Loss as the new target box loss function to optimize the calculation of the loss function. The hyperparameters for training were set as follows: 0.01 for lr0, 0.01 for lrf, 0.937 for momentum, 0.0005 for weight_decay, 3.0 for warmup_epochs, 0.8 for warmup_momentum, 0.1 for warmup_bias_lr, and 0.05 for box; cls is 0.5.  
The experimental results on the tomato pest and disease detection dataset show that the YOLOv5n-VCW proposed in this paper has significantly better detection accuracy, model parameters, and computational cost than the original YOLOv5n. With only 1.6 M model parameters and 3.3 G computational costs, mAP50 and mAP50:95 reach 98.1% and 84.8%, respectively. Compared with other mainstream object detection algorithms in terms of detection accuracy, model size, and computational cost, YOLOv5n-VCW has certain advantages and is more practical and feasible in real-world applications. Next, deployment of the proposed model in mobile or embedded device environments for accurate identification and detection of tomato pests and diseases is our main goal, and further exploration of the proposed model for detection and identification of various other plant pests and diseases will be a part of future plans.  
Conceptualization, S.L., [PERSON] ([PERSON]) and W.H. ([PERSON]); methodology, [PERSON] ([PERSON]); software, [PERSON] ([PERSON]); validation, M.L. and W.H. ([PERSON]); formal analysis, S.L. and W.H. ([PERSON]); investigation, [PERSON] ([PERSON]); resources, H.W.; data curation, H.W.; writing--original draft preparation, [PERSON] ([PERSON]) and M.L.; writing--review and editing, [PERSON] ([PERSON]) and S.L.; visualization, [PERSON] ([PERSON]) and S.L.; supervision, [PERSON] ([PERSON]); project administration, M.L.; funding acquisition, [PERSON] ([PERSON]). All authors have read and agreed to the published version of the manuscript.  
Supported by Sichuan Science and Technology Program (2023 YFSY0026, 2023 YFH0004).  
Not applicable.  
**Data Availability Statement:** In this paper, we use publicly available datasets, including Kaustubh B's tomato leaf disease detection dataset ([[https://www.kaggle.com/datasets/kaustubhb9](https://www.kaggle.com/datasets/kaustubhb9)]([https://www.kaggle.com/datasets/kaustubhb9](https://www.kaggle.com/datasets/kaustubhb9)) 99/tomatoleaf (accessed on 27 July 2023)) and [PERSON]'s open-source tomato dataset ([[https://www.kaggle.com/datasets/noulam/tomato](https://www.kaggle.com/datasets/noulam/tomato)]([https://www.kaggle.com/datasets/noulam/tomato](https://www.kaggle.com/datasets/noulam/tomato)) (accessed on 27 July 2023)).  
The authors declare no conflict of interest.