You are on page 1of 5

2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

Comparison of Pre-Trained Models Using Transfer


Learning for Detecting Plant Disease
2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS) | 978-1-7281-8529-3/20/$31.00 ©2021 IEEE | DOI: 10.1109/ICCCIS51004.2021.9397098

Bincy Chellapandi M.Vijayalakshmi Shalu Chopra


Department of Information Technology Department of Information Technology Department of Information Technology
VESIT VESIT VESIT
Mumbai, India Mumbai, India Mumbai, India
2018.bincy.chellapandi@ves.ac.in m.vijayalakshmi@ves.ac.in shaluchopra@ves.ac.in

Abstract—Artificial Intelligence has been proving a great disease through computer vision, would help farmers to save
boon in almost all the sector of industries. In recent times the time, plant, economy as well as all the efforts put by the
demand for food has increased, whereas the supply still lacks. In farmers will not go in vain. Hence, we have proposed a deep
order to meet these increasing demands, prevention and early learning model and various Transfer Learning models to
detection of crop disease are some of the measures that must be identify plant disease detection thereby automating the entire
inculcated in farming to save the plants at an early stage and system through Artificial Intelligence.
thereby reducing the overall food loss. In this paper, we use a
deep learning-based model and transfer learning-based models II. RELATED WORK
to classifying images of diseased plant leaves into 38 categories
of plant disease based on its defect on a Plant Village dataset. Various research works have been done in the image
Eight pre-trained models namely VGG16, VGG19, ResNet50, classification and identification. Aakanksha Rastogi, Ritika
InceptionV3, InceptionResnetV2, MobileNet, MobileNetV2, Arora and Shanu Sharma [1], used Maple and Hydrangea
DenseNet along with the one self-made model were used in our leaves having two types of leave disease and pre-processed it,
study. We found that DenseNet achieves the best result on the then extracted its features to analyze its attributes. K-means
test data with an accuracy of 99%. clustering along with ANN was used to segment the leaf into
3 parts namely, diseased part, leaf part, and the background
Keywords—Plant Disease, Deep Learning, Transfer Learning, part following which the leaves were classified according to
DenseNet, VGG16. its disease. S. Panigrahi, A. Nanda and T. Swarnkar [2], have
focused on the optimization of different parameters of a
I. INTRODUCTION convolutional neural network of deep learning for classifying
One of the key industries which provide humans with 8000 labeled natural images of cat and dog. First, the
Food, Medicine, Raw Materials, and other necessities is convolutional neural network is trained to learn features and
Agriculture. Being the backbone of our economy, it is the sole then an ANN binary classifier is used for classification.
provider of Jobs and opportunities to a major chunk of our Various level of optimization is used to improve the
population. performance level of the network and the best classification
accuracy of 88.31% is obtained by this method.
Of the many challenges faced by farmers, Plant diseases
pose a major challenge to them. Identifying the disease before M. T. Islam, B. M. N. Karim Siddique, S. Rahman and T.
it festers and spreads across the farm to other plants and curing Jabid [3], used a convolutional neural network to classify food
it is a herculean task by itself. On one hand, we have an ever- images. Deep Learning is used to classify 16643 images of
rising need to feed the growing population, and on the other food belonging to various food categories. An accuracy of
hand, Agriculture as a career has been gradually decreasing 92.86% is obtained in the experiment. M. Shaha and M. Pawar
over time. Agriculture being attributed as a Blue-collar job has [4], did an image classification using transfer learning by fine-
worsened this divide even further. The Socio-Political climate tuning a pre-trained model named VGG19. The model’s
has made White-Collar jobs more attractive and Economical performance is compared with two pre-trained models called
to scores of people with better opportunities and higher pay VGG16 and AlexNet along with a hybrid Convolution Neural
options leading to an ever-reducing strength of people Network (CNN) model with a support Vector Machine (SVM)
working the fields. This has led to developments in technology as a classifier on two different image datasets namely
in this sector to tackle this problem and one of the challenges CalTech256 and GHIM10K. The study concludes that
that we tackle in this paper is to identify the diseases in plants VGG19 performed better than the other three models.
at an earlier stage to provide a better cure for the plants thus
H. T. H. Phan, A. Kumar, J. Kim and D. Feng [5], by using
raising a better and healthy yield of crops
a pre-trained CNN model that is by using transfer learning
Checking each plant if it has any disease, and if it does, classified HEp-2 cell image dataset. The model first extracts
then to identify which type of disease it has is a very lengthy the important features that best represent the images of the
and time-consuming process. Moreover, a naked eye cannot dataset using feature selection, then those features are used to
identify all the categories of diseases accurately. Hence, classify the images into 6 different categories based on their
Automating Plant Disease Identification using Artificial staining patterns. They conclude the study by proving that
Intelligence is being adopted by farmers at present times. An their CNN algorithm performed the best than the other 4
automated system which can help farmers to identify plant algorithms made previously by other researchers.
disease through computer vision would help farmers to save

ISBN: 978-1-7281-8529-3/21/$31.00 ©2021 IEEE 383

Authorized licensed use limited to: Carleton University. Downloaded on May 28,2021 at 11:03:34 UTC from IEEE Xplore. Restrictions apply.
2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

III. PROPOSED METHODOLOGY set and 20% of testing set. We made a self-built Convolution
Neural Network with 3 convolutional layers using deep
A. System Proposed
learning for plant disease classification. We have also added
two max-pooling layers, with two dense layers of 128
neurons in the first layer and 38 neurons at the last. Two
dropouts of 25 percent and 50 percent were used in the
network to reduce over-fitting in between the layers. Relu
was used as an Activation function in between the layers and
in the last layer Softmax is used as the activation function for
the classification purpose. The loss function used is
categorical cross-entropy since it is a multiclass classification
problem. We trained the model for 30 epochs with a batch
size of 32.

E. Transfer Learning
Transfer learning is a machine learning strategy where a
model created for performing a particular function is used
again as the start line for another model on a subsequent task.
In Machine Learning, a model is built from scratch to solve a
particular problem, whereas in Transfer learning, a model that
has been already built by training on a huge amount of
miscellaneous dataset and has solved a particular problem,
Fig.1. Flowchart of the system proposed can be used as a starting point in our model for solving our
customized problems as shown in Fig.2.
The proposed system depicts the workflow as shown in Fig
1. The dataset is first obtained. After which the dataset is pre-
processed to eliminate unwanted details in the data. The
dataset is then split as 80% for training and 20% for
validating. It is then fed into downloaded pre-trained models,
where the models are fine-tuned and trained to extract the
features and validate for transfer learning. Whereas for deep
learning, the data is fed into a self-built CNN model for
training and testing. The models are then evaluated for their
performance.

B. Dataset
Dataset called the PlantVillage Dataset was obtained from Fig.2. Transfer Learning
SP Mohanty's Git-Hub repository which contained 14 species
of plant belonging to 38 different classes with a total of There are various Pre-trained Models built by organizations
54,306 images of 256x256 pixels were used for training and for research purposes and are released under some
testing the model. Colored (RGB) images were used in this permissions. We have used eight pre-trained models namely:
study to train and classify the plant diseases. InceptionV3, InceptionResnetV2, ResNet50, VGG16,
VGG19, MobileNet, MobileNetV2, and DenseNet for our
implementation.
C. Pre-processing of Dataset We have fine-tuned these 8 pre-trained models on the last
Pre-processing of dataset plays a major role in training a layers of its network by our dataset of 9111 images only out
model as it helps in removing the noise or redundancy, faster of 40,000 images. The 9111 images are then split into 80% of
execution and thereby an increased accuracy. The images the training dataset of 7017 images and 20% of a testing
were pre-processed using Data Augmentation. Techniques dataset of 2094 images. These 9111 images out of 40,000
like rotating, shearing, flipping, zooming, and filling were images are randomly generated using ImageDataGenerator.
applied to the data. Keras deep learning library in Python was We have also used the same data generators for generating our
used for data augmentation. training and testing image dataset. The ImageDataGenerator
does the pre-processing of images such as shearing, zooming,
flipping, brightness adjustment while generating the images.
D. Deep Learning The Pre-trained models are then imported as the base models,
Deep learning is a part of Artificial Intelligence motivated trained on the ImageNet dataset. An EarlyStopping is used to
by the human brain, creating artificial neural networks stop the training process when the validation accuracy stops
mimicking the human brain network, and thereby working improving. To get a categorical output, Label encoding is
used. The base model is then conjoined by a
and learning on a large amount of data. We have used 12,000
GlobalAveragePooling layer which is used for reducing the
images for our model which is randomly generated by the data and for preparing the model for the final layer for
ImageDataGenerator. The dataset is split into 80% of training

384

Authorized licensed use limited to: Carleton University. Downloaded on May 28,2021 at 11:03:34 UTC from IEEE Xplore. Restrictions apply.
2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

classification. A BatchNormalization layer is then added for


the stability and quicker execution of the model thereby
reducing the training epochs. Then a dense layer with a weight
of 38(weight is assigned 38 because 38 are the different
categories of plant diseases which the model needs to
classify), with an activation function of softmax is used in the
final layer for withdrawing and classifying the output. Adam
optimizer with a learning rate of 0.0001 is used for updating
the weights. A categorical loss function is used to determine
how well our model is performing. In order to avoid
overfitting, a dropout of 1e-3 (where e is equal to 1 × 10−5)
is appended. The models have then trained again with a batch
size of 100 for 30 epochs on the training dataset and they are
tested on the testing dataset. Training accuracy, training loss,
validation loss, validation accuracy, Precision, Recall, F1-
Score is used for determining the performance of the models. Fig.5. Loss vs epochs

IV. EXPERIMENTS AND RESULTS


B. Pre-trained Models in Transfer Learning
A. Convolution Neural Network in Deep Learning
After building and training the model using pre-trained
After building and training the model for plant disease models using transfer learning, DenseNet achieves the best
detection using Convolution Neural Network, our self-built result on test data followed by VGG16 as shown in Table I.
model, gave an accuracy of 87%. We tested our model The training and validation accuracy of DenseNet and VGG16
bypassing a few images that were not included in the training model shown in Table II are the same, but the F1 score of
and testing dataset. The model performed better by predicting DenseNet is greater than VGG16 which is why DenseNet
almost all the images to their perfect category. One of such achieves the best result, as greater the F1 score, the better the
testing on an image is shown in Fig 3. The image belonged to model. From Fig 6 and 7, we can see that the DenseNet and
the 'Apple_healthy' category and the model predicted it VGG16 each succeed a decent fit, as training and validation
correctly. The fluctuating drop and rise in loss function in Fig. loss decreases to some extent of stability with the lowest gap
5 signify how the model slows down and speeds up in the between the two final loss values. Just like for CNN, for
learning process respectively. The exponential growth transfer learning also few images not belonging to training and
inaccuracy in Fig. 4 shows how well the model can classify testing dataset were used in predicting the type of plant disease
the diseases. category they belong to and it was found that both pre-trained
models VGG16 and DenseNet predicted all of the images
correctly to their belonging category. One such example of
prediction is shown in Fig.8 where a sour cherry leaf image
having a powdery mildew, is classified correctly by both
VGG16 and DenseNet models.
I. TABLE I
COMPARISON OF PRE-TRAINED MODELS ON TEST DATA
Pre-trained Models Accuracy Precision Recall F1
Score

InceptionV3 0.97 0.96 0.94 0.95


Inception_Resnet_V2 0.98 0.97 0.96 0.97
Fig.3. Predicting the category of the plant disease using CNN. ResNet50 0.93 0.88 0.87 0.86
VGG16 0.99 0.95 0.95 0.95
VGG19 0.98 1.00 0.91 0.95
MobileNet 0.98 0.97 0.95 0.95
MobileNetV2 0.95 0.84 0.86 0.85
DenseNet 0.99 0.98 0.98 0.98

III. TABLE II
COMPARISON OF TRAINING AND VALIDATION ACCURACY
OF PRE-TRAINED MODELS ON TEST DATA
Pre-Trained Models Training Validation
Accuracy Accuracy
InceptionV3 1.0000 0.9756
InceptionResnetV2 1.0000 0.9733
Fig.4. Accuracy vs epochs
ResNet50 0.9840 0.9303
VGG16 1.0000 0.9895

385

Authorized licensed use limited to: Carleton University. Downloaded on May 28,2021 at 11:03:34 UTC from IEEE Xplore. Restrictions apply.
2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

VGG19 1.0000 0.9852


MobileNet 1.0000 0.9742
MobileNetV2 1.0000 0.9436
DenseNet 1.0000 0.9895

Fig.6. Accuracy vs epochs and Loss vs epochs of DenseNet Model

Fig.9. Classification Report of VGG16 Model

Fig.7. Accuracy vs epochs and Loss vs epochs of VGG16 Model

Fig.8. Predicting the category of plant disease using Transfer Learning.


Fig.10. Classification Report of DenseNet Model

386

Authorized licensed use limited to: Carleton University. Downloaded on May 28,2021 at 11:03:34 UTC from IEEE Xplore. Restrictions apply.
2021 International Conference on Computing, Communication, and Intelligent Systems (ICCCIS)

Fig. 9 and 10 give the classification report of VGG16 and achieved an accuracy of 87%. Therefore we inculcated
DenseNet Model respectively. Referring to Fig 6, the first Transfer Learning, using various pre-trained models along
column represents the 38 different types of Plant Disease with Deep Learning to achieve better results. We found that
ranging from 0th to 37th. The second column Precision is the DenseNet and VGG16 both proved to be the best models with
quantitative relation of properly foretold positive an accuracy of 99%. This paper gives a comparative study of
observations to the whole predicted positive observations. how accurate the pre-trained models can classify the images
E.g., for 0th plant disease type, the Precision is 1.00 which with some fine-tuning which can be used for many image
signifies that of all plants that are labeled as type 0 diseased, classification applications like in the health sector for
identifying and classifying x-ray images, in reverse image
100% of them are type 0 diseased. The third column Recall
search engines, in biometrics and facial recognition, etc. This
is that the magnitude relation of properly expected positive
study can further be studied by increasing the types of
observations to any or all observations within the actual class. diseases. It can also be inculcated in various user-friendly
E.g., for the 0th plant disease type, the Recall is 0.95 which applications for farmers to be put into actual use.
signifies that of all the plants that truly type 0 diseased, 95%
of them are labeled by the model. The fourth column F1-score REFERENCES
is the weighted average of Precision and Recall. The fifth [1] Aakanksha Rastogi, Ritika Arora and Shanu Sharma,” Leaf Disease
column Support is the measure of how many times a particular Detection and Grading using Computer Vision Technology &Fuzzy
class occurs in a dataset. E.g., for the 0th plant disease type, Logic” 2nd International Conference on Signal Processing and
Integrated Networks (SPIN)2015.
Support is 22 which signifies that 22 times the data belonging
[2] S. Panigrahi, A. Nanda and T. Swarnkar, "Deep Learning Approach for
to type 0 disease occur while training the model from a Image Classification," 2018 2nd International Conference on Data
dataset. From the classification report in Fig. 9 and 10, we can Science and Business Analytics (ICDSBA), Changsha, 2018, pp. 511-
see that DenseNet performs well than VGG16. 516, doi: 10.1109/ICDSBA.2018.00101.
[3] M. T. Islam, B. M. N. Karim Siddique, S. Rahman and T. Jabid, "Image
V. CONCLUSION Recognition with Deep Learning," 2018 International Conference on
Intelligent Informatics and Biomedical Sciences (ICIIBMS), Bangkok,
Artificial Intelligence has become a core unit of 2018, pp. 106-110, doi: 10.1109/ICIIBMS.2018.8550021.
development in all the primary and secondary sectors. Plant [4] M. Shaha and M. Pawar, "Transfer Learning for Image Classification,"
Disease Detection researches and projects have been carried a 2018 Second International Conference on Electronics, Communication
lot in recent times to help the farmers in agriculture. Machine and Aerospace Technology (ICECA), Coimbatore, 2018, pp. 656-660,
Learning, Deep Learning, Transfer Learning all being a part doi: 10.1109/ICECA.2018.8474802.
of Artificial Intelligence are used in these studies and [5] H. T. H. Phan, A. Kumar, J. Kim and D. Feng, "Transfer learning of a
researches. Using Deep Learning the accuracy doesn't go convolutional neural network for HEp-2 cell image classification" 2016
IEEE 13th International Symposium on Biomedical Imaging (ISBI),
more than 93% in Plant Disease Detection. The self-built Prague, 2016, pp. 1208-1211, doi: 10.1109/ISBI.2016.7493483.
model using Convolution Neural Network in this study

387

Authorized licensed use limited to: Carleton University. Downloaded on May 28,2021 at 11:03:34 UTC from IEEE Xplore. Restrictions apply.

You might also like