Abstract
This study proposes a model for leafy vegetable disease detection and segmentation based on a few-shot learning framework and a prototype attention mechanism, with the aim of addressing the challenges of complex backgrounds and few-shot problems. Experimental results show that the proposed method performs excellently in both object detection and semantic segmentation tasks. In the object detection task, the model achieves a precision of 0.93, recall of 0.90, accuracy of 0.91, mAP@50 of 0.91, and mAP@75 of 0.90. In the semantic segmentation task, the precision is 0.95, recall is 0.92, accuracy is 0.93, mAP@50 is 0.92, and mAP@75 is 0.92. These results show that the proposed method significantly outperforms the traditional methods, such as YOLOv10 and TinySegformer, validating the advantages of the prototype attention mechanism in enhancing model robustness and fine-grained feature expression. Furthermore, the prototype loss function, which optimizes the distance relationship between samples and category prototypes, significantly improves the model's ability to discriminate between categories. The proposed method shows great potential in agricultural disease detection, particularly in scenarios with few samples and complex backgrounds, offering broad application prospects.