A Tomato Leaf Diseases Classification Method Based On Deep Learning
A Tomato Leaf Diseases Classification Method Based On Deep Learning
Abstract: In the process of planting crops, the detection of diseases in the leaf parts is one of the key links to the pre-
vention and control of crop diseases. This paper takes tomato leaves as experimental objects, and uses the deep learning
method to extract the disease features on leaf surface, including three most common species (Spot blight, Late blight and
Yellow leaf curl disease). After continuous iterative learning, the network can predict the category of each disease pic-
ture. For each of the three diseases, 1000 pictures were selected, divided into 900 pictures for training set (2700 in total)
and 100 pictures for test set (300 in total). The experiment takes Resnet-50 as the basic network model. For comparison,
the activation function of the network was changed into Leaky-ReLU and the kernel size of the first convolutional layer
was modified to 11×11. After the improvement, the training accuracy in training set is 98.3% (increased by 0.6%) and the
test accuracy in test set is 98.0% (increased by 2.3%).
Key Words: Leaf Disease Classification, Feature Extraction, Deep Learning
978-1-7281-5855-6/20/$31.00 2020
c IEEE 1446
Authorized licensed use limited to: Cornell University Library. Downloaded on August 24,2020 at 02:46:50 UTC from IEEE Xplore. Restrictions apply.
The Caffe frame was used, with a maximum accuracy of leaf diseases were all up to more than 2000, with a total of
98.21%. 6,794 images. These images will form a sample library for
the learning process [11]. Fig 2 shows some examples of the
3 PROPOSED METHODS processed images.
In this paper, tomato leaves were taken as the experimental
object, and Resnet-50 residual network was adopted as the
basic model. In the experiment, the feature of leaf disease
position was automatically extracted by the convolutional
layers, and the disease classification was finally determined
after iterative learning. In addition, random data augmen-
tation was carried out to prevent over-fitting in the exper-
iment. Leaky-ReLU [9] activation function and the larger
11×11 convolution kernel size were used to modify the
network, which increase the receptive field [10] and im-
prove the ability of the network to capture detailed features.
Through comparative experimental analysis, the perfor-
mance of the network is increased by 2.3% in test set.
4 DATA
As one of the most common agricultural crops, tomato is
Fig 2. Examples of the processed images (including Gaussian
widely cultivated in north and south of China. With the
noise and Affine transformation)
development of ecological agriculture, higher requirements
have been put forward for the detection and prevention of 5 NETWORK MODEL AND PARAMETERS
crop diseases. In the experiment, a total of 3000 images of
the three most common tomato leaf diseases (Spot blight, 5.1 Deep Residual Network
Late blight and Yellow leaf curl) were selected. The training As the depth of the network increases, there is a degradation
set and test set were allocated according to the ratio of 9:1, problem, which is that as the network gets deeper and
including a total of 2700 training pictures and 300 test deeper, the accuracy of the training flattens out, but the
pictures. Among them, leaves occupy the main part of the training errors get bigger. To overcome this problem,
picture, avoiding the messy texture background, so as to Kaiming He et al. [12] proposed the deep residual network
achieve better disease feature extraction effect. The data and achieved excellent results in the ILSVRC2015 compe-
were obtained from AI Challenger and some examples are tition.
shown in Fig 1.
Resnet-50 network model takes Bottleneck structure as
residual module. Direct connection channels, or short-cut
structures, have been added to the network, allowing a
certain proportion of the previous network layer's output to
be retained. This simple addition does not add any extra
parameters or computations to the network, but can greatly
increase the training speed of the model with better training
effect. When the network goes deeper, this structure can
solve the problem well that the gradient disappears during
back propagation.
The distribution of input data in each layer of the network is
changing all the time. The update of training parameters in
the front layer will lead to the change of the distribution of
input data in the later layer. Moreover, the first few layers of
the network make small changes, and the next few layers
Fig 1. Examples of three common tomato leaf diseases. Top: Spot
gradually accumulate and amplify the changes. The role of
blight. Middle: Late blight. Bottom: Yellow leaf curl.
Batch Normalization is to standardize these input values and
Before training, the image resolution is uniformly scaled to reduce the scale difference to the same range, which alle-
224×224 to ensure the rationality of network input. Due to a viates the impact on the back-layer network.
small number of training samples, random data augmenta-
The default image input size for the network is 224×224, so
tion was carried out on the selected tomato leaf pictures in
this is the reason for the uniform size of the data before (see
order to prevent the over-fitting phenomenon in training
Section 4). The convolution kernel size of the first layer is
process.
7×7, which is used to extract the primary characteristics of
Gaussian noise and Affine transformation were chosen to the pictures. The figure features then get into the bottleneck
process the leaf data in this paper, which is helpful to ex- residual block structure for deeper and higher level features
pand the amount of data. Each kind of processed pictures of extraction. For each convolutional layer, it is followed by a
Fig 5. Training loss. Blue curve: ReLU with 7×7 kernel size;
Green curve: Leaky-ReLU with 7×7 kernel size; Red curve:
Leaky-ReLU with 11×11 kernel size.
Fig 6, Fig 7 and Fig 8 (smoothed from tensorboardX) rec-
ords the training accuracy curve of the three experiments,
with a total of 24 epochs.
Fig 8. Training accuracy. Leaky-ReLU with 11×11 kernel size.
In the third experiment, the activation function was replaced
with Leaky-ReLU and the size of the convolution kernel in
the first layer was changed to 11×11. Compared with the
performance of the original network, the modified network
converges faster in the initial stage and converges better in
the later stage of training (see Fig 5 and Fig 8).
Table 1 records the accuracy and experiment time of the
three experiments on the training set and test set. Table 2
records the specific number of misclassified samples. The
data in the table is from the log file after the test program,
which records the classification results of each test picture.
For each leaf disease picture, the highest probability will be
Fig 6. Training accuracy. ReLU with 7×7 kernel size. the final predicted category and placed in the first place.