Potato disease identification method based on improved YOLOV8
By optimizing the YOLOV8 model, using the EfficientViT structure and SCSA collaborative attention module, the problems of inefficient and insufficient detection accuracy of traditional potato disease recognition methods are solved, and high-precision and real-time disease recognition is achieved, which is suitable for large-scale and field real-time applications.
Patent Information
- Application Number
- CN202510041673.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-13
AI Technical Summary
The traditional potato disease recognition method relies on manual experience and is inefficient. The traditional YOLO algorithm has poor detection of small and dense targets in complex environments, insufficient background noise suppression, and weak robustness of environmental changes, resulting in a decrease in detection accuracy.
By optimizing the YOLOV8 model, the EfficientViT structure is used to replace the backbone network of the original YOLOV8, and the SCSA collaborative attention module is introduced into the Head network structure to improve the model's robustness to feature extraction capabilities and environmental changes of small goals.
It improves the accuracy and real-time nature of potato disease identification, enhances the generalization ability and scope of application of the model, and realizes large-scale, efficient and accurate disease identification, which facilitates real-time field identification and other agricultural applications.
Smart Images

Figure CN119992318A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of disease and insect pest identification, and more specifically relates to a potato disease identification method based on improved YOLOV8. Background Art
[0002] With the rapid development of agricultural facilities, potatoes are one of the vegetables people eat daily. The rapid and accurate identification of various diseases is an important measure to improve potato yield and quality. The traditional potato disease identification method mainly relies on people's subjective experience to make judgments, which not only has great requirements on the experience and skills of the staff, but also has low efficiency.
[0003] In recent years, computer vision and deep learning technologies have made significant progress in the field of image recognition. Among them, the YOLO (You Only Look Once) series of algorithms based on deep convolutional neural networks (DCNN) have been widely used in target recognition tasks due to their real-time and robustness. YOLO transforms the target recognition task into a regression task, predicting the classification and location of objects in the image at one time, with the advantages of fast speed and high accuracy. However, for crop disease recognition tasks in various complex environments, the traditional YOLO algorithm has some problems, such as poor detection of small and dense targets, insufficient suppression of background noise, and weak robustness to environmental changes such as chromaticity and illumination, all of which may lead to a decrease in detection accuracy.
[0004] Therefore, a potato disease recognition method based on improved YOLOV8 was developed, aiming to improve the accuracy and real-time performance of disease recognition by optimizing the network structure, which is of great value for achieving large-scale, efficient and accurate on-site identification of potato diseases. Summary of the invention
[0005] The main technical problem to be solved by the present invention is how to improve the recognition accuracy and real-time performance of potato diseases. Specifically, the recognition accuracy of various potato diseases, including potato early blight and late blight, is improved through deep learning methods, especially the optimized YOLOV8 model, while ensuring the real-time performance and stability of the model to meet the needs of large-scale, efficient and accurate disease recognition.
[0006] In order to achieve the above object, the present invention proposes a potato disease identification method based on improved YOLOV8, comprising:
[0007] S1, collecting different types of potato leaf images, the potato leaf images include images of potato early blight, late blight and healthy leaves;
[0008] S2, performing image preprocessing on the collected potato leaf image, and marking the characteristic areas in the preprocessed potato leaf image;
[0009] S3, by replacing the original YOLOv8 backbone network with the EfficientViT structure and introducing the SCSA collaborative attention module into the original YOLOv8 Head network structure, the YOLOV8 network model was optimized to obtain a potato disease recognition model;
[0010] S4. Train the potato disease recognition model under the pytorch deep learning framework;
[0011] S5. Verify the trained potato disease recognition model, and the average accuracy of the constructed potato disease recognition model for identifying potato early blight, late blight, and healthy leaves reaches a preset accuracy value;
[0012] S6. Inputting the potato leaf image to be identified into the trained potato disease identification model for identification and outputting the identification result of the potato leaf, wherein the identification includes early blight leaves, late blight leaves or healthy leaves.
[0013] Optionally, in some possible implementations of the present invention, in S2, the image preprocessing includes horizontal flipping, vertical flipping, horizontal and vertical flipping, random angle, random zooming in and out, adjusting saturation, color conversion, random noise addition, color change, sharpening operation, and Gaussian blur.
[0014] Optionally, in some possible implementations of the present invention, the images of potato early blight, late blight, and healthy leaves are all expanded to 23,672 images.
[0015] Optionally, in some possible implementations of the present invention, in S2, the characteristic region in the potato leaf image is labeled using a labeling tool labelimg. A large rectangular frame is used to label the characteristic region of a potato leaf with a large lesion; a small rectangular frame is used to label the characteristic region of a potato leaf with a small lesion; and a large rectangular frame is used to select all parts of a healthy potato leaf.
[0016] Optionally, in some possible implementations of the present invention, the specific steps of S4 include:
[0017] S401. First, set PyTorch as the deep learning framework;
[0018] S402, then importing the potato leaf image annotated in S2 and its corresponding annotation file as input data;
[0019] S403, set the training parameters: the initial learning rate is set to 0.001, the batch size is set to 32, the close_mosaic is set to 0, and the data loading process (workers) is set to 8;
[0020] S404, performing a model training operation based on back propagation and gradient descent algorithms, and during the training process, performing learning training according to the feature area annotated by the labeling tool LabelImg;
[0021] S405: When the number of model training times reaches a predetermined number, stop training.
[0022] Optionally, in some possible implementations of the present invention, in S5, three evaluation indicators, namely mean average precision (mAP), accuracy and recall parameters, are introduced to verify the potato disease recognition model.
[0023] Optionally, in some possible implementations of the present invention, in S6, the potato disease recognition model is deployed on a mobile APP, and potato leaves in the field are identified through the mobile terminal.
[0024] The present invention can achieve the following beneficial effects:
[0025] 1) Algorithm performance optimization: The original YOLOV8 network model was optimized to improve the model's expressiveness, so that the model can achieve higher accuracy and real-time performance when identifying tomato diseases in various complex environments.
[0026] 2) Strong adaptability of image processing: The image preprocessing in the present invention includes flipping, adding noise, adjusting saturation and other methods, which can adapt to images with different lighting, colors and angles, making the model more generalizable and applicable.
[0027] 3) Convenient for large-scale application: Compared with the traditional identification method that relies on manual experience, the present invention can achieve rapid and accurate disease identification and is convenient for large-scale application.
[0028] 4) Wide application fields: By deploying the disease recognition model on the mobile APP, real-time potato disease recognition in the field can be easily realized. It can also be applied to other fields, such as agricultural scientific research, crop planting management, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A method flow chart of the potato disease identification method based on improved YOLOV8 in the present invention;
[0030] Figure 2The figure is a model training flow chart of the potato disease recognition model in the present invention. DETAILED DESCRIPTION
[0031] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Typical embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0032] Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0033] like Figure 1 As shown, a potato disease recognition method based on improved YOLOV8 includes:
[0034] S1. Collect different types of potato leaf images, including images of potato early blight, late blight and healthy leaves.
[0035] First, the recognition target is determined, i.e., potato leaf images. Different types include early blight, late blight, and healthy leaves. That is, images of potato early blight, late blight, and healthy leaves are included. Each type of image (i.e., images of potato early blight, late blight, and healthy leaves) contains all stages of the disease, such as early, middle, and late stages.
[0036] These images can then be collected from both public websites and field photography.
[0037] Public websites: Many agricultural research and development organizations and universities often publish their research materials and data, including various studies on specific diseases or pests. In addition, there are many forums, websites and blogs about agriculture and plant diseases, and you can collect high-quality apple disease pictures from these sources.
[0038] On-site shooting: If conditions permit, you can go directly to the field to shoot, so as to obtain the most direct and realistic image data.
[0039] The above-mentioned public websites and field photography collection images need to ensure that the acquired images are as diverse as possible, including different lighting, angles, backgrounds and other factors, so as to improve the generalization ability of the model.
[0040] S2. performing image preprocessing on the collected potato leaf image, and marking the characteristic regions in the preprocessed potato leaf image.
[0041] First, the collected potato leaf images need to be preprocessed, including image enhancement and data expansion, to improve the training effect of the model.
[0042] Image enhancement mainly improves the quality of the image and reduces the noise in the image. Common methods include histogram equalization, Gaussian blur, etc. For example, the image can be enhanced by flipping, adjusting saturation, randomly adding noise, sharpening, Gaussian blur, etc.
[0043] Data augmentation is a method of increasing training samples. It can generate new training samples in some way to expand the size of the training set and enhance the generalization ability of the model. Here, the image augmentation method mentioned above is used to achieve data augmentation.
[0044] Next, it is necessary to mark the characteristic regions in the preprocessed potato leaf image. The characteristic regions can be determined based on the characteristics of potato early blight and potato late blight.
[0045] Specifically, the characteristics of potato early blight are as follows: the lesions on the leaves are initially brown circular spots, which gradually expand into circular or nearly circular spots, brown to dark brown, with distinct edges and clear concentric rings, and sometimes with narrow yellow halos on the outer edges of the lesions. A small amount of black mold may form on the lesions.
[0046] The main characteristics of potato late blight are as follows: the leaves are infected, initially causing irregular yellow-brown spots with no neat boundaries. When the climate is humid, the spots expand rapidly, with water-soaked edges and a circle of white mold. On the back of the leaves, dense white mold grows, forming a mold ring.
[0047] Usually, a specific annotation tool (such as labelimg) is used to annotate the objects in the image. Since the purpose is to identify potato diseases, the characteristic areas must be carefully and accurately annotated.
[0048] During the labeling process, different labels need to be set for different leaf types, such as early blight, late blight, healthy leaves, etc. In this way, these labels can be used for identification and classification during model training.
[0049] After labeling, the labeled data needs to be organized and saved for subsequent model training.
[0050] For example, the labeled potato leaf images and their label information can be saved in a specified folder or database in a certain format. The label information is often saved in a file format such as TXT, XML, JSON, etc.
[0051] After the above is completed, there will be a data set that includes both original images and annotation information, which is very important basic data for subsequent deep learning model training.
[0052] The images of potato early blight, late blight, and healthy leaves used in the present invention are all expanded to 23,672 images.
[0053] S3. The YOLOV8 network model was optimized by replacing the original YOLOv8 backbone network with the EfficientViT structure and introducing the SCSA collaborative attention module into the original YOLOv8 Head network structure to obtain a potato disease recognition model.
[0054] The method for optimizing the YOLOV8 network model is as follows: replace the original YOLOv8 backbone network with the EfficientViT structure to reduce the number of model parameters; introduce the SCSA collaborative attention module into the original YOLOv8 Head network structure to improve the model's ability to extract features for small targets.
[0055] The optimization of the YOLOv8 model first introduces the EfficientViT model in the Backbone part. In this, the EfficientViT model is mainly used to replace the part used for feature extraction in the original YOLOv8 model.
[0056] Among them, EfficientViT is a lightweight deep network model that achieves high accuracy with low computational complexity and number of parameters. When building EfficientViT, the ability to handle high-resolution visual tasks is improved through sandwich layout and cascaded group attention modules. The sandwich layout uses a single memory-constrained multi-head attention mechanism (MHSA) between the feedforward neural network (FFN) layers to improve memory constraints; the cascaded group attention module reduces computational redundancy and improves attention diversity by feeding different feature segmentations to different attention heads.
[0057] In the process of optimizing the YOLOV8 network model, in order to enhance the accuracy of the network model in disease recognition, the SCSA collaborative attention module was introduced and set. The introduction of the SCSA collaborative attention module is to enable the network model to better focus on and identify diseased areas.
[0058] Among them, the SCSA collaborative attention module combines shared multi-semantic spatial attention (SMSA) and progressive channel attention (PCSA) to achieve the synergy of spatial and channel attention and improve the model's feature extraction ability for small objects. SMSA uses the integration of multi-semantic spatial information and the progressive compression strategy to effectively provide spatial priors for channel attention; while PCSA uses this spatial information to further optimize channel features through the self-attention mechanism, alleviating the differences between different semantic levels.
[0059] After completing the optimization of the above two steps, we get the optimized potato disease recognition model, and then we can start model training.
[0060] S4. Train the potato disease recognition model under the pytorch deep learning framework.
[0061] like Figure 2 As shown, S4 specifically includes:
[0062] S401. First, set PyTorch as the deep learning framework.
[0063] The present invention chooses PyTorch, an open source deep learning platform based on Python.
[0064] S402, then importing the potato leaf image annotated in S2 and its corresponding annotation file as input data.
[0065] Typically, the input data is divided into a training set and a validation set.
[0066] S403, set the training parameters: the initial learning rate is set to 0.001, the batch size is set to 32, the close_mosaic is set to 0, and the data loading process (workers) is set to 8.
[0067] These parameters can be adjusted according to actual conditions.
[0068] S404, performing a model training operation based on backpropagation and gradient descent algorithms. During the training process, learning and training are performed according to the feature areas annotated by the labeling tool LabelImg.
[0069] After training, the model will gradually learn how to identify the diseased parts of potato leaves, and then continuously adjust the model parameters to improve the recognition accuracy.
[0070] Specifically, model training mainly relies on algorithms such as backpropagation and gradient descent. When the model is forward propagated, it will generate a predicted result, which will then be compared with the actual result to obtain the error. Backpropagation is to push back from the output layer based on the error, and after certain operations, update each parameter in the hope of getting a smaller error in the next forward propagation. Commonly used gradient descent methods include batch gradient descent (BGD), stochastic gradient descent (SGD) and mini-batch gradient descent (MBGD).
[0071] S405: When the number of model training times reaches a predetermined number, stop training.
[0072] The number of model training times can be set to 150, 200 or 300. The number of training times is also an adjustable parameter. If the number of training times is too small, the model may underfit, that is, it cannot learn the laws of the data well; if the number of training times is too large, it may cause the model to overfit, that is, the model is too complex and learns the noise and outliers in the data, thus affecting the prediction of new data.
[0073] S5. Verify the trained potato disease recognition model. When the average accuracy of the constructed potato disease recognition model for identifying potato early blight, late blight, and healthy leaves reaches a preset accuracy value, the model training is terminated.
[0074] For example, the average accuracy of potato early blight, late blight, and healthy leaves identification reached 99.5%, 99.1%, and 99.5%, respectively. After the model training is completed, it is usually necessary to verify the performance and accuracy of the model. The validation set is a part of the original data set that is used to test the model effect. It was not used in the previous training, so it is brand new data for the model.
[0075] The trained potato disease recognition model is used to predict the images in the validation set, and the prediction results are compared with the actual labels to obtain the recognition accuracy of each disease.
[0076] Furthermore, the performance of the model is evaluated using evaluation indicators such as mean average precision (mAP), precision, and recall parameters. Among them, mAP is the average value of the prediction accuracy of different categories, which is generally used to evaluate multi-target detection problems; precision is used to evaluate the accuracy of the model's prediction of positive examples; parameters are indicators used to evaluate the complexity of the model, generally calculating the number of parameters of the model.
[0077] S6. Inputting the potato leaf image to be identified into the trained potato disease identification model, performing identification and outputting the identification result of the potato leaf, wherein the identification includes early blight leaves, late blight leaves or healthy leaves.
[0078] New potato leaf images are collected and used as input to the model.
[0079] The collected potato leaf images are input into the trained potato disease recognition model.
[0080] The model recognizes these images and outputs the identified and detected disease information.
[0081] The output results may include a variety of content, such as various disease scores, the type of disease detected, and the location of the diseased area.
[0082] Finally, the trained potato disease model is deployed on the mobile APP, so that users can perform real-time detection and identification of potato diseases directly on site, which can greatly enhance the convenience of users in dealing with potato diseases.
[0083] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0084] It should be understood that the detailed description of the technical solutions of the present invention by means of the preferred embodiments is illustrative rather than restrictive. A person skilled in the art may modify the technical solutions described in the embodiments, or replace some of the technical features by equivalents, based on reading the specification of the present invention; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A potato disease identification method based on improved YOLOV8, characterized in that: include: S1, collecting different types of potato leaf images, the potato leaf images include images of potato early blight, late blight and healthy leaves; S2, performing image preprocessing on the collected potato leaf image, and marking the characteristic areas in the preprocessed potato leaf image; S3, by replacing the original YOLOv8 backbone network with the EfficientViT structure and introducing the SCSA collaborative attention module into the original YOLOv8 Head network structure, the YOLOV8 network model was optimized to obtain a potato disease recognition model; S4. Train the potato disease recognition model under the pytorch deep learning framework; S5. Verify the trained potato disease recognition model, and the average accuracy of the constructed potato disease recognition model for identifying potato early blight, late blight, and healthy leaves reaches a preset accuracy value; S6. Inputting the potato leaf image to be identified into the trained potato disease identification model for identification and outputting the identification result of the potato leaf, wherein the identification includes early blight leaves, late blight leaves or healthy leaves.
2. The potato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In S2, the image preprocessing includes horizontal flipping, vertical flipping, horizontal and vertical flipping, random angle, random zooming, saturation adjustment, color conversion, random noise addition, color change, sharpening operation, and Gaussian blur.
3. The potato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: The images of potato early blight, late blight, and healthy leaves were expanded to 23,672.
4. The potato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In S2, the characteristic areas in the potato leaf image are labeled using the labelimg labeling tool.
5. The potato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: The specific steps of S4 include: S401. First, set PyTorch as the deep learning framework; S402, then importing the potato leaf image annotated in S2 and its corresponding annotation file as input data; S403, set the training parameters: the initial learning rate is set to 0.001, the batch size batchsize is set to 32, close data enhancement close_mosaic is set to 0, and the data loading process workers is set to 8; S404, performing a model training operation based on back propagation and gradient descent algorithms, and during the training process, performing learning training according to the feature area annotated by the labeling tool LabelImg; S405: When the number of model training times reaches a predetermined number, stop training.
6. The potato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In S5, three evaluation indicators, namely mean average precision (mAP), precision and recall parameters, were introduced to verify the potato disease recognition model.
7. The potato disease identification method based on improved YOLOv8 according to claim 1, characterized in that: In S6, the potato disease identification model is deployed on the mobile APP, and the potato leaves in the field are identified through the mobile terminal.
Citation Information
Cited By
Potato leaf disease area positioning method, system and device
CN120655580A
Plant leaf image segmentation and leaf lesion degree grading method
CN121330289A