Tomato disease identification method based on improved YOLOV8

By optimizing the YOLOV8 model, the problem of traditional tomato disease identification methods is solved, and high-precision and real-time disease recognition is achieved, adapting to complex environments and different lighting conditions, supporting large-scale applications and real-time field recognition is achieved. .

CN119251645AInactive Publication Date: 2025-01-03YUNNAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411316980.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional tomato disease recognition method relies on manual observation, which is time-consuming and labor-intensive, and the accuracy is affected by experience and skills, making it difficult to meet the needs of large-scale, efficient and accurate disease recognition. The traditional YOLO algorithm has poor detection results in complex environments. Background Inadequate noise suppression and weak robustness.

Method used

By optimizing the YOLOV8 model, MobileNetv4 is introduced to replace the Backbone network structure, and SEAM attention mechanism is introduced in the Head network, image preprocessing such as vertical mirroring, horizontal mirroring, rotation and brightness adjustment are carried out, and the model is trained to improve the recognition accuracy of tomato diseases and Real-time.

Benefits of technology

It realizes high-precision recognition of tomato diseases, improves the expressiveness and real-time performance of the model in complex environments, adapts to images of different lighting and angles, has a wider range of applications, supports large-scale rapid and accurate recognition, and is deployed on mobile APPs Real-time field recognition is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251645A_ABST
    Figure CN119251645A_ABST
Patent Text Reader

Abstract

The invention provides a tomato disease identification method based on improved YOLOv8. The method belongs to the field of disease and pest identification, and comprises the following steps: firstly, collecting tomato disease images of different types including tomato early blight, late blight, leaf mold, spot blight, spot disease, mosaic virus and the like, and then carrying out image preprocessing and disease area labeling. And optimizing the YOLOV8 network model, wherein the optimization mainly comprises the step of introducing a MobileNetv4 model into an original network structure and the step of introducing an SEAM attention mechanism into an initial model network structure. Training the optimized tomato disease recognition model on the basis of a PyTorch framework, and setting proper model parameters and training times; and the trained model is verified to achieve relatively high recognition accuracy. And finally, deploying the constructed tomato disease identification model on a mobile terminal APP to realize real-time identification of field tomato diseases. The invention provides an accurate and rapid tomato disease identification tool, and aims to improve the agricultural production efficiency and the crop yield.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of pest and disease identification, and more specifically relates to a tomato disease identification method based on improved YOLOV8. Background Art

[0002] With the rapid development of agricultural technology, tomatoes are one of the most important vegetable crops. The rapid and accurate identification and treatment of various diseases are of great significance to improving yield and quality. Traditional tomato disease identification methods generally rely on the observation and judgment of professional plant protection personnel. This method is not only time-consuming and labor-intensive, but also the accuracy of identification is greatly affected by people's experience and skills. It is difficult to meet the needs of large-scale, efficient and accurate disease identification.

[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 tomato 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 tomato 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 tomato diseases. Specifically, the recognition accuracy of various tomato diseases, including tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus, 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 is implemented by adopting the following technical scheme: the method comprises:

[0007] Step S1: collecting different types of tomato disease images, wherein the types of tomato diseases include tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus;

[0008] Step S2: performing image preprocessing on the collected tomato disease images and marking the diseased areas in the preprocessed tomato disease images;

[0009] Step S3: Optimize the YOLOV8 network model to obtain a tomato disease recognition model;

[0010] Step S4: training a tomato disease recognition model;

[0011] Step S5: verifying the trained tomato disease recognition model, the constructed tomato disease recognition model has an average recognition accuracy of 92.6%, 99.5%, 99.4%, 99.5%, 99.5% and 99.5% for tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus, respectively;

[0012] Step S6: Collect tomato images and input them into the constructed tomato disease recognition model, and the tomato disease recognition model recognizes and outputs tomato disease information.

[0013] In one solution, in step S1, tomato disease images are collected from public websites.

[0014] In one solution, in step S2, the image preprocessing includes vertical mirroring, horizontal mirroring, random rotation, and brightness adjustment.

[0015] In one embodiment, the images of tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus are expanded to 13,767.

[0016] In one solution, in step S2, the diseased area in the tomato disease image is labeled using labelimg.

[0017] In one solution, in step S3, the method for optimizing the YOLOV8 network model is as follows: introducing the MobileNetv4 model into the YOLOV8 network structure to replace the original network structure of Backbone; and introducing the SEAM attention mechanism into the initial model Head network structure.

[0018] In one embodiment, in step S4, a tomato disease recognition model is trained under the pytorch deep learning framework;

[0019] The diseased parts in the tomato disease image are marked with labelimg, and then the marked tomato disease images are placed in the specified folder. Then the model parameters are set for training, where the initial learning rate is set to 0.001, batch is set to 32, close_mosaic = 0, workers = 8, and the number of training times is set to 200.

[0020] In one scheme, in step S5, three evaluation indicators, namely mean average precision (mAP), confidence, and parameters, are introduced to verify the tomato disease recognition model. The mean average precision (mAP) refers to the average value of the average accuracy of each category, and its calculation involves two basic indicators, precision and recall.

[0021] In one solution, in step S6, a tomato disease recognition model is deployed on a mobile APP, and field tomato diseases are identified through the mobile terminal.

[0022] Beneficial effects of the present invention:

[0023] 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.

[0024] Strong adaptability of image processing: The image preprocessing in the present invention includes multiple methods such as mirroring, rotation, and brightness adjustment, which can adapt to images with different lighting, colors, and angles, making the model more generalizable and applicable.

[0025] Convenient for large-scale application: Compared with the traditional identification method that relies on manual experience, the present invention can realize rapid and accurate disease identification and is convenient for large-scale application.

[0026] Wide range of application areas: By deploying the disease recognition model on the mobile APP, real-time tomato 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

[0027] Figure 1 is a flow chart of the method of the present invention;

[0028] Figure 2 This is the training flow chart of the YOLOV8 network model of the present invention. DETAILED DESCRIPTION

[0029] 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.

[0030] 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.

[0031] like Figure 1 As shown, a tomato disease recognition method based on improved YOLOV8 includes:

[0032] Step S1: collecting different types of tomato disease images, wherein the types of tomato diseases include tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus.

[0033] First, determine the target, that is, in this step, you need to collect tomato disease images, including early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus, etc. These images should include all stages of the disease, early, middle and late.

[0034] These images can then be collected from two directions:

[0035] 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 tomato disease pictures from these sources.

[0036] 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.

[0037] 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.

[0038] Step S2: performing image preprocessing on the collected tomato disease images and marking the diseased areas in the preprocessed tomato disease images.

[0039] First, the collected tomato disease images need to be preprocessed, including image enhancement and data expansion, to improve the training effect of the model.

[0040] Image enhancement mainly aims to improve the quality of images and reduce the noise in images. Common methods include histogram equalization, Gaussian blur, etc. For example, images can be enhanced by vertical mirroring, horizontal mirroring, random rotation, brightness adjustment, etc.

[0041] 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.

[0042] Next, the diseased areas in the preprocessed tomato disease images need to be labeled.

[0043] Usually, a specific annotation tool (such as labelimg) is used to annotate the objects in the image. Since the goal is to identify the disease of eggplant, the diseased area must be carefully and accurately annotated.

[0044] During the labeling process, different labels need to be set for different disease types, such as early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus, etc. In this way, these labels can be used for identification and classification during model training.

[0045] After labeling, the labeled data needs to be organized and saved for subsequent model training.

[0046] For example, the labeled tomato disease 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, or JSON.

[0047] After completing the above steps, 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.

[0048] The images of tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus are all expanded to 13,767.

[0049] Step S3: Optimize the YOLOV8 network model to obtain a tomato disease recognition model.

[0050] The method for optimizing the YOLOV8 network model is as follows: introducing the MobileNetv4 model into the YOLOV8 network structure to replace the original Backbone network structure; and introducing the SEAM attention mechanism into the initial model Head network structure.

[0051] The optimization of the YOLOv8 model first introduces the MobileNetv4 model in the Backbone part. In this step, the MobileNetv4 model is mainly used to replace the part used for feature extraction in the original YOLOv8 model.

[0052] Among them, MobileNetv4 is a lightweight deep network model that achieves high accuracy with low computational complexity and parameter count. When building MobileNetv4, the depthwise separable convolution in the deep convolutional neural network was used to reduce the complexity of the model. In specific operations, the general convolution operation is decomposed into two parts: one is the depthwise convolution applied to each input channel; the other is the pointwise convolution used to integrate all channel information. The mathematical expression is as follows:

[0053] Depthwise Convolution:

[0054] Y {n,i,j} =X {n,:,:,} *D {n}

[0055] Point-wise convolution:

[0056] Y {i,j} =Σ {n} X {n,i,j} *P {n}

[0057] Among them, Y is the output feature map, X is the input feature map, D is the depth convolution filter, and P is the point-by-point convolution filter.

[0058] In the process of optimizing the YOLOV8 network model, the SEAM attention mechanism was introduced and set to enhance the accuracy of the network model in identifying diseases. The introduction of the SEAM attention mechanism is to enable the network model to better focus on and identify diseased areas.

[0059] Among them, the SEAM attention mechanism is a method to understand the model's decision by solving the model's attention mapping to the classification decision. Its mathematical formula is as follows:

[0060] M=F {-1} (1-F(x))

[0061] Among them, M represents the attention map, F represents the classifier of the model, and x represents the feature map of the input.

[0062] After completing the optimization of the above two steps, we get the optimized tomato disease recognition model, and then we can start model training.

[0063] like Figure 2 As shown, step S4: training the tomato disease recognition model.

[0064] S401. First, set up the deep learning framework. Here we choose PyTorch, an open source deep learning platform based on Python.

[0065] S402: Then, the tomato disease images annotated in step S2 and their corresponding annotation files need to be introduced as input data. Usually, 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, close_mosaic is set to 0, and the workers are set to 8. These parameters can be adjusted according to the actual situation.

[0067] S404: Perform model training. During the training process, according to the labeling information of LabelImg, the model will gradually learn how to identify the diseased part of the tomato leaf, and then continuously adjust the parameters of the model to improve the recognition accuracy.

[0068] 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).

[0069] S405, the number of model training times is set to 200. The number of training times is also an adjustable parameter. If the number of training times is too small, the model may be underfitting, that is, it cannot learn the rules of the data well; if the number of training times is too large, it may cause the model to be overfitting, that is, the model is too complex and learns the noise and outliers in the data, thereby affecting the prediction of new data.

[0070] Step S5: The trained tomato disease recognition model is verified. The average recognition accuracies of the constructed tomato disease recognition model for tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus are 92.6%, 99.5%, 99.4%, 99.5%, 99.5% and 99.5%, respectively.

[0071] After the model training is completed, it is usually necessary to validate it to confirm 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.

[0072] The trained tomato 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.

[0073] The performance of the model is evaluated using evaluation indicators such as mean average precision (mAP), confidence, and 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; confidence is the degree of certainty about the correctness of the model prediction; parameters are indicators used to evaluate the complexity of the model, generally calculating the number of parameters of the model.

[0074] Step S6: Collect tomato images and input them into the constructed tomato disease recognition model, and the tomato disease recognition model recognizes and outputs tomato disease information.

[0075] New tomato images are collected and used as input to the model.

[0076] The collected tomato images are input into the trained tomato disease recognition model.

[0077] The model recognizes these images and outputs the identified and detected disease information.

[0078] 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.

[0079] Finally, the trained tomato disease model is deployed to the mobile APP, so that users can directly detect and identify tomato diseases in real time on site, which can greatly enhance the convenience of users in dealing with tomato diseases.

[0080] Those 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).

[0081] 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 tomato disease recognition method based on improved YOLOV8, characterized in that: The method includes: Step S1: collecting different types of tomato disease images, wherein the types of tomato diseases include tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus; Step S2: performing image preprocessing on the collected tomato disease images and marking the diseased areas in the preprocessed tomato disease images; Step S3: Optimize the YOLOV8 network model to obtain a tomato disease recognition model; Step S4: training a tomato disease recognition model; Step S5: verifying the trained tomato disease recognition model, the constructed tomato disease recognition model has an average recognition accuracy of 92.6%, 99.5%, 99.4%, 99.5%, 99.5% and 99.5% for tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus, respectively; Step S6: Collect tomato images and input them into the constructed tomato disease recognition model, and the tomato disease recognition model recognizes and outputs tomato disease information.

2. A tomato disease recognition method based on improved YOLOV8 according to claim 1, characterized in that: In step S1, tomato disease images are collected from public websites.

3. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S2, the image preprocessing includes vertical mirroring, horizontal mirroring, random rotation, and brightness adjustment.

4. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: The images of tomato early blight, late blight, leaf mold, leaf spot, spot disease and mosaic virus are all expanded to 13,767.

5. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S2, the diseased area in the tomato disease image is marked using labelimg.

6. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S3, the method for optimizing the YOLOV8 network model is as follows: introducing the MobileNetv4 model into the YOLOV8 network structure to replace the original network structure of Backbone; and introducing the SEAM attention mechanism into the initial model Head network structure.

7. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S4, the tomato disease recognition model is trained under the pytorch deep learning framework; The diseased parts in the tomato disease image are marked with labelimg, and then the marked tomato disease images are placed in the specified folder. Then the model parameters are set for training, where the initial learning rate is set to 0.001, batch is set to 32, close_mosaic = 0, workers = 8, and the number of training times is set to 200.

8. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S5, three evaluation indicators, namely mean average precision (mAP), confidence, and parameters, are introduced to verify the tomato disease recognition model. The mean average precision (mAP) refers to the average value of the average accuracy of each category, and its calculation involves two basic indicators, precision and recall.

9. The tomato disease identification method based on improved YOLOV8 according to claim 1, characterized in that: In step S6, the tomato disease recognition model is deployed on the mobile APP, and the field tomato diseases are identified through the mobile terminal.

Citation Information

Cited By

  • Tomato leaf disease identification method, system and equipment and storage medium

    CN120339734A