Deep Learning Approaches for Tomato Plant Disease Detection

Agriculture is the mainstream to keep pace in the Bangladeshi economy. Plant disease became a threat to food security as it is a very important factor to deteriorate the quality and quantity of harvest. Therefore, it is important to detect the plant diseases early which results in interrupting from falling the massive destruction of harvest. But, an erroneous diagnosis of the disease results in the inappropriate use of pesticides. In order to enhance the production quality and quantity, a deep learning-based approach is proposed to detect the tomato leaf diseases, and then classify the types of the disease using image dataset. This proposed approach trained two model architectures: inception V3 and Convolutional Neural Network (CNN). Inception V3 performs well and reaches a success rate with a 96.11% in order to identify whether the specific plant leaf is infected or healthy. The success rate is significant and makes this approach as a very useful way or early forewarning tool, and this approach might be an essential system to operate real agriculture fields. As the detection accuracy is recorded as 94.72% for CNN. We confirm that it achieves the experimental results with 94.72% and 96.11% for the detection and classification of infected leaves from dataset for CNN and Inception V3 respectively. 1


Introduction
The efficient research to plant disease detection and classification is closely connected to sustainable agriculture as climate change is responsible to the development of pathogen with altering phases and degrees [1]; host resistance is modified with changing the climate. As a result, it leads to physiological changes for the interactions of pathogen [2] [3]. However, the situation is becoming more vulnerable as it is supposed to transfer diseases globally than before. These new diseases are observed in new locations in which these are completely unknown and unidentified, and no expertise can be able to identify it to take the measures [4][5] [6]. There are many researchers who used deep learning approaches for solving complex tasks in different research areas in biomedicine, bioinformatics, biology, and robotics [7][8] [9] [10]. One framework named Caffe used to develop a CNN for several class classifications [11]. A CNN with ReLu activation is proposed for binary classification along with normalization layer regarding local contrast [12].
Also, GoogleNet and AlexNet are efficient to train and fine-tune for the classification of infected locations and symptoms of plant leaves [13]. Another work proposed three stage training using CNN [14]. During first to three stages, it realizes with lesions presence, to generate heat map to detect infection, and ultimately, features map are created. Saliency map method of Brahimi et al [15] to localize infected regions is supposed to improve accuracy for classification. Wang et al [16] studied the effect of the depth of neural network on the accuracy for classification. The biological name of tomatoes is Solanum Lycopersicon and this vegetable grows on drained soil [17]. In fact, around 90% farmers choose their field to grow it.
The literature survey reveals the necessity to detect and classify plant disease in the field of agriculture, and plant pathology. Agarwal et al. proposed deep learning model to detect tomato leaf diseases whose average accuracy is 91.2% [18]. This paper proposes the inception V3 model with 96.1% accuracy which is higher than the previous work. In this paper, Section 2 describes the different types of diseases for tomatoes leaves, Section 3 gives the materials and methods, Section 4 presents the results and discussion, and final Section 4 is used to conclude the paper summary as conclusion.

Tomatoes leaves diseases
There are different types of diseases for tomatoes leaves. Two among them are discussed in the following:

Early blight
The fungi Alternariatomatophila and A. solani causes early blight disease in tomato plant. There are small, and brown lesions on the older foliage on the plants. Spots are enlarged and became to concentric rings. The surrounding of the spots may be becoming yellow. Most foliage may be killed, if there are high temperature and humidity at that time. The lesion is observed on the stems. Infected fruits do not last more. [ Figure 1] shows the different types of images from the dataset early blight, healthy, late blight, and leaf mold.

Leaf mold
The fungus Passalora fulva causes the diseases leaf mold which is observed on older leaves close the soil. This happens for poor air movement and high humidity. The symptoms are pale green or yellowish spots initially on the top side of leaf surface, which is enlarging and turning a distinctive yellow.

Materials and methods
The procedures for developing model for disease recognition of tomatoes plant is described in the following.

Convolutional Neural Network (CNN)
CNN model has multi-layer along with a supervised learning architecture. The main parts are feature extractor and classifier. The roles of feature extractor are retrieving distinguishing features from the raw images. These happens by two operations: convolutional filtering and down sampling. The two vital properties of convolutional filtering are local receptive field and shared weights. Convolutional filtering works as a local feature extractor which makes the relationships between pixels of a training images. As a result, multi-filters extract most effective and high level features for enhancing the ability of CNN model for recognition. Moreover, it is important to reduce the number of trainable parameters as well as to improve the efficiency of training which happens by weight sharing and down sampling. Backpropagation algorithm is used to train the classifier in which it learns the weights by the feature extractor.

Inception model
Inception v3 is becoming popularity and accepted widely for image processing as it is very effective image recognition model. It is made up of max pooling, average pooling, convolutions, dropouts, concats, and fully connected layers. Also, SoftMax is used to compute the loss. Machine learning researchers need to spend huge time to construct a neural network for training the model. Sometimes, it may require days or weeks for training the model. This might run learning process using highly cost hardware, for example GPUs and parallelized systems. In another way, it is possible to run the same model within seconds if pre-constructed network structure and pretrained weights is used. In this way, learning outputs are transferred among different parties. Furthermore, you don't need to have a largescale training dataset. After transferring learning outcomes, there is no requirement of a large scale training dataset.

Dataset
The final dataset has been made by the images for tomato plant leaves are collected from PlantVillage dataset as well as the fields of Bangladesh. It contains 1800 image patches: 1300 are infected and 500 are healthy leaves. [ Figure 1] shows the sample images of leaves for early blight, leaf mold, and healthy leaves. These images are different regard to scale, illumination, rotation and partial viewpoint changes. Sometimes the background, texture, water body, and soil makes the difficulty for recognition correctly.
Deep learning does not be able to recognize shape and location. The factors above mentioned are responsible for significant challenges for tomato early blight disease recognition. There are no constraints for tomato plant images and their pixels. The patches of 128x128 pixels in size are chosen to extract from original larger images of the dataset. Also, moving window of a stride of 96 pixels are used in this approach. Finally, the experts identified the patches which contains lesions in order to use it as as positive samples, and patches which do not contain any lesions are used as negative samples.

Proposed framework
CNN is made up of multi-layers along with max pooling and dropout and it is a supervised learning architecture. For larger datasets, architectures must be deeper in order to get better results. We have used dropout layer to prevent over-fitting. In the proposed approach, we have used two InceptionV3 and CNN with fine tuning the parameters so that the best performance is achieved. [ Figure 2] shows the architecture of Inception v3 model which is used to classify the three classes. That means that it is developed to identify whether it is infected or healthy. Before training the models, it is required to scale images because inception model handles pixels between 0 and 128. If there are transfer values already calculated, and then it just be loaded. If it is not calculated, and saved them to a cache-file. The transfer values for the image are calculated using inception model. The transfer values of healthy leaves are saved in cache file.

Results and discussion
We have chosen PlantVillage dataset which is processed and augmented before training the model. It is very usual that convolutional networks are capable of learning features while training larger datasets, and the output is not satisfactory with the only original images. Therefore, fine-tuning the parameters help to achieve expected accuracy from the network.
The file path of images has been set up in the google drive for the training and testing set to calculate the transfer values and save into the cache. If there are transfer values already calculated, and then it just be loaded. If it is not calculated, and saved them to a cache-file. The transfer values for the image are calculated using inception model. The transfer values of healthy and infected leaves are saved in cache file.
On Google colab environment, Python library, Keras is used to implement this proposed models. 78 seconds, and 53 seconds for each epoch are required for CNN, and Inception V3 model respectively. After ending each epoch, a slight break happens in order to compute its loss and accuracy for deep learning model in terms of testing sample images for validation.
The hidden layer is used to make feature maps in which each neuron of a feature map considers at different locations of the input image. Ultimately, this feature map is generated because of convolution through the image with filters. Each layer has different features stated in different block. For feature map, visualization is created for the activation. Activation of first convolutional layer and second convolutional layer of deep network are shown in [ Figure  3].  Table 1]. We also focus to find out the reasons for misclassification. That is why misclassification samples are analyzed to identify distinguished things. We observed that blur, water droplets and small or incomplete lesion make the distinguished mistakes. Also, shadow, light spot, water droplets and complex background are responsible for misclassification. However, preprocessing and augmentation before training demonstrates that this proposed model can correctly and effectively recognize almost all of the tomato blast lesions. The results may have slight variation due to a because of diverse random initialization of the model.

Conclusion
In this paper, we have studied several deep learning architectures, and two approaches of deep learning with fine-tuning parameters were explored in order to automatically detect and classify tomatoes plant diseases. Inception V3 performs well and reaches a success rate with 96.11% in order to identify whether the specific plant leaf is infected or healthy. However, the detection and classification accuracy is 94.72% for CNN which is lower than the previous