Image-based Tomato Disease Identiﬁcation Using Convolutional Neural Network

Objectives: Agriculture is the main food source and farmers are challenging a great production loss annually due to plant leaf disease. Early identiﬁcation of tomato plant diseases help farmers to take preventive measure to reduce production loss. As a result, to recognize tomato plant leaf diseases in its early stage, a deep learning approach is discussed. Methods: For tomato disease identiﬁcation and classiﬁcation a convolutional neural network model is used in this study. CNN is capable for ﬁne-grained disease identiﬁcation as a technique which avoids feature engineering and threshold segmentation through automatic feature extraction. Findings: In this experiment, we have used 22,930 leaf image dataset are taken from plant village dataset, some are collected from Awash Melkasa tomato cultivation area in various seasons. Image processing is conducted along with pixel with operations it enhance the image data followed with feature extraction of patterns of collected leaves to detect the leaf diseases. The extracted patterns are ﬁt into the neural network model with 100 epochs, 80/20 splitting ratio, and 0.001 learning rate. Hence the tomato disease network model achieves an overall 98.3% accuracy performance. Novelty: In order to detect tomato leave disease, we performed image processing with pixel-wise operation to enhance the leaf images that can be followed by feature extraction to classify patterns. We extend, and adopt neural network using local images collected under challenging environment datasets and optimization is performed in Adam optimizer with categorical entropy as loss function. various rotated images to increase testing performance (18) . In this work, an arbitrary combination of diverse image augmentation ways is used in order to augment images. We have used rotation range=45, validation split=0.2, rotation range = 45, width shift range=.15, height shift range =.15, horizontal flip=True, zoom range=0.5 augmentation techniques.


Introduction
The lives of Ethiopian depend on agriculture in which the majority of the population is agrarian, cultivates tomato as the main vegetable food (1) . Nearly 85% of the people in Ethiopia depend on agriculture as their fundamental means of livelihood nutrition (2,3) . By the year 2050, the United Nations food and agriculture organization intends to increase the agriculture yield by 70% to overcome world food security (4) . In this context, the agricultural landmass plays a central role in the economic and social life of the https://www.indjst.org/ people in the country. In recent decades, agricultural production has become much more significant than it used to be some years back where plants were only used to feed humans as well as animals.
In an agrarian economy disease identification of fruits is an involved challenge, causes most important production as well as economic losses. To improve the production of plants, it is most significant that the plant diseases and pests should be identified earlier to take immediate course of action according to the disease type. Commonly the main causes of disease in plants are fungal, bacterial, and viral, these diseases are can be detected by monitoring the stem, leaves, or fruit part of the plant (5) . Identification of these diseases without an agricultural expert is a difficult task for farmers in which they detect in their naked eye that needs experience. Early identification of tomato leaf disease is very significant in mitigating and monitoring the spread of the diseases (6) . Nowadays Tomato production is suffered several diseases (7) , various tomato diseases like Tomato Bacterial Spot, Early Blight, Septoria spot, Leaf mold, Late blight which reduces the production sometimes loss 100% on the unimproved local cultivar and quality of tomato yields.
Plant diseases can be detected by experts usually pathologists, which is resulting by only 1% of the farmers due to its maximum cost (8,9) . Another economical possibility is discussed in this study that is using deep learning (CNN) approach, is excellent in understanding patterns from a large amount of data and achieving high performance in various benchmarks. And we have used CNN model architecture for this work because it increases the depth of the network to achieve high accuracy, training efficiency, generality and it is computationally efficient in the utilization of resources and the number of parameters. It's a local connection, weight sharing and pooling operation which make it potential to decrease complexity of the network efficiently (9,10) . The purpose of this study is to apply the state of art convolutional neural network architecture for the identification of visible tomato leaf diseases and pest symptoms on various parts of the plant leaves. We also deliberate the potential for adapting pre -trained convolutional neural network models to identify tomato leaf diseases and pest symptoms using large amount of dataset of experts pre-screened real environment images taken from Awash Melkasa agriculture farms. As shown in Figure 1 , these are diseases that mostly affect the tomato plant. In Ethiopia disease identification by farmers is through the naked eye which requires experience that depends on their knowledge. The other economical option of tomato plant disease detection either infectious or non-infectious is by using a deep neural network in image processing (11) .

Literature review
Machine learning techniques are used in several areas, however, feature engineering remains an involved problem that costs too much time. Through the development of a deep convolutional neural network, resulting in a substantial-quality gains in different benchmarks for plant pathology without strenuous feature engineering. This section presents deep learning approaches used by researchers in plant disease identification. In (12) a multiclass deep convolutional neural network is applied to detect rice plant anomalies. They have been collected 227 rice plant images which can be categorized into three classes using transfer learning on AlexNet which is minor and child convolutional neural network architecture. They applied the image augmentation technique to get more images and trained the model in 10 epochs handling to get a test accuracy of 91.23%. AlexNet is computationally costly and the model is not stable to update new parameters. Mohanty Sharada P (13) applied GoogleNet and AlexNet neural https://www.indjst.org/ network architectures to train 54,306 images from the plant village dataset, in which GoogleNet realizes better and reliable through a training accuracy of 99.35%. However, the accuracy reduces to 31.4% while tested in images taken under conditions varied from images used to train the model. In (14) presented a CNN model to identify 22 classes of weed and crop disease which have been tested on 10413 image datasets and had attained an accuracy of 86.2% performance. The model has the issue of identifying some plant species and even it is claimed that the work achieved is lower accuracy due to the small number of training datasets for these species. Selvaraj (15) has investigated a deep learning-based recognition of banana species disease in which it trained in three various CNN architectures i.e. inception V2, ResNet50, and MobileNetV1 to identify banana diseases and pests using transfer learning. They used 18,000 banana leaf images taken from various areas of banana plant cultivation area which is annotated into 18 different classes of banana diseases and pests. The experimental result indicates that the model realized more than 90% accuracy from the dataset held out. In (9) provides a CNN model to identify tea leaf disease in that they have used rectified linear unit activation function of neurons to speed up the convergence of the network. In their experiment, they have tried various learning rates and steps. In their initial experiment, the iteration number was 50000 times and the size of the step is 100 with a learning rate of 0.0001. The learning rate determines the gradient descent step size in the backpropagation. In this experiment phenomena overfitting happens, and to address this issue the author added dropout in the experiment and minimize the number of iterations into 40000 times and has achieved 93.75%. Zhang (16) applied the CNN model to identify leaf disease of vegetables using a three-channel convolutional neural network for each RGB color on the diseased leaf image. Finally, the softmax classifier layer identifies the diseases.
But in this study, performance analysis is performed by adopting the pre-trained weights which is gained by training models on the ImageNet dataset which is efficient and gives better accuracy performance. And the disease classification optimization is conducted using Adam optimizer along with categorical cross entropy as the loss function.

Image acquisition
The image dataset is created with images captured using a smartphone that has 13Mga pixel resolution and from public dataset images taken from the plant village dataset. Our collected images were taken from the Awash Melkasa river area in various seasons in order to mitigate the loss of disease features due to specular reflection. A total of 22,830 image dataset is used in this work. These images are preprocessed in the conventional deep learning input dimension model (specifically 256*256*3) in 10 classes including healthy tomato leaf.

Image preprocessing
Images from various data sources might have different image sizes. Before feeding the data to the neural network, it is mandatory to rescale and resize the image into the standard image dimension model specifically 256*256*3 which have been stored in driver in JPEG format. The JPEG image is encoded using the Keras package and decoding it into various color channels (RGB) grid pixels. Then the RGB color should be changed to into floating-point Tensor (3D volume). Finally rescaling the pixels into 256*256 and convert the image into NumPy arrays. In the dataset the image is resized in the preprocessing stage. The image processing consists noise removal, image enhancement to increase the quality of image visually. In color space conversion, the three color channel (RGB) image is converted into greyscale using different color models such ad HSV, and CIELAB.

Segmentation
Segmentation (17) is applied in image datasets that are of 3 dimensions. The basic objective is to separate the region of interest or only the characteristics feature of the image dataset not the pixel of the entire part of an image because the pixel coverage is recommended by experts in which the tomato disease is found to be and produce the good best result.

Image transformation
Several images are required in order to train the proposed CNN model. The basic aim of using augmentation is to maximize the number of the dataset used for the training and to introduce slight distortion to the images to minimize overfitting during training the model and image transformation is applied during a testing stage in various rotated images to increase testing performance (18) . In this work, an arbitrary combination of diverse image augmentation ways is used in order to augment images. We have used rotation range=45, validation split=0.2, rotation range = 45, width shift range=.15, height shift range =.15, horizontal flip=True, zoom range=0.5 augmentation techniques. https://www.indjst.org/ Various images are produced from the original by using the above augmentation code techniques. While transformation, images would not be stored in a disk and don't require memory storage due transformed images are created at run time which is effective in computation. Using the augmentation method we address the overfitting issue, on the other hand, it can increase testing performance. In the proposed work of CNN architecture, three convolution and max-pooling layers are applied. In each convolution and max-pooling layer different number of filters has been used. The convolution layer is used to create a feature map from the image dataset (19) . The convolution layer doesn't employ weights. MaxPooling2D is used to minimize the spatial size of incoming features; 2D input space: MaxPooling2D (2, 2). A fully connected layer determines the number of categories in tomato diseases and healthy as 10.

Results and Discussion
The proposed Convolutional neural network model is executed using the NVIDIA Tesla K40 machine. In the collected dataset images in each class are varies so as to balance the classes that data augmentation would be applied to have large numbers of the dataset in the training phase to avoid overfitting while training the CNN learning model. The model has a total of 4 layers, three convolutions, and one dense layer. It takes an image size 256x256 color images, which gives an output of 10 classes. As depicted in the Figure 5 under (X-axis represents the number of epochs and Y-axis represents accuracy), so as we train the model using 50 epoch size, it obtains 96.6% training accuracy and, 96.1% validation accuracy. This identification accuracy is obtained without applying augmentation, dropout rate, and batch normalization at the initial stages. The training loss decreases linearly from epoch to epoch but the validation loss oscillates up and down initially and it was very high and gradually declines. As shown in the below Figure 6 (left), the X-axis represents the number of epochs and Y-axis represents accuracy. The gap in performance between the training and validation accuracy from epoch 1-20 is similar but after that relatively related performance, the training accuracy is most of the time greater than validation accuracy throughout the graph. However the validation and training accuracy be direct or indirect, it shows that the model is over fitted in some way. In Figure 6(right), not much gap is seen between the training and validation loss. Finally after applying augmentation and increasing the number of epoch sizes to 100, evaluating the model the test accuracy is found to be 98.3%. The training progress shows an increase in the training accuracy and a simultaneous decrease in the loss as the number of epoch's increases. During the training and validation, the loss is the summation of errors for each sample in the training and validation sets. The lower the loss, the better the model and identification result. In experiment we used ReLu activation function due it can address the vanishing gradient https://www.indjst.org/ issue which can allow models to learn faster and perform better. Tomato leaf disease detection using optimized pre trained convolutional neural network is conducted (20) using two types of datasets which are collected from the real field in uncontrolled environment then augmented to maximize the number of datasets used for the experiment and public dataset collected from controlled environment which is a real world representation . In this experiment authors have proved to be more challenging for pre trained network models. Models were not perform well on the field based dataset which have to be optimized to have better performance in the real-field dataset conditions. In (21) develops a tomato disease detection model using Faster R-CNN and Mask R-CNN to detect the tomato disease and segment the location and parts of infected areas respectively. In their model there is a detection failure issue occurred due to low image resolutions which is addressed in this study. In (22) conducted tomato disease and pest detection using an improved YOLO V3 CNN using real environment datasets. However, disease and pest appearances are various in different tomato growth seasons, the dataset used are not divided according to their various growth periods and data are not much as well have not high quality images. In (13) conducted a research work using GoogleNet and AlexNet convolutional neural network architectures to train 54,306 image datasets which are taken from the plant village database collected under in controlled situation, in which GoogleNet realizes better and reliable through a training accuracy of 99.35% and 85.53 % in case of AlexNet architecture. However, the accuracy reduces to 31.4% while tested in images taken under conditions varied from images used to train the model. In the above all works, during the experiment authors used different training and testing dataset origins, in this situation, during testing the tool can simply detect the disease due to it knows that particular image data. In this study, the training dataset is taken from the public plant village database and some datasets are taken from the local agriculture farms. Initially, the validation dataset used to test the model is originated from the same dataset in the training set. In the experiment for the tomato disease network model is an RGB data, a dataset with three channel images, applying various augmentation technics such as zoom, width shift, height shift, rotation, shear range, fill mode, brightness range, vertical and horizontal flip. Here, the most significant factor that have impacts in the accuracy performance and efficiency of the model are training epochs and learning rates. The number of epoch is the iteration number the model learns the entire data. In this study, it is archived with highest accuracy with 100 epochs for the tomato disease network model.

Conclusion
There are several developed approaches in tomato plant leaf disease identification and classification. However, there is a limitation in efficiency and effective commercial solution which can be applied to detect diseases. In this study, we have designed a CNN based model to detect tomato leaf diseases. In the proposed work, we have developed a CNN based model to detect the disease in tomato crop. In the convolutional neural network model, there are three convolution and max pooling layers https://www.indjst.org/ with different filters in each layer. In our experiment, the tomato leaf image from plant village dataset which have 10 classes including the healthy leaf images. The dataset we used for the experiment is a three-color channel dataset by applying various dropout values, augmented, and segmentation techniques. In the first experiment while we make the epoch size to be 50, the model accuracy would achieve 96.8% performance results. Finally, after data augmentation dataset is archived, the result is enhanced to 98.3% accuracy performance, which is a promising result. In the future work, the progress of recognition of the tomato disease has been further investigated to analyses the severity status of the diseases.