Tomato Disease Detection Method, Device, Equipment and Storage Medium

By expanding and labeling the tomato leaf image dataset, combining YOLOv3SSP and MobileNetV2 network models, an efficient tomato disease detection model is generated, solving the problem of time-consuming and low accuracy in traditional network training, and real-time detection on the mobile terminal is realized.

CN115760775BActive Publication Date: 2025-07-18WUHAN POLYTECHNIC UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211454991.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-07-18
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

In the prior art, traditional convolutional neural networks have deep or large layers, time-consuming training and recognition, simple image cropping leads to poor training effects, low accuracy, and it is difficult to detect tomato diseases in real time on low-configuration mobile terminals.

Method used

By obtaining the original tomato leaf image dataset, expanding and feature annotation, using the YOLOv3SSP network model training and processing, combining with the MobileNetV2 network model for transfer learning, and generating the target tomato disease detection model.

Benefits of technology

The training rate and detection time of the model are improved, and the high-accuracy tomato disease detection is achieved, which is suitable for low-configuration mobile terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115760775B_ABST
    Figure CN115760775B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer vision detection technology, and discloses a tomato disease detection method, device, equipment and storage medium. The method includes: expanding an original tomato leaf image data set to obtain an expanded data set; performing feature annotation on the expanded data set; training and processing the annotated expanded data set through a YOLOv3 SSP network model to obtain a detection result data set; inputting the detection result data set into a MobileNetV2 network model for training, and generating a target tomato disease detection model through transfer learning; detecting a current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result. Through the above method, image data set annotation, rapid training of YOLOv3, image processing, and rapid training of transfer learning are carried out to obtain a tomato disease detection model with high accuracy, thereby improving the training rate of the model and the detection time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision detection, and particularly relates to a tomato disease detection method, device, equipment and storage medium. Background Technique

[0002] In recent years, with the continuous development and growth of machine learning, the combination of machine learning and agriculture has become more and more common. The identification of crop diseases has also gradually transitioned from traditional methods to machine learning-related methods. For traditional networks, such as GoogLeNet, AlexNet, and ResNet series, there are mainly three problems: First, the number of layers of traditional convolutional neural networks is often relatively deep or the volume is relatively large, and it is time-consuming to train and identify; Second, the traditional convolutional neural network dataset is only expanded through simple image enhancement and image cropping, and the main features remain unchanged, resulting in poor training effects and low accuracy; Third, traditional convolutional neural networks rely heavily on the PC side and have poor portability for low-configuration mobile devices, and cannot perform real-time detection of disease images. Therefore, innovative research on the existing problems of tomato disease detection technology has great research significance.

[0003] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of the present invention is to provide a tomato disease detection method, device, equipment and storage medium, aiming to solve the problems in the prior art that the number of layers of traditional convolutional neural networks is often relatively deep or the volume is relatively large, it is time-consuming to train and identify, and only simple image cropping is performed, resulting in poor training effects and low accuracy.

[0005] To achieve the above object, the present invention provides a tomato disease detection method, and the tomato disease detection method includes the following steps:

[0006] Obtain the original tomato leaf image dataset, and expand the original tomato leaf image dataset to obtain an expanded dataset;

[0007] Perform feature annotation on the expanded dataset to obtain the annotated expanded dataset;

[0008] Process the annotated expanded dataset through the YOLOv3SSP network model to obtain a detection result dataset, and the result dataset includes: a training dataset and a validation dataset;

[0009] Input the detection result dataset into the MobileNetV2 network model for training, and generate a target tomato disease detection model through transfer learning;

[0010] Detect the current tomato leaf image according to the target tomato disease detection model to obtain the tomato disease detection result.

[0011] Optionally, the obtaining of the original tomato leaf image dataset includes:

[0012] Obtain the tomato leaf dataset through public datasets and web crawlers;

[0013] Classify the tomato leaf dataset to obtain the original tomato leaf image dataset with classification labels, where the classification labels at least include tomato healthy leaf pictures, tomato early blight pictures, tomato bacterial speck pictures, tomato late blight pictures, tomato leaf mold pictures, tomato Septoria leaf spot pictures, tomato spider mite pictures, tomato brown spot pictures, tomato mosaic virus pictures, and tomato yellow leaf curl virus pictures.

[0014] Optionally, the expansion of the original tomato leaf image dataset to obtain the expanded dataset includes:

[0015] Perform geometric transformation and color space transformation on the original tomato leaf image dataset to obtain the expanded dataset, where the geometric transformation at least includes translation, horizontal flipping, vertical flipping, rotation, zooming in, and zooming out, and the color space transformation at least includes increasing brightness and decreasing brightness.

[0016] Optionally, the YOLOv3SPP model includes: Darknet53 network, FPN network, Yolo Head network, and SPP structure;

[0017] The training process of the labeled expanded dataset through the YOLOv3SSP network model includes:

[0018] Input the labeled expanded dataset into the YOLOv3SSP network model;

[0019] Perform scale feature fusion through the SSP structure via the Darknet53 network, and the Yolo Head network performs detection on the three scale feature layers through the FPN network fusion algorithm to obtain the sub-element target coordinates;

[0020] Crop the sub-element target coordinates through openvc to obtain the cropped result dataset, and preprocess the result dataset.

[0021] Optionally, the cropping of the sub-element target coordinates through openvc to obtain the cropped result dataset and preprocessing the result dataset includes:

[0022] Obtain the weights of the TensorFlow model, transform the distribution of the images according to the weights of the TensorFlow model, and then divide them into a training set and a validation set according to a specific ratio.

[0023] Optionally, inputting the detection result data set into the MobileNetV2 network model for training, and generating a target tomato disease detection model through transfer learning, including:

[0024] Input the training set and the validation set into the MobileNetV2 network model, where the MobileNetV2 network model includes a convolutional layer, a pooling layer, two fully connected layers, and an output layer, and the output layer uses the Softmax function for classification;

[0025] Input the training set and the validation set into the convolutional layer in the MobileNetV2 network model for convolution, and perform average pooling downsampling on the convolved feature samples through the pooling layer to obtain the pooled sampling samples. Perform transfer learning on the sampling samples and the detection result data set processed by the YOLOv3 SSP network model through two fully connected layers, and perform classification output through the Softmax function;

[0026] Perform multiple iterative trainings in sequence to obtain the model loss function;

[0027] In the case where the model loss function converges, obtain the target tomato disease detection model.

[0028] Optionally, after inputting the detection result data set into the MobileNetV2 network model for training and generating a target tomato disease detection model through transfer learning, it further includes:

[0029] Calculate the network error and update the weights according to the batch algorithm;

[0030] Update the target tomato disease detection model according to the network error and the updated weights.

[0031] In addition, to achieve the above object, the present invention also proposes a device for tomato disease detection, and the device for tomato disease detection includes:

[0032] An acquisition module, configured to acquire the original tomato leaf image data set, and expand the original tomato leaf image data set to obtain an expanded data set;

[0033] The acquisition module is further configured to perform feature annotation on the expanded data set to obtain the expanded data set after annotation;

[0034] A training module, configured to train and process the labeled augmented data set through a YOLOv3 SSP network model to obtain a detection result data set;

[0035] The training module is further configured to input the detection result data set into a MobileNetV2 network model for training, and generate a target tomato disease detection model through transfer learning;

[0036] A detection module, configured to detect a current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result.

[0037] In addition, to achieve the above object, the present invention further provides a tomato disease detection device, where the tomato disease detection device includes: a memory, a processor, and a tomato disease detection program stored on the memory and executable on the processor, and the tomato disease detection program is configured to implement the tomato disease detection method as described above.

[0038] In addition, to achieve the above object, the present invention further provides a storage medium, where a tomato disease detection program is stored on the storage medium, and when the tomato disease detection program is executed by a processor, the tomato disease detection method as described above is implemented.

[0039] The tomato disease detection method proposed by the present invention includes: obtaining an original tomato leaf image data set, augmenting the original tomato leaf image data set to obtain an augmented data set; performing feature annotation on the augmented data set to obtain a labeled augmented data set; training and processing the labeled augmented data set through a YOLOv3 SSP network model to obtain a detection result data set; inputting the detection result data set into a MobileNetV2 network model for training, and generating a target tomato disease detection model through transfer learning; detecting a current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result. Through the above method, image data set annotation, fast training of YOLOv3, image processing, and fast training of transfer learning are used to obtain a tomato disease detection model with high accuracy, thereby improving the training rate of the model and the detection time. Description of the Drawings

[0040] Figure 1 It is a schematic structural diagram of a tomato disease detection device in a hardware operating environment related to the embodiment solution of the present invention;

[0041] Figure 2 It is a schematic flowchart of the first embodiment of the tomato disease detection method of the present invention;

[0042] Figure 3 It is a structural diagram of a YOLOv3 SPP network model in an embodiment of the tomato disease detection method of the present invention;

[0043] Figure 4 Flow chart of MobileNet v2 combined with transfer learning for an embodiment of the tomato disease detection method of the present invention;

[0044] Figure 5 Comparison chart of the training results of four models for an embodiment of the tomato disease detection method of the present invention;

[0045] Figure 6 Variation curve of the accuracy rate during the training process of the convolutional neural network for an embodiment of the tomato disease detection method of the present invention;

[0046] Figure 7 Schematic flow chart of the second embodiment of the tomato disease detection method of the present invention;

[0047] Figure 8 Schematic diagram of the functional modules of the first embodiment of the tomato disease detection device of the present invention.

[0048] The realization, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners

[0049] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0050] Refer to Figure 1 , Figure 1 Schematic diagram of the tomato disease detection device of the hardware operating environment related to the embodiment solution of the present invention.

[0051] Such as Figure 1As shown in the figure, the tomato disease detection device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable Non-Volatile Memory (NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0052] Those skilled in the art can understand that Figure 1 the structure shown in the figure does not constitute a limitation on the tomato disease detection device, and it may include more or fewer components than shown in the figure, or combine some components, or have a different component layout.

[0053] As Figure 1 shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and a tomato disease detection program.

[0054] In Figure 1 the tomato disease detection device shown in the figure, the network interface 1004 is mainly used for data communication with the network integrated platform workstation; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the tomato disease detection device of the present invention may be arranged in the tomato disease detection device. The tomato disease detection device calls the tomato disease detection program stored in the memory 1005 through the processor 1001 and executes the tomato disease detection method provided in the embodiments of the present invention.

[0055] Based on the above hardware structure, an embodiment of the tomato disease detection method of the present invention is proposed.

[0056] Referring to Figure 2 , Figure 2 it is a schematic flowchart of the first embodiment of the tomato disease detection method of the present invention.

[0057] In the first embodiment, the tomato disease detection method includes the following steps:

[0058] Step S10, obtain the original tomato leaf image dataset, and augment the original tomato leaf image dataset to obtain an augmented dataset.

[0059] It should be noted that the execution subject of this embodiment is a mobile terminal detection device, which refers to a device used to implement the data acquisition model training function, and this embodiment does not limit this.

[0060] It can be understood that the original tomato leaf image dataset refers to the dataset of the complete original tomato leaf samples obtained after web crawling. The augmented dataset refers to the dataset obtained by performing image processing operations on the original tomato leaf image dataset and incorporating the augmented data into the original tomato leaf image dataset.

[0061] Further, step S10 includes: obtaining the tomato leaf dataset through public datasets and web crawlers; classifying the tomato leaf dataset to obtain the original tomato leaf image dataset with classification labels.

[0062] It can be understood that the reason for obtaining the tomato leaf dataset through public datasets and web crawlers is to obtain sufficient original tomato samples. Therefore, after a large amount of data acquisition, expanding the original samples can obtain a sufficient number of basic training samples. The public dataset can be obtained on the PaddlePaddle platform, which is an open-source training platform for deep learning based on Baidu, providing a powerful online training environment and storage resources. At the same time, the waterfall flow web page source code dataset can be crawled through the service library.

[0063] It should be understood that classifying the tomato leaf dataset refers to classifying the data of diseased tomato leaves in the original tomato leaf dataset. The classification labels at least include tomato healthy leaf pictures, tomato early blight pictures, tomato bacterial speck pictures, tomato late blight pictures, tomato leaf mold pictures, tomato septoria leaf spot pictures, tomato spider mite pictures, tomato brown spot pictures, tomato mosaic virus pictures, and tomato yellow leaf curl virus pictures.

[0064] Further, step S10 includes: performing geometric transformation and color space transformation on the original tomato leaf image dataset to obtain an augmented dataset.

[0065] It can be understood that geometric transformation refers to performing geometric processing on all subsets in the original tomato leaf image dataset. The geometric processing in this embodiment includes: translation, horizontal flipping, vertical flipping, rotation, magnification, and reduction. Color space transformation refers to increasing and decreasing brightness. Through the function of color space conversion, the input transformed image and the transformation mode are used as parameters to automatically perform color space conversion. After obtaining the dataset processed geometrically, this dataset is spliced into the original tomato leaf image dataset.

[0066] Step S20: Perform feature annotation on the augmented dataset to obtain the augmented dataset after annotation.

[0067] It can be understood that a network trained using a public dataset may not have good test results for its own data. Therefore, a dataset created by oneself is required. And the dataset created by oneself needs to be annotated. Feature annotation refers to annotating the features of a certain area of the original tomato leaf image through labelImg. After the annotation is completed, the augmented dataset is obtained. For example: Open a certain tomato leaf image in the dataset file through labelImg. If the current leaf is a diseased leaf, use the shortcut key to select and annotate the features, and store the annotated tomato leaf image in the augmented dataset.

[0068] Step S30: Train and process the augmented dataset after annotation through the YOLOv3SSP network model to obtain the detection result dataset.

[0069] It can be understood that YOLOv3 refers to an object detection algorithm. The YOLOv3SSP model includes the Darknet53 network, the FPN network, the Yolo Head network, and the SPP structure. Among them, the Darknet53 network contains 53 convolutional layers, each followed by a batch normalization layer and a leakyReLU Layer layer; the FPN network contains an upsample and a fusion algorithm, and the fusion algorithm contains three scales; the Yolo Head network performs detection on the prediction feature layer of each scale. Among them, the SPP structure is added before the first prediction feature layer to achieve feature fusion of different scales.

[0070] Furthermore, step S30 includes: inputting the augmented dataset after annotation into the YOLOv3SSP network model; performing scale feature fusion through the Darknet53 network by the SSP structure, and the Yolo Head network performing detection on the feature layers of the three scales of the fusion algorithm of the FPN network to obtain the target coordinates of the sub-elements; cropping the target coordinates of the sub-elements through openvc to obtain the cropped result dataset, and preprocessing the result dataset.

[0071] It should be understood that, as Figure 3 shown, DarkNet53 refers to a convolutional layer representing 53 layers, in which residual structures are interspersed in the convolutional layer, continuously stacked, and finally downsampled through average pooling, followed by a fully connected layer and a softmax classification function; the first Convolutional is a convolutional layer with 512 convolutional kernels and a feature layer of 1×1. The Convolutional layer consists of a convolutional layer, a BN layer, and an activation function LeakyRelu; Spp is divided into four branches. The first branch is directly connected from the input to the output. The second branch is max-pooling downsampling with a pooling kernel of 5×5. The third branch is max-pooling downsampling with a pooling kernel of 9×9. The fourth branch is max-pooling downsampling with a pooling kernel of 13×13; Concatenate refers to stitching feature images to achieve feature fusion of images at different scales, and three feature maps at different scales are obtained through the Yolo Head network. The coordinates of the sub-elements of the feature maps at different scales are obtained.

[0072] Furthermore, step S30 includes: obtaining the TensorFlow model weights, transforming the distribution of the images according to the TensorFlow model weights, and then dividing them into a training set and a validation set according to a specific ratio.

[0073] It can be understood that the target coordinates of the sub-elements are cropped through openvc, and the resulting cropped dataset is preprocessed. For example, the data preprocessing includes cropping the dataset into a format size of 224*224; performing the same preprocessing as the TensorFlow model weights, transforming the images from the [0, 255] distribution to between [0, 1], then subtracting 0.5, and finally multiplying by 2; dividing them into a training set and a validation set according to a ratio of 9:1.

[0074] In step S40, the detection result dataset is input into the MobileNetV2 network model for training, and a target tomato disease detection model is generated through transfer learning.

[0075] It should be understood that transfer learning means that when a network model cannot accurately detect data, another network model needs to be combined for detection. When training a certain model on a dataset and expecting it to detect accurately on unknown data in the same task and domain. In another case, when given data for some tasks or domains, labeled feature data that can be used for another training model is also required, and these data should belong to the same task and domain so that it can be expected to detect accurately on this dataset. For example: when identifying a certain tomato leaf, its color characteristics are identified, and the existing model can only identify its color characteristics and cannot identify its shape characteristics. Through transfer learning, another model is trained to identify its shape characteristics. Based on the original training model, two identical characteristics can be identified.

[0076] Further, step S40 includes: inputting the training set and the validation set into the MobileNetV2 network model, where the MobileNetV2 network model includes a convolutional layer, a pooling layer, two fully connected layers, and an output layer, and the output layer uses the Softmax function for classification; inputting the training set and the validation set into the convolutional layer in the MobileNetV2 network model for convolution, and performing average pooling downsampling on the convolved feature samples through the pooling layer to obtain the pooled sampling samples, performing transfer learning on the sampling samples and the detection result dataset processed by training through the YOLOv3 SSP network model through two fully connected layers, and performing classification output through the Softmax function; performing iterative training multiple times in sequence to obtain a model loss function; and obtaining a target tomato disease detection model when the model loss function converges.

[0077] It can be understood that the MobileNet v2 network model first passes through a convolutional layer, then continuously passes through DW convolution and average pooling downsampling, and finally outputs through a convolutional layer similar to a fully connected layer. Transfer learning specifically adds two fully connected layers behind the MobileNet v2 model, and the output layer uses the Softmax function for classification. The model training needs to be iteratively trained multiple times until the model loss function converges to obtain a target tomato disease detection model with a relatively high accuracy. As Figure 4 shown, Figure 4 is a flowchart of MobileNet v2 combined with transfer learning. Conv refers to the stacking of multiple ordinary convolutional layers, Avgpool refers to average pooling downsampling, Dropout refers to random inactivation to prevent data overfitting, Fc is a fully connected layer that flattens the data, and Softmax refers to the classification function.

[0078] Step S50, detecting the current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result.

[0079] It can be understood that after generating the target tomato disease detection model, input the tomato leaf image into the target tomato disease detection model to obtain the current tomato disease detection result. At the same time, three relatively common models in the prior art are respectively used to identify diseases of the samples, such as: ResNet 50, GoogLeNet, and VGG16 models, and the results are compared. Compared with the Resnet 50, GoogLeNet, and VGG16 models. As Figure 5As shown, the accuracy rate and loss value of the model in this embodiment are better than those of the other three models in both the training set and the validation set, and the training time of the MobileNetV2 model is significantly less. The validation set accuracy rate of the model of the present invention is 1.21% higher than that of the traditional VGG16 model, and the training time is 1 / 14 of that of the vgg network. Through comparison, the network model in the present invention can achieve the highest accuracy rate of 93.67% in a relatively short training time. When training multiple models, the change curve graph of the accuracy rate during the training of the four convolutional neural networks obtained is as Figure 6 shown.

[0080] In this embodiment, by obtaining the original tomato leaf image dataset, expanding the original tomato leaf image dataset to obtain an expanded dataset; performing feature annotation on the expanded dataset to obtain the annotated expanded dataset; training and processing the annotated expanded dataset through the YOLOv3 SSP network model to obtain a detection result dataset; inputting the detection result dataset into the MobileNetV2 network model for training, and generating a target tomato disease detection model through transfer learning; detecting the current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result. Through the above method, image dataset annotation, fast training of YOLOv3, image processing, and fast training of transfer learning are used to obtain a tomato disease detection model with high accuracy, thereby improving the training rate of the model and the detection time.

[0081] In the first embodiment, as Figure 7 described, in the second embodiment of the tomato disease detection method, the step S40 includes:

[0082] Step S410, calculating the network error and updating the weights according to the batch algorithm.

[0083] It should be understood that the batch algorithm refers to an optimization algorithm that uses more than one but not all training samples in deep learning training, or an optimization algorithm that uses all training sets. In this embodiment, the batch algorithm is adopted to obtain more accurate data. A neural network contains neurons, and the weight refers to the connection strength between each neuron. The greater the weight, the greater the possibility.

[0084] Step S420, updating the target tomato disease detection model according to the network error and the updated weights.

[0085] It can be understood that the network error refers to the neural network error calculated by the batch algorithm. By setting the parameter batch to 16, epochs to 50, the learning rate to 0.0005, and inputting all the dataset samples, after all the samples are input, the total error of the network is calculated, and then the weights are updated according to the total error, where batch refers to the batch value, and the dataset needs to be divided into batches when inputting into the model, and epochs refers to the number of iterations. After updating the weights through the error, an updated target tomato disease detection model can be obtained.

[0086] In this embodiment, the network error is calculated and the weights are updated according to the batch algorithm; the target tomato disease detection model is updated according to the network error and the updated weights. In the above manner, the weights of the target neural network are iteratively updated to improve the detection accuracy of the target tomato detection model.

[0087] In addition, an embodiment of the present invention also proposes a storage medium, on which a tomato disease detection program is stored, and when the tomato disease detection program is executed by a processor, the steps of the tomato disease detection method described above are implemented.

[0088] Since this storage medium adopts all the technical solutions of the above-mentioned all embodiments, it has at least all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, and will not be elaborated here one by one.

[0089] In addition, referring to Figure 8 , an embodiment of the present invention also proposes a tomato disease detection device, and the tomato disease detection device includes:

[0090] An acquisition module 10, configured to acquire an original tomato leaf image dataset, and expand the original tomato leaf image dataset to obtain an expanded dataset.

[0091] The acquisition module 10 is further configured to perform feature annotation on the expanded dataset to obtain the annotated expanded dataset.

[0092] A training module 20, configured to train and process the annotated expanded dataset through a YOLOv3SSP network model to obtain a detection result dataset.

[0093] The training module 20 is further configured to input the detection result dataset into a MobileNetV2 network model for training, and generate a target tomato disease detection model by means of transfer learning.

[0094] A detection module 30, configured to detect a current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result.

[0095] In this embodiment, by obtaining the original tomato leaf image dataset, expanding the original tomato leaf image dataset to obtain an expanded dataset; performing feature annotation on the expanded dataset to obtain the annotated expanded dataset; processing the annotated expanded dataset through the YOLOv3 SSP network model to obtain a detection result dataset; inputting the detection result dataset into the MobileNetV2 network model for training, and generating a target tomato disease detection model through transfer learning; detecting the current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result. Through the above method, image dataset annotation, rapid training of YOLOv3, image processing, and rapid training of transfer learning are used to obtain a tomato disease detection model with high accuracy, thereby improving the training rate of the model and the detection time.

[0096] In this embodiment, the obtaining module 10 is further configured to obtain a tomato leaf dataset by means of a public dataset and a web crawler; classify the tomato leaf dataset to obtain an original tomato leaf image dataset with classification labels.

[0097] In this embodiment, the obtaining module 10 is further configured to perform geometric transformation and color space transformation on the original tomato leaf image dataset to obtain an expanded dataset.

[0098] In this embodiment, the training module 20 is further configured to input the annotated expanded dataset into the YOLOv3 SSP network model; perform scale feature fusion through the Darknet53 network via the SSP structure, and the Yolo Head network performs detection on the feature layers of three scales through the FPN network fusion algorithm to obtain the coordinates of sub-element targets; crop the coordinates of the sub-element targets through openvc to obtain a cropped result dataset, and preprocess the result dataset.

[0099] In this embodiment, the training module 20 is further configured to obtain TensorFlow model weights, perform distribution transformation on the images according to the TensorFlow model weights, and then divide them into a training set and a validation set according to a specific ratio.

[0100] In this embodiment, the detection module 20 is further configured to input the training set and the validation set into the MobileNetV2 network model. The MobileNetV2 network model includes a convolutional layer, a pooling layer, two fully connected layers, and an output layer. The output layer uses the Softmax function for classification. Input the training set and the validation set into the convolutional layer of the MobileNetV2 network model for convolution, and perform average pooling downsampling on the convolved feature samples through the pooling layer to obtain the pooled sampling samples. Perform transfer learning on the sampling samples and the detection result dataset processed by the YOLOv3 SSP network model through two fully connected layers, and perform classification output through the Softmax function. Perform iterative training multiple times in sequence to obtain the model loss function. When the model loss function converges, obtain the target tomato disease detection model.

[0101] In this embodiment, the detection module 20 is further configured to calculate the network error and update the weights according to the batch algorithm; update the target tomato disease detection model according to the network error and the updated weights.

[0102] It should be noted that the above-described work process is only illustrative and does not limit the protection scope of the present invention. In practical applications, those skilled in the art can select some or all of them according to actual needs to achieve the purpose of the solution of this embodiment, and no limitation is made here.

[0103] In addition, for the technical details not described in detail in this embodiment, reference can be made to the tomato disease detection method provided in any embodiment of the present invention, and details will not be repeated here.

[0104] Other embodiments or implementation methods of the tomato disease detection device of the present invention can refer to the above method embodiments, and details will not be repeated here.

[0105] In addition, it should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or system including the element.

[0106] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0107] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory (ROM) / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, integrated platform workstation, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0108] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for detecting tomato diseases, characterized in that, The method includes: Obtain the original tomato leaf image dataset, and augment the original tomato leaf image dataset to obtain an augmented dataset; Perform feature annotation on the augmented dataset to obtain the augmented dataset after annotation; Process the augmented dataset after annotation through the YOLOv3 SSP network model to obtain a detection result dataset, where the result dataset includes: a training dataset and a validation dataset; Input the detection result dataset into the MobileNetV2 network model for training, and generate a target tomato disease detection model through transfer learning; Detect the current tomato leaf image according to the target tomato disease detection model to obtain a tomato disease detection result; The inputting the detection result dataset into the MobileNetV2 network model for training and generating a target tomato disease detection model through transfer learning includes: Input the training set and the validation set into the MobileNetV2 network model, where the MobileNetV2 network model includes a convolutional layer, a pooling layer, two fully connected layers, and an output layer, and the output layer uses the Softmax function for classification; Input the training set and the validation set into the convolutional layer in the MobileNetV2 network model for convolution, and perform average pooling downsampling on the convolved feature samples through the pooling layer to obtain the sampled samples after pooling. Transfer learn the sampled samples and the detection result dataset processed by the YOLOv3 SSP network model through two fully connected layers, and perform classification output through the Softmax function; Perform multiple iterative trainings in sequence to obtain a model loss function; When the model loss function converges, obtain a target tomato disease detection model.

2. The method according to claim 1, characterized in that, The obtaining the original tomato leaf image dataset includes: Obtain the tomato leaf dataset through public datasets and web crawlers; Classify the tomato leaf dataset to obtain the original tomato leaf image dataset with classification labels, where the classification labels at least include tomato healthy leaf pictures, tomato early blight pictures, tomato bacterial speck pictures, tomato late blight pictures, tomato leaf mold pictures, tomato septoria leaf spot pictures, tomato spider mite pictures, tomato brown spot pictures, tomato mosaic virus pictures, and tomato yellow leaf curl virus pictures.

3. The method according to claim 1, wherein The augmenting the original tomato leaf image dataset to obtain an augmented dataset includes: Perform geometric transformation and color space transformation on the original tomato leaf image dataset to obtain an augmented dataset, where the geometric transformation at least includes translation, horizontal flipping, vertical flipping, rotation, magnification, and reduction, and the color space transformation at least includes increasing brightness and decreasing brightness.

4. The method according to claim 1, characterized in that, The YOLOv3 SPP network model includes: a Darknet53 network, an FPN network, a Yolo Head network, and an SPP structure; The processing the augmented dataset after annotation through the YOLOv3 SSP network model includes: Input the augmented dataset after annotation into the YOLOv3 SSP network model; Through the SSP structure, scale feature fusion is performed through the Darknet53 network. The Yolo Head network detects by fusing the feature layers of three scales through the FPN network fusion algorithm to obtain the target coordinates of the sub-elements. The target coordinates of the sub-elements are cropped through openvc to obtain the cropped result dataset, and the result dataset is preprocessed.

5. The method according to claim 4, wherein The cropping of the target coordinates of the sub-elements through openvc to obtain the cropped result dataset and preprocessing the result dataset includes: Obtain the TensorFlow model weights, transform the distribution of the images according to the TensorFlow model weights, and then divide them into a training set and a validation set according to a specific ratio.

6. The method according to any one of claims 1 to 5, characterized in that, After inputting the detection result dataset into the MobileNetV2 network model for training and generating the target tomato disease detection model through transfer learning, it further includes: Calculate the network error and update the weights according to the batch algorithm; Update the target tomato disease detection model according to the network error and the updated weights.

7. A tomato disease detection device, characterized in that, The tomato disease detection device includes: An acquisition module for acquiring the original tomato leaf image dataset, expanding the original tomato leaf image dataset to obtain an expanded dataset; The acquisition module is further configured to perform feature annotation on the expanded dataset to obtain the annotated expanded dataset; A training module for training the annotated expanded dataset through the YOLOv3 SSP network model to obtain a detection result dataset; The training module is further configured to input the detection result dataset into the MobileNetV2 network model for training, and generate a target tomato disease detection model through transfer learning; The training module is further configured to input the training set and the validation set into the MobileNetV2 network model, where the MobileNetV2 network model includes a convolutional layer, a pooling layer, two fully connected layers, and an output layer, and the output layer uses the Softmax function for classification; Input the training set and the validation set into the convolutional layer of the MobileNetV2 network model for convolution, and perform average pooling downsampling on the convolved feature samples through the pooling layer to obtain the pooled sampling samples. Transfer learning is performed on the sampling samples and the detection result dataset processed by the YOLOv3 SSP network model through two fully connected layers, and classification output is performed through the Softmax function; Perform multiple iterative trainings in sequence to obtain the model loss function; In the case where the model loss function converges, obtain the target tomato disease detection model; A detection module for detecting the current tomato leaf image according to the target tomato disease detection model to obtain the tomato disease detection result.

8. A tomato disease detection device, characterized in that, The tomato disease detection device includes: a memory, a processor, and a tomato disease detection program stored on the memory and executable on the processor. The tomato disease detection program is configured to implement the steps of the tomato disease detection method according to any one of claims 1 to 6.

9. A storage medium, characterized in that, A program for tomato disease detection is stored on the storage medium. When the program for tomato disease detection is executed by a processor, the steps of the tomato disease detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Airfield pavement disease foreign matter detection method based on fusion of multiple convolutional neural networks

    CN113111703A

  • Infrared image gas leakage and liquid leakage detection method and system based on deep learning

    CN114627052A