Computers and Electronics in Agriculture: Amreen Abbas, Sweta Jain, Mahesh Gour, Swetha Vankudothu
Computers and Electronics in Agriculture: Amreen Abbas, Sweta Jain, Mahesh Gour, Swetha Vankudothu
Original papers
A R T I C L E I N F O A B S T R A C T
Keywords: Plant diseases and pernicious insects are a considerable threat in the agriculture sector. Therefore, early
Deep learning detection and diagnosis of these diseases are essential. The ongoing development of profound deep learning
Tomato plant disease detection methods has greatly helped in the detection of plant diseases, granting a vigorous tool with exceptionally precise
Conditional Generative Adversarial Network
outcomes but the accuracy of deep learning models depends on the volume and the quality of labeled data for
Data augmentation
training. In this paper, we have proposed a deep learning-based method for tomato disease detection that utilizes
Pre-trained DesnseNet121 network
Synthetic Images the Conditional Generative Adversarial Network (C-GAN) to generate synthetic images of tomato plant leaves.
Thereafter, a DenseNet121 model is trained on synthetic and real images using transfer learning to classify the
tomato leaves images into ten categories of diseases. The proposed model has been trained and tested extensively
on publicly available PlantVillage dataset. The proposed method achieved an accuracy of 99.51%, 98.65%, and
97.11% for tomato leaf image classification into 5 classes, 7 classes, and 10 classes, respectively. The proposed
approach shows its superiority over the existing methodologies.
* Corresponding author.
E-mail address: maheshgour0704@gmail.com (M. Gour).
https://doi.org/10.1016/j.compag.2021.106279
Received 22 September 2020; Received in revised form 10 April 2021; Accepted 13 June 2021
Available online 29 June 2021
0168-1699/© 2021 Elsevier B.V. All rights reserved.
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Thereafter a DenseNet model (Huang et al., 2017) was trained on tomato Table 1
plant images and tomato synthetic images (generated by the C-GAN Summary of the literature of studies for plant diseases detection.
model) for the detection of tomato disease from the leaf images. Paper Methods Dataset Plants/ Accuracy
The paper is organized in the following manner: Section 2 contains classes
the related work about existing methods, Section 3 presents the meth Adhikari et al. YOLO internet 3 classes of 76%
odology , which includes the C-GAN model description and the (2018) images and diseases in
description of the DenseNet model, Section 4 consists of the summary of PlantVillage tomato
the dataset followed by the experimental setup and results along with plants
Fuentes et al. SSD, R-FCN, 5,000 field 9 classes of 85%
the performance comparison with the existing methos and pre-trained (2017) Faster R-CNN images diseases
CNN models. Conclusions are presented in Section 5. with VGG and and pests in
Residual tomato
2. Related work Network
Ashqar and ANN Tomato 5 classes of 99.84%
Abu-Naser PlantVillage tomato leaf
In agriculture, plant diseases cause havoc resulting in economic loss. (2018) (9,000 images) diseases
Various researchers have put forth different techniques to put a check on Zhang et al. AlexNet, Tomato 8 classes of 97.28%
these infections. Over the recent couple of years, some researchers have (2018) GoogLeNet and PlantVillage tomato leaf
ResNet (5,550 images) diseases
been using deep learning techniques like convolutional neural networks
Karthik et al. Residual Tomato 3 classes of 98%
for disease detection and classification. Akila and Deepan (2018) have (2020) learning and PlantVillage tomato
proposed a deep learning model, in which they have used Faster Region- Attention (95,999 plant
based Convolutional Neural Network (R-CNN) (Ren et al., 2015), mechanism images) diseases
Region-based Fully Convolutional Network (R-FCN) (Dai et al., 2016), Agarwal et al. CNN Network Tomato 10 classes 91.20%
(2020) PlantVillage of tomato
and Single Shot Detector (SSD) (Liu et al., 2016) for plant disease
(17,500 plant
detection. Their dataset consists of images of fruit plants, vegetable images) diseases
crops, cereal crops, and cash crops. They have applied several image Durmuş et al. AlexNet and Tomato 10 classes 95.65%
augmentation techniques like image rotations, brightness adjustment, (2017) SqueezeNet PlantVillage of tomato
plant
perspective transformation, and affine transformation.
diseases
Adhikari et al. (2018) have proposed a model to detect plant disease Elhassouny and MobileNet Tomato 10 classes 90.3%
automatically, especially for the tomato plant using image processing. Smarandache PlantVillage of tomato
The dataset consisted of images of three types of tomato plant diseases, (2019) plant
including Gray spot, Late Blight, and Bacterial Canker. Some of the diseases
Widiyanto et al. CNN Tomato 5 classes of 96.6%
images were extracted from the Internet, and some were captured from
(2019) PlantVillage tomato
the firm using camera devices. The designed CNN model consisted of 24 plant
convolutional layers and two fully connected layers. The structure is diseases
designed based on the standard YOLO (You Only Look Once) model
(Redmon et al., 2016). The overall accuracy of the model was 89% on
the PlantVillage dataset and 76% when they used their own dataset. of 94.3%. Karthik et al. (2020) have used two deep learning architec
Fuentes et al. (2017) have proposed a system that is capable of dis tures on PlantVillage dataset to detect 3 diseases in tomato plants,
tinguishing nine sorts of maladies and bugs in tomato plants. It detects namely, early blight, late blight, and leaf mold. In the first architecture,
disease class as well as the location of the disease. Images of plants in feed-forward CNN is used along with residual learning and in the second
fields were taken using camera devices. Three detectors, namely R-FCN, architecture, they have used CNN along with the attention mechanism
Faster R-CNN, and SSD were combined with feature extractors like VGG- and residual learning. The attention-based residual CNN architecture
16 and ResNet50 Network. When Faster R-CNN was used with VGG-16 presented a highest accuracy of 98%. Agarwal et al. (2020) have
(Simonyan and Zisserman, 2014), the model had a mAP (mean Average developed a CNN model, consisting of 3 convolutional, 3 max-pooling,
Precision) of 83%, and when it was used with ResNet-50, the model and 2 fully connected layers to detect 10 classes (9 diseases and 1
achieved a mAP of 75.37%. Contrary to it, when SSD was used with healthy) in tomato plants that achieved an overall accuracy of 91.2% on
ResNet-50, the model had a mAP of 82.53%, and when R-FCN was used the PlantVillage dataset. Elhassouny and Smarandache (2019) have
with ResNet-50, the model achieved a mAP of 85.98%. developed a smart mobile application to classify 9 diseases of tomato
Ashqar and Abu-Naser (2018) have developed a CNN model to plant using MobileNet (Howard et al., 2017). The application used 7,176
identify five diseases of tomato plants namely bacterial spot, early tomato leaf images from PlantVillage dataset for the disease classifica
blight, septoria leaf spot, leaf mold and yellow leaf curl virus. Their tion. They have achieved an accuracy of 90.3%. Widiyanto et al. (2019)
model consisted of four convolutional layers. ReLU (Rectified Linear developed a CNN model to identify 4 diseases in tomato plants namely
Unit) activation function was used, and each convolutional layer was Late blight, Septoria leaf spot, Mosaic virus and Yellowleaf curl virus
followed by a max-pooling layer. They have used 9,000 images from the along with healthy leaves. The author trained the model on 1,000 im
PlantVillage dataset. Their model achieved an accuracy of 99.84% when ages per class obtained from PlantVillage dataset. The overall classifi
it was trained on full-color images and an accuracy of 95.54% when it cation accuracy achieved for 5 classes was 96.6%.
was trained on gray-scale images. Zhang et al. (2018) have proposed a Table 1 represents the summary of the different deep learning ap
CNN model to distinguish 8 types of tomato leaf illness by utilizing proaches that have been used in the literature for the detection and
transfer learning. The pre-trained models used in the study were Alex classification of tomato plant diseases.
Net, GoogLeNet, and ResNet. The dataset was taken from an open access
repository (PlantVillage) containing plant images. The model achieved 3. Methodology
the highest accuracy of 97.28% when the ResNet network was used with
SGD (Stochastic Gradient Descent). In this section, we will discuss the proposed method. The Block di
Similarly, Durmuş et al. (2017) have used AlexNet and SqueezeNet to agram of the proposed method is shown in Fig. 1. The proposed
classify the tomato plant images into 10 classes (9 diseases and 1 approach can be divided into two parts; in the first part, synthetic im
healthy). On the PlantVillage dataset, the AlexNet model achieved an ages have been generated using C-GAN for data augmentation. In the
accuracy of 95.65%, while the SqueezeNet model achieved an accuracy second part, a pre-trained DenseNet121 model has been fine-tuned on
2
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Table 2 Table 3
Summary of C-GAN Discriminator model. Summary of C-GAN Generator model.
Layer Name Type Parameter/Filter size Layer Name Type Parameter/Filter size
C-GAN discriminator model consists of an input layer, an embedding In the proposed approach, we have used C-GAN for generating syn
layer, and a dense layer followed by an input layer, reshape layer, and thetic tomato leaf images of various diseases. For generating synthetic
concatenate layer, which is in turn followed by four convolutional images from the C-GAN model, we first trained it on the tomato images.
layers. Each convolutional layer is followed by a Leaky ReLU layer. The
Let given tomato disease leaf dataset DS = {(I(n) , L(n) ) }Nn=1 , where I(n)
last Leaky ReLU layer is followed by a flatten layer, a dropout layer, and
represents a given image and L(n) ∈ {0, 1, …, 9}, represents its corre
a dense layer. The model consists of a total of 771,454 trainable pa
rameters. The network layers and parameters of discriminator model are sponding label. To train C-GAN, a real tomato image I(n) with corre
represented in Table 2. sponding label L(n) is given as input to the discriminator model;
The C-GAN generator model consists of input layers and a dense simultaneously, a noise and a label L(n) is given to the generator model.
layer followed by an embedding layer and a Leaky ReLU layer which is Then the generator model generates tomato fake image If and now
in turn followed by dense, reshape and concatenate layers. The generated fake image If is also given to the discriminator model.
3
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
learning for tomato plant disease detection from tomato leaf images. The
Table 4
detailed description of DenseNet architecture is given as follows:
Summary of DenseNet121 model.
DenseNet Architecture: DenseNet is a deep architecture in which
Layer Name Output size Parameter/Filter size each layer is connected to every other layer in a feed-forward manner.
Convolution 112 × 112 7 × 7 conv, stride 2 DenseNet differs from ResNet (He et al., 2016) in the manner of a
Pooling 56 × 56 3 × 3 max pool, stride 2 combination of features that take place at a layer before they are passed
Dense block (1) 56 × 56 [1 × 1 conv, 3 × 3 conv × 6] on to the next layers. In ResNet, the features are combined through
Transition layer (1) 56 × 56 1 × 1 conv summation while in DenseNet, the features are combined by concate
28 × 28 2 × 2 average pool, stride 2 nating them. Other convolutional networks have l connections for l
Dense block (2) 28 × 28 [1 × 1 conv, 3 × 3 conv × 12] layers whereas DenseNet has l(l + 1)/2 connections for l layers. In
Transition layer (2) 28 × 28 1 × 1 conv DenseNet, inputs of each layer are the feature-maps of previous layers,
14 × 14 2 × 2 average pool, stride 2 and subsequently, the feature-maps of a layer are used as inputs in the
Dense block (3) 14 × 14 [1 × 1 conv, 3 × 3 conv × 24] succeeding layers (Huang et al., 2017).
Transition layer (3) 14 × 14 1 × 1 conv The architecture of DenseNet121 model is represented in Fig. 2 and
7× 7 2 × 2 average pool, stride 2
the description of different layers of the model is represented in Table 4.
Dense block (4) 7× 7 [1 × 1 conv, 3 × 3 conv × 16]
It consists of 4 dense blocks that take 224 × 224 pixels image as input.
Additional convolution layer 7× 7 [3 × 3 conv, 3 × 3 conv]
The first convolution layer consists of 2000 convolutions of size 7 × 7
Classification layer 1× 1 7 × 7 global average pool
with stride 2, which is followed by a 3 × 3 max pooling layer with stride
10D fully connected, softmax
2. The pooling layer is followed by three dense blocks with each dense
block being followed by a transition layer. The fourth dense block is
Thereafter, the discriminator tries to distinguish between fake and real followed by a classification layer. The dense blocks consist of batch
images. This way, C-GAN has been trained on the tomato leaf images. normalization, ReLU and convolutional layers. The transition layer
After successful completion of the training of C-GAN, we have obtained consists of 1 × 1 convolution layer followed by 2 × 2 average pooling
synthetic images of tomato leaves corresponding to each disease layer with stride 2.
category. DenseNet Fine-tuning: In order to fine-tune the pre-trained Den
seNet model on the tomato leaf images, the top Fully-connected layer,
and Softmax layer have been removed from the network, and two new
3.2. Tomato plant disease detection with DenseNet model Convolutional layers with ReLU activation function, an Average pooling
layer, a Fully-connected layer, and a Softmax layer have been added in
The pre-trained Dense Convolutional Network (DenseNet) has been the network. The weights of the first 410 layers have been initialized
trained on CIFAR-10, CIFAR-100, SVHN, and ImageNet datasets (Huang with pre-trained imagenet weights, and the remaining layers’ weights
et al., 2017). It has achieved promising results for object recognition have been learned during the training. The model has been trained for
tasks. In this study, we used the DenseNet121 model using transfer 100 epochs with a learning rate of 0.0001 and a batch size of 32, with
the weights being updated using Adam’s optimizer (Kingma and Ba,
Table 5 2014). We have experimentally found these are the best suitable values
Class-wise image distribution of the tomato PlantVillage dataset. of hyperparameter for our application. For the training of the DenseNet
model, generated synthetic images of tomato leaves and images from the
Category Number of images
tomato PlantVillage dataset (Hughes et al., 2015) have been combinedly
Tomato Yellow Leaf Curl Virus (YLCV) 3209
used.
Tomato Bacterial Spot (Bctsp) 2127
Tomato Late Blight (TLB) 1909
Tomato Septoria leaf spot (SptL) 1771 4. Implementation and result
Tomato Two Spotted Spider Mite (SpdM) 1676
Tomato Target Spot (TTS) 1404 This section presents the implementation details of the proposed
Tomato Early Blight (TEB) 1000
method and the results analysis. Section 4.1 contains description of the
Tomato Leaf Mold (LMld) 952
Tomato Mosaic Virus (MscV) 373 dataset, followed by experiment setup represented in Section 4.2. The
Tomato healthy (Hlth) 1591 results of the proposed method and performance comparison with
Total 16012 existing methodologies is presented in Section 4.3.
4
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
4.1. Dataset training set for 300 epochs to generate synthetic leaf images of tomato
for each of the ten categories. The weights of the generator and
In order to evaluate the performance of the proposed approach, a discriminator model were updated after each epoch to generate syn
publicly available tomato PlantVillage dataset (Hughes et al., 2015) has thetic images as close to real images as possible. At the end of the
been used in the experiments. PlantVillage dataset consists of 16,012 training of the network, we have generated 4,000 synthetic images of
images of tomato plant leaves of ten classes. Out of ten classes, nine tomato leaves from the C-GAN model. In the second set of experiments,
categories are of tomato plant leaf diseases, and one category is for the pre-trained DenseNet model has been trained on the original training
healthy leaves. The classes of the PlantVillage dataset and class-wise set as well as on the combination of the training set (from the Plant
image distribution is represented in Table 5. We have used abbrevia Village) and generated synthetic tomato leaf images.
tions of class names, which are also shown in Table 5. All the images of To evaluate the performance of the proposed approach, we have used
the dataset have been resized to 224 × 224 for faster computations. We various performance metrics like accuracy, precision, recall, F1-score,
have divided the dataset into training set, validation set and test set in and confusion matrix.
the ratio of 60:10:30 with the consideration of no overlapping between
TP + TN
the three sets. The training set and the validation set have been used Accuracy = (2)
TP + TN + FP + FN
during the network training, and the test set has been used for perfor
mance assessment of the model. TP
Precision = (3)
TP + FP
4.2. Experiment setup and evaluation metrics
TP
Recall = (4)
In this study, two sets of experiments have been performed. In the TP + FN
first set of experiments, the C-GAN model has been trained on the
5
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Table 6 Table 7
PSNR values between original images and between original and GAN images for Inception score of original images and C-GAN images for 10
10 classes. classes.
Class PSNR b/w original PSNR b/w original and C-GAN Image type Mean Inception score
images (dB) images (dB)
Original images 2.558 ± 0.189
Yellow leaf curl 28.047 28.117 C-GAN images 2.835 ± 0.228
virus
Septoria leaf spot 27.894 28.320
Two spotted spider 28.013 28.505
mite
Table 8
Bacterial spot 27.987 28.304
Accuracy, Precision, Recall, and F1-score for the model with and without
Leaf mold 27.901 27.924
Mosaic virus 27.894 27.920 augmentation.
Target spot 27.919 28.026 Model Accuracy Precision Recall F1-
Early blight 28.294 27.895 score
Late blight 27.861 27.749
Healthy 27.897 28.741 5 classes
DenseNet121 98.16% 0.83 0.97 0.98
Mean 27.970 28.150 DenseNet121 + Synthetic images 99.51% 0.99 0.99 0.99
7 classes
DenseNet121 95.08% 0.94 0.94 0.94
2*TP DenseNet121 + Synthetic images 98.65% 0.98 0.99 0.98
F1 − score = (5)
2*TP + FP + FN 10 classes
DenseNet121 94.34% 0.95 0.92 0.93
where TP = True Positive, TN = True Negative, FP = False Positive and DenseNet121 + Synthetic images 97.11% 0.97 0.97 0.97
FN = False Negative.
In order to evaluate the quality of the synthetic images generated by
C-GAN, we have used image quality measures like Peak Signal-to-Noise
Table 9
Ratio (PSNR) and Inception Score (IS). Precision, Recall and F1-score for different disease classes of tomato plant.
PSNR = 20.log10 (MAX I ) − 10.log10 (MSE) (6) Class Precision Recall F1-score
6
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Fig. 4. Confusion matrix of tomato plant disease classification using proposed method.
Fig. 5. Receiver Operating Characteristic (ROC) curves of tomato plant disease classification using proposed method.
7
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Table 10 model is fine-tuned on the original tomato leaf images and synthetic
Comparison of performances of different Pre-trained Networks. images. The proposed data augmentation technique improves network
Method(s) PlantVillage PlantVillage þ Synthetic images generalizability and prevents it from the over-fitting problem. The
proposed model achieves an accuracy of 98.16%, 95.08%, 94.34%, on
VGG19 89.60 90.90
ResNet50 76.90 80.00 the original PlantVillage dataset for 5-class classification, 7-class, and
Inception-V3 82.10 84.90 10-class classification tasks, respectively, and it achieves an accuracy of
Xception 92.20 95.80 99.51%, 98.65%, 97.11% with the original PlantVillage + synthetic
MobileNet 91.90 94.60 images dataset for 5-class classification, 7-class, and 10-class classifi
DenseNet169 93.03 95.15
DenseNet201 93.71 95.86
cation tasks, respectively. In addition, our experiment results show the
DenseNet121 94.34 97.11 proposed method’s superiority over the existing methods.
In future work, we wanted to extend this method for disease iden
tification and classification to various parts of the plant, like fruits,
stems, and branches. We also wanted to identify the different phases of
Table 11
Comparison of result with existing models. the plant disease.
8
A. Abbas et al. Computers and Electronics in Agriculture 187 (2021) 106279
Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q., 2017. Densely connected Rangarajan, A.K., Purushothaman, R., Ramesh, A., 2018. Tomato crop disease
convolutional networks. In: Proceedings of the IEEE Conference on Computer Vision classification using pre-trained deep learning algorithm. Procedia Comput. Sci. 133,
and Pattern Recognition, pp. 4700–4708. 1040–1047.
Hughes, D., Salathé, M., et al., 2015. An open access repository of images on plant health Redmon, J., Divvala, S., Girshick, R., Farhadi, A., 2016. You only look once: Unified,
to enable the development of mobile disease diagnostics, arXiv preprint arXiv: real-time object detection, in. In: Proceedings of the IEEE Conference on Computer
1511.08060. Vision and Pattern Recognition, pp. 779–788.
Karthik, R., Hariharan, M., Anand, S., Mathikshara, P., Johnson, A., Menaka, R., 2020. Ren, S., He, K., Girshick, R., Sun, J., 2015. Faster r-cnn: Towards real-time object
Attention embedded residual cnn for disease detection in tomato leaves. Appl. Soft detection with region proposal networks. In: Advances in Neural Information
Comput. 86, 105933. Processing Systems, pp. 91–99.
Kingma, D.P., Ba, J., 2014. Adam: A method for stochastic optimization, arXiv preprint Savary, S., Ficke, A., Aubertot, J.-N., Hollier, C., 2012. Crop losses due to diseases and
arXiv:1412.6980. their implications for global food production losses and food security.
Krizhevsky, A., Sutskever, I., Hinton, G.E., 2012. Imagenet classification with deep Simonyan, K., Zisserman, A., 2014. Very deep convolutional networks for large-scale
convolutional neural networks. In: Advances in Neural Information Processing image recognition, arXiv preprint arXiv:1409.1556.
Systems, pp. 1097–1105. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z., 2016. Rethinking the
Krizhevsky, A., Sutskever, I., Hinton, G.E., 2012. Imagenet classification with deep inception architecture for computer vision, in. In: Proceedings of the IEEE
convolutional neural networks. In: Pereira, F., Burges, C.J.C., Bottou, L., Conference on Computer Vision and Pattern Recognition, pp. 2818–2826.
Weinberger, K.Q. (Eds.), Advances in Neural Information Processing Systems 25. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z., 2016. Rethinking the
Curran Associates, Inc., pp. 1097–1105 inception architecture for computer vision, in. In: Proceedings of the IEEE
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., Berg, A.C., 2016. Ssd: Conference on Computer Vision and Pattern Recognition, pp. 2818–2826.
Single shot multibox detector. In: European Conference on Computer Vision. Widiyanto, S., Fitrianto, R., Wardani, D.T., 2019. Implementation of convolutional
Springer, pp. 21–37. neural network method for classification of diseases in tomato leaves. In: 2019
Mirza, M., Osindero, S., 2014. Conditional generative adversarial nets, arXiv preprint Fourth International Conference on Informatics and Computing (ICIC). IEEE,
arXiv:1411.1784. pp. 1–5.
Zhang, K., Wu, Q., Liu, A., Meng, X., 2018. Can deep learning identify tomato leaf
disease? Adv. Multimedia.