| Crop diseases are a major problem in agricultural production and have long been one of the major challenges facing agricultural production.The occurrence of diseases affects the normal growth of crops,leading to a decrease in yield and,in severe cases,even to crop death,thus having a significant impact on economic returns.Traditional methods of plant pest detection usually require professional observation and judgment,which is not only time-consuming and laborious,but also prone to misjudgment.Computer vision-based methods can quickly and accurately identify the disease type of plant leaves by analyzing and processing plant leaf images,which has the advantages of rapidity,high accuracy,and portability,and thus is increasingly becoming a hot spot for plant pest and disease detection research.This paper recognizes plant pests and diseases based on computer vision models to realize the recognition of many types of plant diseases,and the designed model has the advantages of high accuracy and good generalizability.The main work of this paper is:(1)A classification model based on hybrid attention model is proposed for the classification problem of different plant leaves.Res Net50 is chosen as the base network to improve the classification accuracy of the model by combining SE attention mechanism,channel attention mechanism and spatial attention mechanism.These three attention mechanisms are designed in parallel arrangement to extract effective features simultaneously and reduce the complexity of the network.Specifically,the SE attention mechanism adaptively selects different feature channels,which provides more adaptability and generalization ability when processing different input images.The channel attention mechanism enhances the important features by learning the weight of each feature.The spatial attention mechanism is mainly used to improve the model’s ability to perceive and understand spatial information.By weighting the features at different spatial locations,the model can better adapt to different target sizes and locations and can be more efficient and accurate in processing images.The effectiveness of the hybrid attention mechanism is verified through model comparison experiments and ablation experiments,and the results show that the hybrid attention mechanism can better extract effective features and improve the classification accuracy of the model compared with using only a single attention mechanism.Also,the effectiveness of each attention mechanism for the model is demonstrated by ablation experiments.The experiments show that the accuracy of our proposed model can reach 88.6% on the Plant Village dataset.(2)To solve the fine-grained classification problem of plant pests and diseases with large intra-class variation and small inter-class variation,a two-branch Transformer classification model based on mutual covariance attention is proposed.The fine-grained variance problem of plant pest leaves is solved by using the two-branch Transformer classification model,which constructs image information at different scales to produce stronger image features while using Vi T for plant pest identification.The feature extraction effect of plant pests and diseases is enhanced by using the reciprocal variance attention mechanism,and two branches that are independent of each other are fused with image blocks of different sizes by the attention mechanism to obtain fused features,and multiple fusion methods are tried in the fusion stage.The mutual covariance attention mechanism can introduce more interaction information in the feature fusion process and improve the classification accuracy of the model.The model considers both global and local features,and makes full use of feature information at different scales by fusing image blocks of different sizes to improve the classification accuracy.The two-branch Transformer classification model improves the accuracy and robustness of fine-grained classification problems by using various technical means,which is important for the automated identification and control of plant pests and diseases.In the experiment,the model was tested on the Plant Village dataset and achieved good classification results with an accuracy of90.12%,which proved the effectiveness of the model.This model can be applied to the monitoring and identification of pests and diseases in the agricultural field,providing important technical support for agricultural production. |