You are on page 1of 6

4th International Conference on Electrical Information and Communication Technology (EICT), 20-22 December 2019, Khulna, Bangladesh

Transfer Learning Based Plant Diseases Detection


Using ResNet50
Ishrat Zahan Mukti Dipayan Biswas
Dept. of Electronics & Communication Engineering, Dept. of Electronics & Communication Engineering,
Khulna University of Engineering & Technology, Khulna University of Engineering & Technology,
Khulna, Bangladesh. Khulna, Bangladesh.
ishratzahanmukti6@gmail.com dipayanbiswas@ece.kuet.ac.bd

Abstract— Plant diseases are a principal threat to the safety of II. RELATED WORK
food. In agriculture sectors, it is the greatest challenge to
identify plant diseases. The state-of-the-art Convolutional Plant diseases recognition has been discussed over the
Neural Network (CNN) gives excellent results to solve image years. Many researchers have developed many suitable
classification tasks in computer vision. Transfer Learning architectures with the help of machine learning techniques
enables us to develop a deep CNN network in a most cost and gave their thoughts to detect plant diseases.
effective way. In this work, a Transfer Learning based CNN Sindhuja et al. [1] described a fast, cost effective and
model was developed for the identification of plant diseases reliable health monitoring sensor. To monitor plant health
precisely. The dataset, we have used is consists of 70295 training and diseases, they represented various technologies that have
images and 17572 validation images holding 38 different classes
of plant leaves images. We have focused mainly on ResNet50
been used to detect the plant diseases. Waldchen et al [2]
network, a popular CNN architecture as our pre-trained model published a review of plant disease detection with the help of
in Transfer Learning. Additionally, several Transfer Learning computer vision techniques. Their review comprised of
architectures were experimented with few other popular pre- almost 120 literature researches and also a broad scale
trained models (VGG16, VGG19, AlexNet) and compared with description of datasets was given.
the proposed model. The proposed model has given the best Erika et al. [3] proposed a four layers CNN model which
performance of 99.80 % training accuracy. contains 7 types of diseases along with healthy cucumber
leaves. They remarked good and bad condition of images and
Keywords— CNN, Artificial intelligence, Transfer Learning,
found an average accuracy of 82.3%. Powara et al in [4]
Plant disease, Pattern recognition, ResNet50.
compared some handcrafted feature descriptors techniques
I. INTRODUCTION with CNN models. Their comparison includes Histogram of
Oriented Gradients (HOG) based features combined with k-
In the world, there are 570 million farms. More than 90%
people are related to the farming. Farmers occupy a large share Nearest Neighbors (KNN), and HOG-BOW integrated with
of the 80% of the food. SVM and MLP classifiers. They compared these models with
AlexNet and GoogleNet, both trained from scratch. Piyush et
Food security is threatened by a number of factors such as al. [5] used color based techniques to segment particular
climate change, degeneration in pollinators, plant diseases etc. region of interest in the images of plants. In this study, YcbCr,
Plant diseases are an impendence to safety of food as well as HIS and CIELB color models were used for detecting disease
disastrous consequences for farmers. To prevent plant spots. In the Reference [6], few texture features such as
diseases, farmers waste their financial and other resources. In exhaustion, homogeneity and congruence were obtained.
this changing environment, we need to identify these diseases. They calculated the grizzle level form on images and linked
Some diseases are difficult to recognize with their visible
it with color selection and discovered maize leaf diseases.
symptoms through human eye. In this situation, we need to
use technology to detect these diseases. Otherwise people
have to depend on imported food which will increase the Sachin D. Khirade, A.B. Patil [7] applied some
expenditure as well as can lead to health risk for people. There segmentation techniques and extracted features from leaf
are some applications such as fungicide, disease-specific images and then implemented neural network as a classifier
chemical, and pesticide application. These applications could with back propagation. Authors in [8] developed K-Means
be carried if we have the early information on plant diseases. technique and a pre-trained neural network based model for
By using these applications, we can control diseases and leaf and stem disease detection. Melike et al. [9] presented a
flourish our productivity. CNN based model and Learning Vector Quantization (LVQ)
algorithm based method for the detection of tomato leaf
In this case, CNNs can be used in detecting plant diseases. diseases and classification. Authors in [10] applied transfer
CNN is one of the most powerful technique in pattern learning approach with inception_v3 and mobilenet
recognition with large amount of data. CNN benefits with very architectures and showed that inception_v3 finished with
promising result to detect these diseases. In previous works, better accuracy.
various classification architectures of CNNs were used to
detect diseases. In this paper, we have developed a deep learning model by
the process of Transfer Learning, where the pre-trained
Remaining paper is arranged as follows: Section II weights have been collected from the popular ResNet50
describe previous related works. Methodology has been model. These added layers in our proposed model mainly
explained in Section III. Section IV holds experimental result benefits to the feature extraction process with minimum
and analysis. Concluding remarks is in Section V. computational cost. Additionally, Fine-Tuning has been
performed to improve the detection accuracy. The dataset in

978-1-7281-6040-5/19/$31.00 ©2019 IEEE

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.
our experiment includes 38 different diseases as well as the We trained the network such that they can learn about the
images from healthy plants. Our method for detecting plant features and can distinguish between one class to another as
diseases is presented in the below section. well as with its health condition. We worked with 70,295
training images and 17,572 validation images of disease and
III. MATERIAL AND METHODS healthy plants (partitioning into 80:20). Some statistics have
The entire procedural model using CNN for plant diseases been displayed in the following Fig. 3 and Fig. 4.
detection is presented below in niceties. The steps in the B. Image Preprocessing and Labelling
model’s working flow is displayed in Fig. 1. The deep CNN
model starts with training images followed by preprocessing Image preprocessing improves the image data necessary
of images, applying augmentation, use of pre-trained weights for image classification task. In preprocessing methods, there
of ResNet50, optimization of model parameters. Then, test are geometric transformations of images such as image
was performed along with a vast results analysis. rotation, image scaling, and translation of images.

A. Dataset In our preprocessing steps, we have reduced the resolution


of all the images into 224*224 pixels. It needs to ensure that
The Dataset in our experiment is comprised of images of all images have same resolution. For searching image easily,
leaves from 38 categories of plants. We have collected the we need to labelling or grouping by a keyword search. During
plant disease dataset from the GitHub repository of a well- this period, all transcribed images were removed from the
known research group named ‘salathegroup’ [11]. Where, the dataset.
dataset consists of images of both healthy and disease plants.
The proposed model was trained by different classes of leaves C. Augmentation Process
for detection. This process is utilized to increase the number of images
in the training dataset. It helps to preclude the overfitting
problem in the training process. Where, overfitting is the
problem, when the network learns the data rather than the
general pattern of the dataset. Image augmentations were
performed by introducing particular variations in the images
such as rotation, width shift, height shift, shear range,
horizontal flip which are displayed in Fig. 5.

2500
NUMBER OF IMAGE

2000
1500
1000
500
0

Fig. 1. Works flow for plant diseases detection using ResNet50


architecture. CLASS OF PLANT DISEASES TRANING DATASETS

Fig. 3. Distrituion of images anmong its different classes [training dataset].

600
Number of images

500
400
300
(a) (b) (c) 200
100
0
Corn(maize)he…
Grape…

Tomato…
Tomato…
Orange…
Pepper…

strawberry…
Soyabean…
Apple scab

Cherry powder

potato healthy

Tomato heathy
Apple healthy

class of plant diseases validation dataset


(d) (e) (f)
Fig. 2. Some sample of New plant diseases dataset: (a) Potato healthy, (b)
Tomato mosaic virus, (c) Tomato yellow curl, (d) Apple scab, (e) Corn Fig. 4. Distrituion of images anmong its different classes [validation
(maize)common rust, (f) Pepper bell bacterial spot. dataset].

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.
model. Some other experiments have been done by changing
the pre-trained model like VGG16, VGG19 and AlexNet.

(a) (b) (c)

(d) (e) (f)

Fig. 5. Some augmentation of pepper bel bacterial spot leaf image: (a)
original, (b) rotation, (c) right shift, (d) vertical shift, (e) rotation and right
shift, (f) left shift.

D. ResNet50
AlexNet, AlexNetOWTBn, GooLeNet, Overfeat, VGG
models are more common in transfer learning. They stacked
many convolutional layers. There are some difficulties with
deep CNN networks: optimization of the networks, vanishing
gradient problem, and the degradation problems.
The Residual network (ResNet) brings a new idea. It
benefits to solve complicated tasks and also increases the
detection accuracy. ResNet tries to solve the difficulties in
training process of deep CNN, the saturation and degradation
of accuracy. In this paper, we have used ResNet50
architecture. ResNet50 had 50 layers of residual networks.
Fig. 6 shows ResNet50 architecture.
The ResNet50 structure has different groups of identical
layers as indicated by different colors in the Fig. 6. The curve
lines represent the identify blocks that is used to indicate the
use of previous layers in the following layers. It is the key
difference in ResNet50 that counterfeit problem of vanishing Fig. 6. ResNet50 architecture
or exploding gradients, degradation problem (accuracy first
saturates and then degrades) in training very deep networks. F. Fine-Tuning
In the Fig. 6, the first layer has 64 filters with the kernal Fine-tuning is used for increasing the efficiency of a
size of 7×7, which is followed by a maxpooling layer of size function. It makes small modification to improve the
3×3. The first group of layers (as indicated by gray color) outcome. The adjustment process is so crucial that some
consists of three identical blocks. In the same way group two, change affects the training process a lot with respect to the
group three, and group four have 4 indentical blocks, 4 computation time needed, the speed of convergence and the
identical blocks and 3 indentical blocks respectively. In use of processing units. This process of fine tuning was
between some groups, the curves marked with blue color, repeated over again and again to improve the accuracy of our
represent the identity block that connects two layers of model. These are listed in the Table I.
different sizes.
TABLE I. PARAMETERS SETUP FOR THE PROPOSED MODEL
After all these blocks, there is a total 38 fully connected
layers responsible for the clasification task. In our proposed Parameter Value
model, we did not use these fully connected layers. Batch size 32
E. Performed Tests Steps per epoch 550
We have done many testings in different experimental Epoch 25
setups to analysis the performances of the proposed model. Validation steps 1
Several network parameters have been changed through the Optimizer SGD (stochastic gradient descent)
instruction made to the model. We have split the total dataset Learning rate default
into 80% for training purpose and 20% for validation purpose. Decay default
Then, we have experimented the dataset with our proposed Momentum default

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.
IV. RESULTS AND DISCUSSION In our experiment with proposed model, images were
Our model was instructed to start training with the resized into 224×224. Then the augmentation was performed.
We used the weights of pre-trained ResNet50 model. We used
training dataset comprised of both the actual images and the
stochastic gradient descent (SGD) optimizer, softmax
images from augmentation. Then validation has been activation and batch size equals 32. In this model, learning
performed to generalize the model. Fig. 7 shows a good rate, decay, momentum was set to default value. In this way,
convergence of proposed network in the training and we were able to increase the number of classes where most of
validation phases. Although, there is a single low peak in the the previous works include less number of classes of diseases.
validation curve, it shows a 100% validation accuracy for the
remaining major portion of the curve. Then, we applied the ResNet50 architecture to the
classifier on the new plant diseases dataset and then tested the
Furthermore, Fig. 8 shows the spreading of losses (both performance of the model using test images. We experimented
training loss and validation loss) with respect to number of by changing weights of the pre-trained ResNet50 model. This
epoch in the training and validation phases. The curve in Fig. was used to compare our model with other popular pre-trained
8 emphasizes how many images were accurately identified in networks in transfer learning. We analyzed to find out which
the validation process. one is the most appropriate pre-trained network for this
dataset. We compared with three models known as VGG16,
VGG19, AlexNet. The results of these experiments are shown
in Table II. It shows that model with ResNet50 has high
accuracy as well as low loss. The most promising result is the
minimum time required in completing every step.
Lastly, 33 images were used in the testing phase from a
total number of 38 classes. Some predicted images are shown
in Fig. 9. In that testing, our proposed models exhibit 100%
testing accuracy with 33 true classifications out of 33 images.
Fig. 10 shows the accuracy and losses of AlexNet,
VGG19, VGG16, ResNet50 models in the training and
validation process. Here we see that, ResNet50 model
achieved the highest success rate. The losses and convergence
Fig. 7. Accuracy distribution in the training process
time are also lower than the models with other pre-trained
networks.

TABLE II. MODEL PERFORMANCEES IN OUR EXPERIMENTS

Model Training Validation


Time used loss
comprised of accuracy accuracy

AlexNet 0.8366 0.8750 184s 335ms/step 0.5500

VGG19 0.9175 0.9062 273s 496ms/step 0.2528

VGG16 0.9496 1.00 224s 408ms/step 0.1523

ResNet50 0.9980 1.00 80s 156ms/step 0.0080

Fig. 8. Distribution of losses with the epoch number (validation phase).

Fig. 9. Some predicted images with the proposed model (out of 33 images).

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.
TABLE III. CONVERGENCE COMPARISON WITH THREE MODELS USING
DIFFERENT PRE-TRAINED NETWORKS

Model Accuracy Epoch Time Loss


225s
AlexNet 93.51% 66 0.2235
409ms/step
227s
VGG19 97.95% 54 0.0636
413ms/step
261s
VGG16 97.77% 50 0.0643
475ms/step
295s
(a) ResNet50 98.42% 4 0.0544
537ms/step

TABLE IV. COMPARISON WITH EXISTING WORK FOR SAME DATASET


Image Overall
Model name Class Epoch
number Accuracy
AlexNet[12] 38 54,306 30 98.2%
GooLeNet[12] 38 54,306 30 99.34%
Proposed model 38 87,867 25 99.80%

(b) At last, we made a comparison with a previous work [12]


and is displayed in Table IV as most of the previous work
considered to take fewer number of classes in the detection
task. Where, we found that they also used 38 classes of plant
to detect plant diseases by using GoogleNet and AlexNet. Our
model is compared with these results and found comparative
output as shown in Table IV.

In our model, the number of images were higher than the


previous work, as an increment has been made in the
augmentation process. It gives excellent accuracy.
(c)
Among these experiments, we see that, ResNet50 always
performs better than the other models with different pre-
trained networks. We found superb results on the new plant
diseases dataset by using ResNet50 architecture.
V. CONCLUSION
In this paper, a Convolutional Neural Network was
constructed to identify plant diseases automatically. Our
developed model can distinguish between 38 classes of both
(d) healthy leaves and disease affected leaves. The entire method
Fig. 10. Accuracy and losses with the different pretrained models: (a) has been narrated specifically. Model performances have
VGG16 model accuracy and loss, (b) VGG19 model accuracy and loss, (c) been analyzed through comparison with few other transfer
AlexNet model accuracy and loss, (d) ResNet50 model accuracy and loss. learning models along with suitable graphs. With the
increasing depth of CNN model, more image data is required
The convergence in the training process is high for the for the best generalization of the model. For that reason, after
proposed model. Also, the validation curve closely follows the
preprocessing the data, we enlarged the dataset through the
training curve indicating the smooth convergence of the
model. So, the proposed model is fast and efficient in training process of augmentation. Finally, a popular pre-trained model
and also can predict the test images accurately. (ResNet50) was used in the way of Transfer Learning.
ResNet50 along with the optimization of proposed model for
Furthermore, we intended to get by how factors the this specific dataset have been made through a lot of
network convergence differs. For this, we experimented by experiments. The overall accuracy of the proposed model was
changing the number of epochs and tried to keep a consistent 99.80% as referred in Table IV.
target accuracy. The results are summarized in Table III.
We thought about why accuracy was not accurate to 100%.
In Table III, if we analysis the result, we see that, It’s probably due to the nature of the leaves. The images of
AlexNet, VGG19, VGG16 need higher time to provide target some species are very close to each other and share very
accuracy than ResNet50. Also, the losses of those models are similar shape, color, and texture. So, sometimes it is very hard
higher. In this case, our proposed model shows the best for networks to correctly predict the true labels.
performance. It acts like a very useful instructor to detect Nowadays, smart mobile devices facilities us in terms of
plant diseases. easy access and the flexibility in uses. Mobile camera can be
used to capture these leaves of plant. A precise plant diseases

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.
detection model implemented in those smart phone will help
farmers to recognize the plant diseases in a very short time
through a convenient way. Farmers will be able to make
decision own self. And, it will have a golden impact on the
progress of agriculture.

REFERENCES
[1] S. Sankaran, A. Mishra, R. Ehsani, and C. Davis, “A review of
advanced techniques for detecting plant diseases,” Computers and
Electronics in Agriculture, vol. 72, no. 1, pp. 1–13, 2010.
[2] J. Wäldchen, P. Mäder, “Plant Species Identification Using Computer
Vision Techniques: A Systematic Literature Review,” Archives of
Computational Methods in Engineering, Vol. 25, Issue 2, pp 507–543,
April 2018.
[3] E. Fujita, Y. Kawasaki, H. Uga, S. Kagiwada, and H. Iyatomi, “Basic
investigation on a robust and practical plant diagnostic system,” 15th
IEEE International Conference on Machine Learning and Applications
(ICMLA 2016), December 2016.
[4] P. Pawara, E. Okafor, O. Surinta, L. Schomaker, and M. Wiering,
“Comparing Local Descriptors and Bags of Visual Words to Deep
Convolutional Neural Networks for Plant Recognition,” 6th
International Conference on Pattern Recognition Applications and
Methods (ICPRAM 2017), pages 479-486, 2017.
[5] P. Chaudhary, A. K. Chaudhari, A. N. Cheeran, and S. Godara, “Color
transform based approach for disease spot detection on plant leaf,”
International Journal of Computer Science and Telecommunications,
vol. 3, no. 6, pp. 65–69, 2012.
[6] J. K. Patil and R. Kumar, “Feature extraction of diseased leaf images,”
Journal of Signal & Image Processing, vol. 3, no. 1, p. 60, 2012.
[7] S. D. Khirade, A.B. Patil, “Plant Disease Detection Using Image
Processing,” 2015 International Conference on Computing
Communication Control and Automation, Feb. 2015.
[8] D. A. Bashish, M. Braik, S. B. Ahmad, “A framework for detection and
classification of plant leaf and stem diseases,” International Conference
on Signal and Image Processing, Dec. 2010.
[9] M. Sardogan, A. Tuncer, Y. Ozen, “Plant Leaf Disease Detection and
Classification Based on CNN with LVQ Algorithm,” 3rd International
Conference on Computer Science and Engineering (UBMK), Sept.
2018.
[10] G. Suresh, V. Gnanaprakash, R. Santhiya, “Performance Analysis of
Different CNN Architecture with Different Optimisers for Plant
Disease Classification”, 5th International Conference on Advanced
Computing & Communication Systems (ICACCS), March 2019.
[11] Salathegroup, "plantvillage_deeplearning_paper_dataset", (2016),
GitHub repository . [Online]. Available:
https://github.com/salathegroup/plantvillage_deeplearning_paper_dat
aset. [Accessed: 10- May- 2019].
[12] Mohanty, S.P., Hughes, D.P., Salathé, M., 2016. Using deep learning
for image-based plant disease detection. Front. Plant Sci. 7
http://dx.doi.org/10.3389/fpls.2016. 01419. Article: 1

Authorized licensed use limited to: Siksha O Anusandhan University. Downloaded on February 20,2023 at 12:30:34 UTC from IEEE Xplore. Restrictions apply.

You might also like