Open access peer-reviewed chapter

Image-Based Crop Leaf Disease Identification Using Convolution Encoder Networks

Written By

Indira Bharathi and Veeramani Sonai

Reviewed: 09 August 2022 Published: 21 October 2022

DOI: 10.5772/intechopen.106989

From the Annual Volume

Artificial Intelligence Annual Volume 2022

Edited by Marco Antonio Aceves Fernandez and Carlos M. Travieso-Gonzalez

Chapter metrics overview

155 Chapter Downloads

View Full Metrics

Abstract

Nowadays, agriculture plays a major role in the progress of our nation’s economy. However, the advent of various crop-related infections has a negative impact on agriculture productivity. Crop leaf disease identification plays a critical role in addressing this issue and educating farmers on how to prevent the spread of diseases in crops. Researchers have already used methodologies such as decision trees, random forests, deep neural networks, and support vector machines. In this chapter, we proposed a hybrid method using a combination of convolutional neural networks and an autoencoder for detecting crop leaf diseases. With the help of convolutional encoder networks, this chapter presents a unique methodology for detecting crop leaf infections. Using PlantVillage dataset, the model is trained to recognize crop infections based on leaf images and achieves an accuracy of 99.82%. When compared with existing work, this chapter achieves better results with a suitable selection of hyper tuning parameters of convolution neural networks.

Keywords

  • crop leaf
  • convolution neural network
  • autoencoder
  • ReLU
  • deep neural network
  • hyper tuning

1. Introduction

In agriculture, crop leaf plays an important role in giving information about the good growth of the plant. Various climatic factors affect the growth of the plant. Besides natural calamities, crop leaf disease is a major hazard to the growth of agriculture yields and economic victims. Once we fail to analyze the infections in the crops, we may lead to low pesticide usage. Therefore, crop leaf identification is considered a major issue in the biological features of diseases present in the crop. When required, expert visual inspections and biological reviews are normally carried out through plant diagnosis. This strategy, on the other hand, is usually time-consuming and ineffective. To solve these difficulties, sophisticated and intelligent systems for detecting plant diseases are required.

To provide an intelligent system to identify the crop leaf diseases, we proposed a convolution neural network with image processing methodologies such as image segmentation and filtering. In the existing works, most researchers applied conventional machine learning algorithms to predict or identify the crop diseases present in the leaf. However, machine learning algorithms better recognize the plants, weed discrimination, etc. As a result, crop leaf disease identification is critical to maintaining agricultural productivity. In general, plant leaf disease analysis is also done manually by using visual inspection. But it is time-consuming and potentially error-prone. As a result, diagnosing crop disease using automated procedures is beneficial since it reduces a significant amount of effort associated with crop monitoring on large farms, and it detects disease symptoms at an early stage, i.e., when the disease first appears. Leaf plant health monitoring and early detection of symptoms are required to limit disease transmission, which aids farmers in effective management methods.

To develop an accurate image classifier for crop leaf identification, we need image samples of damaged and healthy crops. The PlantVillage dataset has thousands of images of healthy and infected crop leaves. In this dataset, six diseases in three crop species are labeled. Hence, we use 54,306 image samples with a convolution encoder network to identify the crop leaf diseases more accurately. The main contribution of this chapter is summarized as follows:

  1. A brief review of convolution neural network has been conducted to identify diseases in several crops/plants affected by fungi, viruses, etc.

  2. Features are extracted by using an encoder, namely variational autoencoder.

  3. An effort has been made to improve the performance of CNN for identifying the crop leaf by using segmentation of the images.

The rest of the chapter is organized as follows: The literature is briefly explained in Section 2. The techniques used have been elaborated in Section 3. The results were elaborated in Section 4, and the conclusion and future work are provided in Section 5.

Advertisement

2. Related works in the literature

An existing literature survey categorized the plant diseases by using several Convolutional Neural Networks (CNN) [1, 2]. In the PlantVillage dataset, another CNN-based architecture was presented to classify disease, and it outperformed DL models such as as AlexNet, VGG-16, Inception-v3, and ResNet [3]. CNN model is also proposed in a study to classify data in tea leaves. A CNN-based approach was developed for groundnut disease categorization in a recent publication [4]. Similarly, little literature has looked at sophisticated training strategies; for example, [5] focused at the performance of AlexNet and GoogLeNet. By comparing state-of-the-art and fine-tuning techniques, comparison research was undertaken to demonstrate the importance of the fine-tuning technique.

A random forest-based classifier to identify the healthy and affected leaf is proposed [6]. The author has described the dataset creation, extraction, and training. An AlexNet classification technique is applied to detect rice leaf diseases, namely bacterial blight, brown spot as well as leaf smut [7]. In order to monitor regularly and automatic disease detection for remote sensing images was proposed [8]. Using Canny’s edge detection and machine learning algorithm, a disease identification system was proposed [9]. A convolutional neural networks-based autoencoder was used to detect crop leaf diseases. The convolution filter size of 2 × 2 and 3 ×3 gives different accuracy for the different eoches [10].

A state-of-the-art deep convolutional neural network for image classification is proposed in [11]. A DenseNet model is proposed to perform better than other models. The author proposes activation functions that perform better than ReLU on various scales [12]. For the early detection of European wheat diseases, an automatic plant disease diagnosis system is proposed [13, 14]. To increase the robustness of crop detection, a multi-target tracking algorithm is proposed [15].

In order to classify the leaf images, deep learning approaches are studied [16]. For the leaf segmentation, the images are trained using Mask Regionased Convolutional Neural Network (Mask R-CNN). The average accuracy obtained for the VGG16 images is 91.5%. Through deep learning methodologies, leaf images are classified as healthy and affected [17]. A method to dynamically analyze the images of the disease is proposed in [18]. The output is sent to the farmer, and the feedback is reflected in the model. Using the deep learning, strawberry fruits and leaves, diseases are diagnosed [18]. A convolutional Neural Network (CNN) model and Learning Vector Quantization (LVQ) algorithm-based method for tomato leaf disease detection and classification [19, 20].

To categorize the healthy and affected leaf, a deep learning model is applied over the public images [1]. For the sustainable development of arming, it is essential to use Artificial intelligence and machine learning approaches [21]. To solve the current agricultural problems, a computer vision technology is combined with deep learning model [22]. Using the images of plants, a state-of-the-art deep learning model is applied to detect disease [5, 23]. To enhance the accuracy, a depthwise separable convolution is adopted [3]. For the automatic detection of infection in the tomato leaves, an enhanced deep learning architecture is adopted over the plantVillage datase [4]. To classify the crop, a novel three-dimensional (3D) convolutional neural network (CNN) is applied over the remote sensing image [24].

Advertisement

3. Proposed hybridized convolution neural network with variational autoencoders system

In this chapter, a hybridized convolution neural network with variational autoencoders is proposed to classify the crop leaf diseases, and hence, it is named as V-Convolution encoder network. To extract the informative features of the leaf, we used an autoencoder. It is a type of neural network, which is useful for outperforming two functions, namely encoding and decoding. An encoding part plays a role in extracting the high-dimensional features of the leaf, and the decoding part reconstructs the inputs taken. In general, all CNN consists of three important layers, namely encoder layers, max or min – pooling layers, and fully connected layers, as shown in Figure 1.

Figure 1.

Proposed architeure.

3.1 Building blocks of CNN

The convolutional layer is the core part of a convolutional network that contains a structure of learnable channels. In the forward pass, the width and height information of the images is passed over each channel, and the product of kernel and image pixels is calculated. In the backward pass, the gradient of the loss with corresponds to input, weight, and bias is computed. The various levels of filters are used to extract the needed features from the matrix of original images taken. As the filter levels go in deep, we can solve a more specific problem. To hold the important features, zero padding is added across the image matrix.

The ReLU activation function is used within the convolution layer, which adds nonlinearity to the network. It calculates the weighted informative features faster than the tangent or sigmoidal function. Next is the max pooling layer, which increases a pooling layer in the midstream of several convolutional layers. Its skill is to vigorously decrease the spatial size of the image to minimize the size of parameters and calculation and consequently to control overfitting. When the image size is large, the pooling layer reduces the number of training features. The important significance of adding pooling layers is to lessen the spatial size of the input image. Here, min-max pooling is used in our implementation. After the pooling layer, the fully connected layer is essential to produce an output equivalent to the number of classes that we want as output. In this, the annihilation of neurons is done, and we gain a vector of all neurons. In such a layer, all neurons are fully connected with neurons in the previous layer. At last softmax layer is used to calculate the probabilities should be in the range 0–1, and the summation of all probabilities is 1.

3.2 Variational autoencoder

Variational autoencoder is proposed to extract the features of given input images. It is a neural organization that is intended for unsupervised learning. It comprises two sections: encoder and decoder. The encoder means to encode input highlights into encoding vectors, while the decoder acquires the yield highlights back from the encoding vector. The encoder is planned so that the result produces a variable, which is a compressed form of the input. On the other side, the decoder decompresses the resultant images back to their original size. The difference between autoencoder and variation autoencoder is that the autoencoder represents the features by applying the function, whereas the variational autoencoder represents the features by calculating the probability distribution. This encoder is designed based on the principle of a neural network that gives q of input as p of output. In a probability distribution model, this network parameterizes the inaccurate features of the input images q and produces the result as a distribution of x (p | q). This variational decoder then reconstructs the input samples p such that it produces parameters to the distribution y (p | q). This model consists of two phases, namely feature learning and classifier. The learning of features is done in an unsupervised network, whereas the leaf diseases are classified by training the samples using a CNN classifier. The overall architecture of the proposed system is shown in Figure 1.

To perform the crop leaf disease identification, we have considered the PlantVillage dataset. To improve the performance of the proposed system, the segmentation process is performed on the original data samples before feature learning (Table 1).

We acquired our results based on the training and testing sample listed in Table 2. For classification, we considered different types of crop diseases from tomato leaves. Table 1 describes the various crop and their diseases. It has six different classes, ranging from 1 to 6. The proposed network has been trained to recognize crop infections based on leaf images. Different convolution filter levels are used in the proposed work, and to train the network more efficiently, ReLU activation function is used. It was shown that the proposed architecture achieved better accuracy for various epochs and convolution filter sizes. We applied additional convolution layers with 128 filters and filtered size 2 × 2 with ReLU. It is then followed by two additional convolution layers with 256 filters and filter size 2 × 2 with ReLU. After all this, a flattening layer is used to acquire a vector of neurons that uses ReLU function. Then two dense layers are used: one uses ReLU, while the other uses the softmax function and depicts the output class.

ClassDiseasesCrop
0Bacterial_spotPepper, Tomato
1Target_SpotTomato
2Early_blightPotato, Tomato
3Late_BlightPotato, Tomato
4Leaf_MoldTomato
5mosaic_virusTomato
6HealthyAll (Pepper, Potato and Tomato)

Table 1.

Classes of various crop diseases.

Advertisement

4. Results and discussion

The proposed system is implemented by using Python Scikit-learn packages and is executed using the Intel i5 processor. The proposed approach is evaluated by using the PlantVillage dataset [25]. The testing and training used for the leaf image dataset are illustrated in Table 2. The following performance parameters have been considered for our implementation, namely precision, recall, and F1-score. The results are taken with different values of epochs, and it is compared with existing approaches. By varying the epochs, the error in the testing and training sample is plotted in Figure 2.

PlantVillage Dataset
Classes of Tomato leafsLabel_NameDisease typeSample images
TrainingValidationTesting
Tomato_Target_SpotTom_targetFungi994270140
Tomato_mosaic_virusTom_mosaicvirus2667037
Tomato_YellowLeaf_Curly_VirusTom_curlyvirus37861071500
Tomato_Bacterial_SpotTom_bactBacteria1494420219
Tomato_Early_BlightTom_EBlightFungi250150100
Tomato_HealthyTom_Hlthy1128310153
Tomato_Late_BlightTom_LBlightBacteria700200100
Tomato_Leaf_MoldTom-moldFungi66719590
Tomato_Septoria_leaf_spotTom_septoFungi1247354170
Tomato_Spider_mitesTom_spiderMite1181330165

Table 2.

Training, test, and validation values used for each category of data sets.

Figure 2.

Comparison of training and testing error with various epoches.

We achieved 98% of accuracy if the network is iterated for 150 epochs. It is also observed that as the filter size increases, we get 100% accuracy. Table 2 shows the training and testing accuracy for the different convolutional filter sizes such as 2 × 2 and 3 × 3. The best training accuracy for the 2 × 2 filter size is 97.21, and the best testing accuracy is 87.12 for filter size 2 × 2. When compared with existing work, this paper achieves better results with a suitable selection of hyper tuning parameters of a convolution neural network (Table 3).

EpochsConvolution filterTraining accuracyTesting accuracy
1002 *295.382.71
1003*398.3485.45
1502*292.2187.12
1503*397.7384.78
2002*294.6780.71
2003*395.1881.1

Table 3.

Training and testing accuracy for different filters.

The performance of the resulting implementation is illustrated in the Figure 3. Figure 4 shows the comparison of the proposed classifier and existing classifier approaches. The proposed CNN approach shows superior performance in terms of accuracy compared with other existing approaches (Table 4).

Figure 3.

Comparison of various performance parameters.

Figure 4.

Accuracy comparison of various classifier.

No. of EpochsPerformance metricsProposed method
Tom_targetTom_mosaicTom_curlyTom_bactTom_EBlightTom_HlthyTom_LBlightTom-moldTom_septoTom_spider
100Precision0.940.930.940.930.900.890.960.930.930.85
Recall0.920.940.930.920.910.910.940.940.920.84
F1-Score0.920.920.930.930.910.910.940.940.920.87
Accuracy0.950.950.930.930.910.920.950.930.910.89
150Precision0.940.970.960.960.930.910.980.960.950.99
Recall0.930.960.960.950.920.910.960.960.940.97
F1-Score0.920.960.950.940.920.930.950.950.950.97
Accuracy0.950.980.950.950.940.940.970.950.960.97
200Precision0.930.950.960.940.920.900.960.940.940.99
Recall0.930.950.950.930.920.890.940.940.930.97
F1-Score0.920.960.950.930.920.890.960.960.930.97
Accuracy0.920.960.950.950.910.890.950.940.930.97

Table 4.

Precision, Recall, F1-score, and Accuracy value of various datasets.

Advertisement

5. Conclusion and future work

Crop leaf diseases have been responsible for reducing production resulting in economic causes. Recently, the crop leaf has been facing several diseases from various insects and pests. This chapter proposes a unique methodology for detecting crop leaf infections. With the PlantVillage dataset, the model is trained to recognize crop infections based on leaf images and achieves an accuracy of 99.82%. This chapter presented a feature selection algorithm to identify essential features from crop leaf images. The chosen features are given to the hybrid method using a combination of convolutional neural networks and autoencoders. Among all the existing classifiers, the proposed approach shows an average of 84.54% of execution time improvement in performing the classification. This work can be enhanced further to give the recommendation to the farmer to apply proper insecticides prior to the spread of such diseases.

References

  1. 1. Kulkarni O. Crop disease detection using deep learning. In: IEEE Fourth International Conference on Computing Communication Control and Automation (ICCUBEA). New York: IEEE; 2018. pp. 1-4
  2. 2. Kaushik M, Prakash P, Ajay R, Veni S. Tomato leaf disease detection using convolutional neural network with data augmentation. In: IEEE 2020 5th International Conference on Communication and Electronics Systems (ICCES). New York: IEEE; 2020. pp. 1125-1132
  3. 3. Kamal K, Yin Z, et al. Depthwise separable convolution architectures for plant disease classification. Computers and Electronics in Agriculture. 2019;165:104948
  4. 4. Karthik R, Hariharan M, Anand S, Mathikshara P, Johnson A. Attention embedded residual CNN for disease detection in tomato leaves. Applied Soft Computing. 2020;86:105933
  5. 5. Bedi P, Gole P, Agarwal SK. Using deep learning for image-based plant disease detection. In: Internet of Things and Machine Learning in Agriculture. Lausanne, Switzerland: Frontiers; 2021. pp. 369-402
  6. 6. Maniyath SR, Ram H. Plant disease detection using machine learning. In: IEEE International Conference on Design Innovations for 3Cs Compute Communicate Control (ICDI3C). New York: IEEE; 2018. pp. 41-45
  7. 7. Matin MH, Uddin MS. An efficient disease detection technique of Rice leaf using AlexNet. Journal of Computer and Communications. 2020;8(12):4
  8. 8. Badage A. Crop disease detection using machine learning: Indian Agriculture. International Research Journal of Engineering and Technology. 2018;5(9):866-869
  9. 9. Kranth PR, Lalitha H, Basava L, Mathur A. Plant disease prediction using machine learning algorithm. International Journal of Computer Applications. 2018;182(25):41-45
  10. 10. Khamparia A, Saini G, Gupta D, Khanna A, Tiwari S. Seasonal crops disease prediction and classification using deep convolutional encoder network. Circuits, Systems and Signal Processing. 2020;39:818-836
  11. 11. Too EC, Yujian L, Njuki S, Yingchun L. A comparative study of fine-tuning deep learning models for plant disease identification. Computers and Electronics in Agriculture. 2018;22:135-152
  12. 12. Qian S, Liu H, Liu C, Wu S, Wong HS. Adaptive activation functions in convolutional neural networks. Neurocomputing. 2018;272:204-212
  13. 13. Picon A, Alvarez-Gila A, Seitz M, Ortiz-Barredo A, Echazarra J, Johannes A. Deep convolutional neural networks for mobile capture device-based crop disease classification in the wild. Computational Electronic Agriculture. 2018;138:200-209
  14. 14. Lu J, Hu J, Zhao G, Mei F, Zhang C. An in-field automatic wheat disease diagnosis system. Computers and Electronics in Agriculture. 2017;142:369-379
  15. 15. Hamuda E, Mc Ginley B, Glavin M, Jones E. Improved image processing-based crop detection using Kalman filtering and the Hungarian algorithm. Computers and Electronics in Agriculture. 2018;148:37-44
  16. 16. Yang K, Zhong W. Leaf segmentation and classification with a complicated background using deep learning. Agronomy. 2020;10:1721
  17. 17. Ferentinos KP. Deep learning models for plant disease detection and diagnosis. Computers and Electronics in Agriculture. 2018;145:311-318
  18. 18. Park H, JeeSook E, Kim S-H. Crops disease diagnosing using image-based deep learning mechanism. In: International Conference on Computing and Network Communications (CoCoNet). New York: IEEE; 2018. pp. 23-26
  19. 19. Sardogan M, Tuncer A, Ozen Y. Plant leaf disease detection and classification based on CNN with LVQ algorithm. In: IEEE International Conference on Computer Science and Engineering (UBMK). New York: IEEE; 2018. pp. 382-385
  20. 20. Reddy JN, Vinod K, Ajai AR. Analysis of classification algorithms for plant leaf disease detection. In: IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT). New York: IEEE; 2019. pp. 1-6
  21. 21. Jha K, Doshi A, Patel P, Shah M. A comprehensive review on automation in agriculture using artificial intelligence. Artificial Intelligence Agriculture. 2019;2:1-12
  22. 22. Tian H, Wang T, Liu Y, Qiao X, Li Y. Computer vision technology in agricultural automation – A review. Agriculture. 2020;7(1):1-19
  23. 23. Too EC, Yujian L, Njuki S, Yingchun L. A comparative study of fine-tuning deep learning models for plant disease identification. Computers and Electronics in Agriculture. 2019;161:272-279
  24. 24. Ji S, Zhang C, Xu A, Shi Y, Duan Y. 3D convolutional neural networks for crop classification with multi-temporal remote sensing images. Remote Sensing. 2018;10(1):75-84
  25. 25. https://knowyourdata-tfds.withgoogle.com/

Written By

Indira Bharathi and Veeramani Sonai

Reviewed: 09 August 2022 Published: 21 October 2022