Crop Disease and Pest Identification System Based on Deep Learning

1 Introduction

Today, I would like to introduce to you a graduation design project to help previous students complete, a crop disease and pest identification system based on deep learning .

ABSTRACT

Timely and accurate diagnosis of plant diseases plays an important role in preventing the loss of agricultural production and the loss or reduction of agricultural products. To solve this kind of problems, machine learning based methods can be used. In recent years, deep learning, which is especially widely used in image processing, has opened up many new applications for precision agriculture. In this study, we utilize nine different approaches with powerful deep neural network architectures to evaluate the performance results of plant disease detection. Transfer learning and deep feature extraction methods are employed to adapt these deep learning models to the problem at hand. In this work, we consider utilizing the pre-processed deep model for feature extraction and further fine-tuning. The features obtained by deep feature extraction are classified by support vector machine (SVM), extreme learning machine (ELM) and k-nearest neighbor (KNN) methods. The data used in the experiments included images of real diseases and pests from Turkey. Accuracy, sensitivity, specificity, and f1-scores were calculated for performance evaluation. Evaluation results show that deep feature extraction and SVM/ELM classification outperform transfer learning. Furthermore, the fc6 layer of the AlexNet, VGG16 and VGG19 models yielded better accuracy scores compared to the other layers.

Keywords : Plant pest detection, convolutional neural network , deep learning architecture, feature extraction, classifier method

Introduction

In plants, signs of disease usually occur on leaves, fruit, buds and young shoots. This situation can lead to fruit being wasted (dropped) or damaged. Furthermore, these diseases lead to the spread of new infections and diseases, such as seasonal conditions. Therefore, it is very important to identify the disease in advance and take the necessary preventive measures before the disease spreads to other trees. Therefore, combating plant pests and diseases is the single most important issue in agriculture[1-3]

There are many types of diseases that affect plants, each of which can cause economic, social and ecological losses. In this context, timely and accurate diagnosis of plant diseases plays an important role in preventing the loss of yield and quantity of agricultural products. Detection of plant diseases is usually performed manually. These processes are carried out by specialists such as botanists and agricultural engineers, first by visual inspection and then in a laboratory setting. These traditional methods are often time-consuming and complicated procedures [1,3]. For these reasons, automatic identification of diseases based on image processing and machine learning has become very important. Automated diagnosis of plant diseases by visual inspection can be of great help to users who have little or no knowledge of the produce being grown.

There are many studies in the literature regarding the detection of plant diseases. In the past decade, these studies are often based on the classification process, using features such as color, shape, texture, etc. [4-7,9,9,10]. The main disadvantages of methods based on these properties are:

• Very low performance when used alone, although attempts have been made to improve performance through combinations of several methods.

• Requires the use of a segmented approach, meaning that the plant must be separated from its roots to extract geometric and similar features.

• Use datasets containing images that are difficult to obtain in real life

For these reasons, such systems and methods cannot be used in real life. In recent years, deep convolutional neural networks (CNNs) have made remarkable progress in the fields of visual objects and machine learning. For these regions, one of the biggest advantages of the improved model and method is that feature extraction can be performed without segmentation methods . Therefore, these methods and models can be easily applied in practical applications

As a basic deep learning tool, CNN has achieved remarkable success in several researches on plant disease detection. Amara et al. [11] used the LeNet architecture as a convolutional neural network to classify image datasets, including the ability to compare healthy and diseased banana leaves. These are evaluated with deep models fine-tuned by transfer learning. Mohanty et al. used a dataset of 54,306 images of diseased and healthy plant leaves. Their performance was evaluated using deep CNN-based AlexNet and GoogleNet models to identify 14 crop species and 26 diseases. Fujita et al. have developed a new practical plant disease detection system consisting of seven disease types. Using a CNN-based classification system, they achieved an average accuracy of 82.3% under a four-fold cross-validation strategy. Sladojevic et al. proposed a new method for identifying 13 different types of plant diseases using deep convolutional networks. Fuentes et al. develop a powerful deep learning-based detector that can identify nine different tomato pests and diseases in real time

In this paper, a plant pest detection system based on deep neural network is proposed. In this study, we used a dataset of images of real plant pests and diseases from Turkey. First, we use this dataset for deep feature extraction based on deep learning architectures: AlexNet, VGG16, VGG19, GoogleNet, ResNet50, ResNet101, InceptionV3, InceptionResNetV2, and SqueezeNet. The deep features obtained by these models are classified using SVM, ELM and KNN. Then, we fine-tune using a deep learning model based on transfer learning. We remove the last three layers of the architecture, and then add new layers, employing pre-trained CNNs to solve this problem. Finally, we evaluate the performance results using transfer learning and deep feature extraction methods. The main contributions of the plant disease classification method proposed in this paper are as follows:

• Classification of plant pests and diseases using images is problematic for machine learning. To classify these images, various methods have been proposed in the literature. Currently, deep learning methods are a phenomenon of machine learning, and various deep learning networks have been proposed in the supervised learning literature. In this paper, using transfer learning and deep feature extraction technology, nine commonly used deep learning networks for plant diseases and insect pests (AlexNet, GoogleNet, VGG16, VGG19, ResNet50, ResNet101, InceptionV3, Inception ResNetV2 and SqueezeNet) were studied, and the results were compared. general discussion

• This work proposes a new classification architecture using preconditioned deep learning networks and traditional classifiers. Nine deep learning networks are also used for feature extraction. Features of different sizes can be extracted using these networks. The classification phase uses traditional classifiers SVM, ELM, and KNN for 10 times of cross-validation. The results show that this architecture achieves higher classification accuracy than transfer learning based networks.

• The proposed architecture has lower computational complexity than transfer learning based models. This is demonstrated by calculations of execution times.

• In the literature, studies are often performed using synthetic images of plant pests. In this study, we used a dataset consisting of images of real plant pests and diseases in 1965, divided into 8 clusters. Tested on this dataset, the results clearly demonstrate that the method can be used for practical applications.

The research organization is as follows. The proposed approach is given in detail in Section 2, while the proposed architecture is presented in Section 3. Section IV presents the experimental work and results. Finally, in Section 5, the results are discussed and the contributions of the study are presented.

2. Materials and methods

This section details the theoretical background of this paper, related algorithms, datasets, and recommended methods under appropriate subheadings.

2.1. Deep learning and pretrained CNN models

Deep learning is a form of machine learning technique that uses a computational model consisting of multiple processing layers to learn features of data [16]. Due to the remarkably high achievements of deep learning in areas such as classification and recognition, interest in this subject has increased. In recent years, these methods have been applied in many fields, such as speech recognition, visual object recognition, and object detection. Although the first studies in deep learning have a long history, the main reason for its success in recent years is the generation of big data and faster computers with large-scale memory

This study evaluates the performance of the plant disease recognition problem by trying different approaches of the nine most powerful deep neural network architectures. These deep learning architectures are trained on a subset of the ImageNet database. The AlexNet architecture is a deep learning algorithm with 25 layers and can train weights on 8 layers [19]. The GoogleNet architecture is based on the method in the network, using architectural modules to use multiple convolutions in parallel to extract various feature points [20, 21]. The VGG network proposed by the Oxford Visual Geometry Group (VGG) is a homogeneous architecture for achieving better results in the ILSVRC-2014 competition [22]. The ResNet network was developed by He et al. to train deeper networks [23]. The architecture is based on microarchitecture modules, which is different from traditional continuous network architectures such as VGGNet and AlexNet. The Inception network is a convolutional neural network model proposed by Szegedy et al. [21]. The network consists of a large number of convolution and max pooling steps. In the final stage, it has a fully connected neural network. The InceptionResNetV2 network [24] is based on an inction-based network structure and residual connections. InceptionResNetV2 performs almost identically to the Inception architecture, but this architecture achieves significant speedups in training using residual connections [25]. SqueezeNet is an intelligent architecture developed by Landola et al., which achieves AlexNet-level accuracy on ImageNet with 50 times fewer parameters [26]. Table 1 details the characteristics of these architectures

2.2. Classifiers

In this paper, traditional classifier methods such as SVM, ELM, and KNN are used to extract deep features from specific layers of pre-trained deep learning models to build deep feature classification models.

2.2.1. K-nearest neighbor (KNN)

The KNN classifier uses a supervised learning method. This method is widely used in fields such as machine learning, image processing, and statistical estimation. This method is an algorithm that classifies existing learning data when new data is input. The principle of this approach is to assign new data inputs to the closest clusters in the previously established sample set. The distance between these two data points is calculated by using various distance functions. The most famous functions are Euclidean distance, Minkowski distance, and Manhattan distance. In addition, the biggest advantage of this method is that the application is simple and easy to understand [27,28]

2.2.2. Support vector machine (SVM)

SVM is a method developed by Vapnik based on statistical learning theory [29]. The goal of the support vector machine method is to have a linear discriminant function with the largest marginal value that can separate the classes. The learning data closest to the hyperplane are called support vectors. Support vector machines can classify datasets as linearly differentiable and indistinguishable [30]. This classifier has been successfully applied to solve problems in many fields such as image and object recognition, speech recognition, fingerprint recognition, and handwriting recognition [29-31].

2.2.3. Extreme learning machine (ELM)

ELM is a learning algorithm for single hidden layer feed-forward networks (SLFNs) proposed by Huang et al. In ELM, the output weights are calculated using the least squares method, while the hidden layer weights are randomly generated [33]. The ELM model is shown in formula (1).

2.3. Dataset

The dataset used to test the performance of the method included images of common plant diseases in the Malatya, Bingöl, and Elazığ regions of Turkey (Fig. 1). These images were acquired with a Nikon 7200d camera. Each image in this dataset consists of a 4000×6000 resolution and three-channel (RGB) color image. Table 2 lists the names and numbers of plant diseases and insect pests in this dataset

As can be seen from Table 2, the dataset contains a total of 1965 images belonging to 8 different plant diseases. The dataset was obtained by scholars in the field of plant protection at Bingöl University and İnönü University Faculty of Agriculture in Turkey. These images were acquired on different days during the day. Also, the images of the disease use a lot of different trees

3. Proposed method

In this study, we applied deep feature extraction from each fully connected layer and transfer learning based on a pretrained deep learning architecture. The scheme of the proposed study is shown in Figures 2 and 3. Transfer learning and deep feature extraction are detailed in the following subsections

3.1. Transfer learning

Transfer learning is a machine learning method that is reused as a starting point to solve different problems by using the knowledge gained from the models developed in problem solving. This study utilizes a pre-trained CNN model based on transfer learning to fine-tune it. The reason for using pre-trained CNN models is that they are faster and easier than training CNN models with randomly initialized weights [35]. Furthermore, the fine-tuning process is based on transferring new layers instead of the last three layers of the pre-trained network to our classification task, as shown in Figure 2.

3.2. Deep feature extraction

Deep feature extraction is based on extracting learned features from preconditioned convolutional neural networks. These features are used to train a machine learning classifier. In other words, the method is based on extracting deep features from fully connected layers of a pretrained network. This study extracts effective deep features from a certain level of deep learning models, namely GoogleNet, ResNet50, ResNet101, InceptionV3, InceptionResNetV2, and SqueezeNet and pool5-drop_7x7_s1, fc1000, fc1000, predictions, predictions, and pool10. Furthermore, feature vectors of 1024, 1000, 1000, 1000, 1000 and 4096 were obtained from these layers of the GoogleNet, ResNet50, ResNet101, InceptionV3, InceptionResNetV2 and SqueezeNet models, respectively. The obtained deep features are classified using traditional SVM, ELM and KNN classifiers, as shown in Figure 3.

In this study, traditional SVM, ELM, and KNN classifiers are used in the classification stage, and the deep features of the AlexNet, VGG16, and VGG19 models are obtained from these three layers, respectively, and the performance is calculated using the classifier method. The performance of each layer is then compared to determine the deep features of the best layer. In addition, 4096 feature vectors are obtained from the fc6 and fc7 layers of AlexNet, VGG16 and VGG19 models, and 1000 feature vectors are obtained from the fc8 layer of these models.

2 Design outline

This system is based on python technology, uses UML to model, adopts deep learning, django framework combination for design, and Mysql database to store data.

The functions of this system mainly include:

  1. User registration, login,
  2. information maintenance,
  3. Image Identification
  4. Pest identification
  5. deep learning
  6. image detection
  7. Target Detection

3 Key technologies of the system

Develop with python, django, mysql, deep learning

4 Development Tools

Development tools mainly include: Pycharm, Python3.8, Django3, mysql5.7, Navicat, etc.

5 code display

import os
import sys
from pathlib import Path

from django.core.wsgi import get_wsgi_application

# This allows easy placement of apps within the interior
# booksys directory.
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
sys.path.append(str(ROOT_DIR / "booksys"))
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

6 System function description

Project function demo

insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_42135426/article/details/128499822