Recognition and classification method of plant leaf disease severity and type based on convolutional Swin Transformer

By adopting the convolution-based SwinTransformer model in plant leaf disease detection, combining self-attention mechanism and convolutional blocks, the problem of plant leaf disease identification and classification in complex environments is solved, and efficient and accurate identification of disease degree and type is achieved. .

CN115049879BActive Publication Date: 2025-02-11ZHONGBEI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210712444.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2025-02-11
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently identify and classify the degree and type of plant leaf diseases in complex environments. Traditional manual detection methods are time-consuming and labor-intensive and cannot monitor the development of diseases in a timely and effective manner.

Method used

The Convolutional SwinTransformer model is used to construct the Convolutional SwinTransformer model through technical means such as window based self-attention, shifted window self-attention, residual structure and Convolutional Block to extract the characteristics of plant leaf diseases, and use a fully connected neural network as classification. to realize the identification and classification of the degree and type of disease.

Benefits of technology

It realizes the degree and type of plant leaf diseases efficiently identified and classified in complex environments, improves the accuracy and efficiency of detection, can effectively utilize existing image data, and reduces manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049879B_ABST
    Figure CN115049879B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of plant leaf disease detection and classification under complex environments, and is specifically a method for identifying and classifying the degree and type of plant leaf disease based on a convolutional Swin Transformer. In a network model, window based self-attention, shifted window self-attention, residual structure and Convolutional Block are used to ensure that the network can efficiently learn image information. The Convolutional Swin Transformer model is trained separately under two types of data sets to obtain two models, and the two models can respectively identify the degree of plant disease and classify the type of plant disease. The present invention utilizes the characteristics of deep learning, does not require manual extraction of image features, and only needs to send image data into the model for training, so that the computer can learn the plant leaf disease features in the data set, and the type and degree of plant diseases can be accurately identified through the learning of these features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of plant leaf disease detection and classification under complex environments, and specifically to a method for identifying and classifying the degree and type of plant leaf diseases based on a convolutional SwinTransformer. The method uses a ConvolutionalSwinTransformer model for feature extraction and a fully connected neural network as a classifier to achieve plant leaf disease degree and type identification. Background Art

[0002] In the process of agricultural development, the negative impact of plant diseases has always been a major challenge. If the extent and types of plant diseases are not effectively monitored in the early stage and relevant measures are not taken in time, it will seriously affect economic benefits. Traditional manual detection methods are not suitable for large-scale disease monitoring. While consuming a lot of manpower and financial resources, they cannot effectively obtain the development of diseases in a timely manner, missing the best time to take relevant measures, thus causing huge losses. Therefore, it is very important to take timely and effective regulatory measures for plant diseases.

[0003] In recent years, with the rapid development of artificial intelligence, many fields have adopted artificial intelligence-related technologies to effectively solve major problems in their respective fields. As an important branch of artificial intelligence, computer vision provides a powerful method for solving problems in other fields, promotes the development of multiple fields, and has made significant progress in the recognition and classification of objects. When plants are attacked by diseases, they often show relevant pathological characteristics on the leaves, stems, flowers or fruits of the plants. In general, the characteristics displayed in the leaves are the most obvious and easy to detect, so the pathological characteristics on the leaves will serve as the main source of information for detecting the degree of plant diseases. In the problem of plant disease detection, a study successfully applied deep learning technology to solve the problem of cassava disease recognition and classification, and used convolutional neural networks to realize real-time recognition and monitoring of tomato diseases. Summary of the invention

[0004] Monitoring the extent of plant diseases and identifying the types of diseases is a very significant challenge in modern agriculture, because plant diseases can cause serious economic losses and threaten food safety. With the development of artificial intelligence technology, many research works use images to detect plant diseases. Due to the difficulty in obtaining images of plant diseases, the amount of data is not sufficient. Therefore, it is particularly important to efficiently use the existing image data. In order to solve this problem, the present invention proposes an efficient network structure (Convolutional SwinTransformer) for detecting the extent and type of diseases based on Swin Transformer. In the network model, window based self-attention, shifted window self-attention, residual structure and Convolutional Block are used to ensure that the network can efficiently learn image information. The present invention is based on the practical application value of scientific research, and is committed to studying the detection and classification of plant leaf diseases in a real environment. A method for identifying and classifying the extent and type of plant leaf diseases based on the Convolutional Swin Transformer model is proposed.

[0005] The convolutional Swin Transformer model of the present invention can efficiently utilize image information to accurately identify and classify the degree and type of plant leaf diseases. The convolutional Swin Transformer-based plant leaf disease degree and type identification and classification method includes the following steps:

[0006] The following steps are involved:

[0007] Step 1: Construct a plant leaf disease dataset: collect image data in real life or obtain public datasets from the Internet, and divide the image data into two categories according to the type and severity of the disease. The image data of each category is divided into training set and test set in proportion.

[0008] Step 2: Data preprocessing: Read the size information of each image and check whether the size meets the requirements; if it meets the size requirements, no processing is performed; if it does not meet the requirements, the image size needs to be adjusted using the bilinear interpolation method;

[0009] Step 3: Modeling step: Construct a 6-stage model structure of Convolutional Swin Transformer. Add a stage as the first stage based on the 5-stage Swin Transformer model. The first stage includes convolutional layers and region partitioning.

[0010] Step 4: Determine the training parameters: According to the total number of images in the data set and whether the background contained in the image is complex data factors in addition to the leaves to be detected, preliminarily determine the model training parameters;

[0011] Step 5: Train the model: In the PyTorch framework, feed the preprocessed dataset into the model and train it according to the hyperparameters set in step 4.

[0012] Step 6: Test the trained model using the test set divided in step 1;

[0013] Step 7: The finally obtained plant disease type classification model and plant disease severity recognition model are used to identify and classify plant disease severity and types.

[0014] In the above-mentioned convolution-based Swin Transformer plant leaf disease degree and type recognition and classification method, each category of image data is divided into a training set and a test set in a ratio of 8:2 according to the total amount of data, that is, the number of training set image data accounts for 80% of the total number, and the rest is used as a test set.

[0015] In the above-mentioned convolution-based Swin Transformer plant leaf disease degree and type recognition and classification method, each image has a size of 224×224×3, where the width and height are both 224 pixels, and each image has three channels of red, green and blue.

[0016] Through the research of the present invention, the objectives achieved are as follows:

[0017] (1) All images in the dataset are resized to 224×224×3 using bilinear interpolation, where the width and height are both 224 pixels, and each image has three channels: red, green, and blue.

[0018] (2) The dataset is divided into two categories according to the disease type and disease severity. The disease type dataset contains images of different types of plant diseases, and the degree of plant diseases is not considered in this dataset. Similarly, the plant disease severity dataset only contains images of plant diseases of different degrees, regardless of the type of plant diseases.

[0019] (3) The Convolutional Swin Transformer model was trained separately on two types of data sets to obtain two models. These two models can respectively identify the severity of plant diseases and classify the types of plant diseases.

[0020] (4) The two models have high recognition accuracy for the types and severity of plant diseases.

[0021] The advantages of the present invention are as follows: by utilizing the characteristics of deep learning, there is no need to manually extract image features. The computer only needs to send the image data into the model for training, and the computer can learn the plant leaf disease characteristics in the data set. By learning these characteristics, the type and degree of plant diseases can be accurately identified. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is the structure diagram of the Convolutional Swin Transformer model.

[0023] Figure 2 This is a graph showing test results of an embodiment.

[0024] Figure 3 Figure 2. Preliminary parameter settings for model training.

[0025] Figure 4 This is a configuration diagram for a PC. DETAILED DESCRIPTION

[0026] The present invention is described in detail below with reference to specific examples. In this implementation example, a personal PC is used as the hardware platform and is run in GPU mode. The cucumber leaf disease degree dataset, the potato leaf disease degree dataset, and a subset of the tomato dataset in the plant village dataset are used as the datasets for the example. The configuration of the PC is as follows: Figure 4 shown.

[0027] According to the present invention, a convolution-based Swin Transformer plant leaf disease degree and type recognition and classification method is provided, comprising the following steps:

[0028] Step 1: Construct a plant leaf disease dataset. In the dataset used, the cucumber leaf disease degree dataset and the potato leaf disease degree dataset are datasets that describe the degree of plant diseases, while the subset of the tomato dataset in the plant village dataset is a dataset that describes the types of plant diseases. The image data of each category is divided into training set and test set according to the ratio of 8:2 based on the total amount of data. Among them, the number of training set images accounts for 80% of the total number, and the rest is used as the test set.

[0029] Step 2: Since all image sizes in the three datasets do not meet the model requirements, bilinear interpolation is used to resize the images in all datasets to 224 × 224 × 3. The width and height are both 224 pixels, and each image has three channels: red, green, and blue.

[0030] Step 3: Modeling step: Construct a 6-stage Convolutional Swin Transformer model structure.

[0031] Step 4: Determine the training parameters: Based on the total number of images in the data set and whether the background of the image is complex in addition to the leaves to be detected, the model training parameters are preliminarily determined. The parameters used in this example are as follows: Figure 3 shown.

[0032] Step 5: Train the model. In the PyTorch framework, the preprocessed dataset is fed into the model and trained according to the hyperparameters set in step 4.

[0033] Step 6: Test the trained model using the test set divided in step 1. The test results of this example are as follows: Figure 2 As shown in the figure, the network of the present invention can identify the degree of plant diseases with an accuracy of 90.91% in a real environment, 97.53% in a stable environment, and 98.2% in the category of diseases. The experimental results prove the reliability of the network of the present invention, and can effectively use image information to detect the degree of disease and identify the type of disease.

[0034] Step 7: The finally obtained plant disease type classification model and plant disease severity recognition model are used to identify and classify plant disease severity and types.

Claims

1. A convolution-based Swin Transformer method for identifying and classifying the severity and type of plant leaf diseases, characterized by: The following steps are involved: Step 1: Construct a plant leaf disease dataset: collect image data in real life or obtain public datasets from the Internet, and divide the image data into two categories according to the type and severity of the disease. The image data of each category is divided into training set and test set in proportion. Step 2: Data preprocessing: Read the size information of each image and check whether the size meets the requirements; if it meets the size requirements, no processing is performed; if it does not meet the requirements, the image size needs to be adjusted using the bilinear interpolation method; Step 3: Modeling step: Convolutional layer and region partitioning are used as the first stage, and the Convolutional Swin Transformer 6-stage model structure is constructed based on the 5-stage Swin Transformer model; Step 4: Determine the training parameters: According to the total number of images in the data set and whether the background contained in the image is complex data factors in addition to the leaves to be detected, preliminarily determine the model training parameters; Step 5: Train the model: In the PyTorch framework, feed the preprocessed dataset into the model and train it according to the hyperparameters set in step 4. Step 6: Test the trained model using the test set divided in step 1; Step 7: The finally obtained plant disease type classification model and plant disease severity recognition model are used to identify and classify plant disease severity and types.

2. The method for identifying and classifying the degree and type of plant leaf diseases based on the convolutional Swin Transformer according to claim 1 is characterized in that: The image data of each category is divided into training set and test set in a ratio of 8:2 according to the total amount of data, that is, the number of image data in the training set accounts for 80% of the total number, and the rest is used as the test set.

3. The method for identifying and classifying the degree and type of plant leaf diseases based on the convolutional Swin Transformer according to claim 1 or 2, characterized in that: Each image has a size of 224×224×3, with a width and height of 224 pixels each, and each image has three channels: red, green, and blue.

Citation Information

Patent Citations

  • Plant leaf disease detection and classification method based on Vision Transform model

    CN115100468A