Tomato Leaf Diseases Detection Using Deep Learning Technique

Plants are a major source of food for the world population. Plant diseases contribute to production loss, which can be tackled with continuous monitoring. Manual plant disease monitoring is both laborious and error-prone. Early detection of plant diseases using computer vision and artificial intelligence (AI) can help to reduce the adverse effects of diseases and also helps to overcome the shortcomings of continuous human monitoring. In this study, we have extensively studied the performance of the different state-of-the-art convolutional neural networks (CNNs) classification network architectures i.e. ResNet18, MobileNet, DenseNet201, and InceptionV3 on 18,162 plain tomato leaf images to classify tomato diseases. The comparative performance of the models for the binary classification (healthy and unhealthy leaves), six-class classification (healthy and various groups of diseased leaves), and ten-class classification (healthy and various types of unhealthy leaves) are also reported. InceptionV3 showed superior performance for the binary classification using plain leaf images with an accuracy of 99.2%. DenseNet201 also outperform for six-class classification with an accuracy of 97.99%. Finally, DenseNet201 achieved an accuracy of 98.05% for ten-class classification. It can be concluded that deep architectures performed better at classifying the diseases for the three experiments. The performance of each of the experimen-tal studies reported in this work outperforms the existing literature.


Introduction
Thousands of years ago, the development of agriculture led to the domestication of main food crops and animals today. One of the major global problems that humanity faces today is food insecurity [1] of which plant diseases are a major cause [2]. According to one estimate, plant diseases collectively account for a crop yield loss of around 16% globally [3]. The global potential loss from pests is estimated to be around 50% for wheat and 26-29% for soybean [3]. Plant pathogens are

Pathogens of tomato leaves
Fungi is the predominant plant pathogens and it can cause multiple diseases including early blight, septoria leaf spot, target spot, and leaf mold. Fungi can attack plants through different sources such as infected soil and seeds. Fungal infections can spread from one plant to another through animals, humans, machinery, and soil contamination. The fungal attack vectors include plant pruning wounds, insects, leaf stomata, and others. The early blight disease of tomato plants is caused by the fungus, which affects the plant leaves. If it affects the seedlings' basal stems, adult plant's stem, and fruits, it is called collar rot, stem lesion, and fruit rot, respectively [26,27]. Numerous methods have been devised for the control of early blight but the most effective methods are cultural control i.e. efficient soil, nutrients, and crop management to reduce infections and also with the use of fungicidal chemicals. Septoria leaf spot of tomato plants is caused by fungus [28,29], which releases tomatinase enzyme that speeds up the degradation of tomato steroidal glycoalkaloids α-tomatine [30,31]. The target spot disease of tomato plants is caused by the fungus [32,33]. Symptoms of target spot disease in tomato plants are necrotic lesions of light brown color in the center [34,35]. The lesions spread to a larger blighted leaf area and result in early defoliation [34,35]. The target spot also damages the fruit directly by entering into the fruit pulp [34,35]. The leaf mold disease of plants is caused by the fungus [36,37]. It occurs during periods of extended leaf wetness. Bacteria is also a major plant pathogen. Bacteria enter plants through wounds such as insect bites, pruning, cuts, and also through natural openings such as stomata. Plant's surrounding environmental conditions such as temperature, humidity, soil conditions, availability of nutrients, weather conditions, and airflow are important factors in determining the bacterial growth on the plant and the consequent damage. Bacterial spot is a plant disease caused by bacteria [38,39]. Molds are also a major cause of plant diseases. Late blight disease of tomato and potato plants is caused by mold [40,41]. The appearance of dark uneven blemishes on leaves tips and plant stems are a few of the symptoms. Tomato yellow leaf curl virus (TYLCV) is a devastating virus causing tomato disease. This virus attacks the plant through another insect. Although tomato plants are unhealthy diseased leaves and iii) ten-class classification of healthy and various diseased leaves. In study II, different types of tomato leaf diseases are classified into the group of diseases while in study III, different classes of unhealthy and healthy leaf images were classified. Similar experiments the primary hosts for the virus, this viral infection has been reported in several other plants including beans and pepper, tobacco, potatoes, and eggplants [42,43]. In the Technology in Agriculture last few decades, due to the rapid spread of the disease, the research focus has been shifted to damage control of yellow leaf curl disease [44][45][46][47]. Another viral disease that specifically affects tomato plants is caused by Tomato mosaic virus (ToMV). This virus is found worldwide and affects not only tomatoes but other plants as well. Symptoms of ToMV infection include twisting and fern-like appearance of leaves, damaged fruit with yellow patches, and necrotic blemishes [48,49].

Methodology
The overall methodology of the study of the paper is summarized in Figure 1. This study used tomato leaf data from the plant village dataset [50,51], where tomato leaf images are provided. As explained earlier, the paper has three different studies: (i) binary classification of healthy and unhealthy leaves; (ii) six-class classification of healthy and different disease group leaves were conducted; and (iii) ten class of healthy and several different diseased leaves were carried out. The classification is done using pre-trained networks-ResNet18, MobilenetV2, InceptionV3, and DenseNet201 that have been comparatively successful in previous publications [8,10,11,[52][53][54][55][56][57].

Datasets description
In this study, plant village tomato leaf images dataset was used [50,51], where 18,162 tomato leaf images are available. All images were divided into 10 different classes, where one class is healthy and the other nine classes are unhealthy (such as-bacterial spot, early blight, leaf mold, septoria leaf spot, target spot, two-spotted spider mite, late bright mold, mosaic virus, and yellow leaf curl virus), and 9 unhealthy classes are categorized into five subgroups (namely-bacterial, viral, fungal, mold and mite disease). Some sample tomato leaf images, for healthy and different unhealthy classes from plant village dataset are shown in Figure 2. Moreover, a detailed description of the number of images in the dataset is also shown in Table 1, which is useful for classification tasks discussed in detail in the next section.

Resizing and normalizing
The various CNN network has input image size requirements. Thus, the images were resized to 299 × 299 for Inceptionv3 and 224 × 224 for Resnet18, MobilenetV2, and DenseNet201. Using the mean and standard deviation of the images of the dataset, z-score normalization was used to normalize the images.

Augmentation
Training with an imbalanced dataset will result in a biased model because the dataset is not balanced and does not contain a comparable number of images for the various categories. As a result, data augmentation can aid in the creation of a similar number of images in each class, resulting in reliable results, as reported in numerous recent publications [6][7][8][9][10][11]. To align the training images, three augmentation techniques (rotation, scaling, and translation) were used. The images were rotated in a clockwise and counterclockwise direction with an angle of 5 to 15 degrees for  image augmentation. The scaling process involves enlarging or shrinking the image's frame size, and 2.5 percent to 10% image magnifications were used in this analysis. Image translation was accomplished by converting images by 5-20% horizontally and vertically.

Experiments
Four pre-trained CNN models were investigated that were originally trained on ImageNet Database [58] to classify tomato leaf images. Three different classification experiments were carried out in this study. Tables 2-4 summarize the details of the images in the experiments for three different classification of leaf images separately. Two of the four pre-trained networks are shallow (MobilenetV2, and ResNet18), while the other two are deep (Inceptionv3, and DenseNet201) to see whether shallow and deep networks are appropriate for this application. Table 5 presents a summary of the parameters (Batch size (BS), Learning rate (LR), Epochs (E), Epochs patience (EP), Loss function (LF), Optimizer (OP)) for classification in experiments.
All of the studies were conducted on an Intel Xeon Processor E5-2697 v4, 2.3 GHz with sixty-four GB RAM and a sixteen GB NVIDIA GeForce GTX 1080 GPU using the PyTorch library and Python 3.7.

Performance matrix
Important performance metrics for classification experiment is stated in Eqs. (1)-(5):     Here, true positive (TP) is the number of correctly classified healthy leaf images and true negative (TN) is the number of correctly classified unhealthy leaf images. False-positive (FP) and false-negative (FN) are the misclassified healthy and unhealthy leaf images, respectively.

Results
The performance of various networks in the different experiments is reported in this section.
In this study, three different experiments were conducted for tomato leaf images and the comparative performance for four different CNNs for the three classification schemes is shown in Table 6. It is apparent from Table 6 that all the evaluated pre-trained models perform very well in classifying healthy and unhealthy tomato leaf images in two-class, six-class, and ten-class problems.
Among the networks trained with leaf images for two-class, six-class, and tenclass problems, Densenet201 outperformed other trained models except without segmented two-class and with segmented six class problems where InceptionV3 was the best-performing network. Moreover, shallow networks ResNet18, and MobilenetV2 both showed comparable performance to most of the deep networks for the classification of images.
DenseNet201 outperforms others and for six-class and ten-class problems showed accuracy, sensitivity, and specificity of 97.99%, 97.99%, 99.54% and 98.05%, 98.03%, 99.76%, respectively. On the other hand, InceptionV3 produced the best result with accuracy, sensitivity, and specificity of 99.2%, 99.2%, and 96%, respectively for the two-class problem. Figure 3 clearly shows that the Receiver operating characteristic (ROC) curves for two-class, six-class, and ten-class problems of tomato leaf images. It is evident from Figure 3 that network performances are comparable for 2-, 6-and 10-class problems. However, deep networks can provide better performance gain for 6-and 10-class problems.  The confusion matrix for the best performing networks for the different classification problems are shown in Figure 4. It can be noticed that even with the best performing network InceptionV3 for two-class tomato leaf images, 69 out of 16,570 unhealthy tomato leaf images were miss-classified as healthy and 74 out of 1,591 healthy tomato leaf images were miss-classified as unhealthy images.
For the six-class problem, which consisted of one healthy class and five different unhealthy classes, only 27 out of 1,591 healthy tomato leaf images were missclassified as unhealthy images, and 385 out of 16,570 unhealthy tomato leaf images consisted of one healthy class and nine different unhealthy classes, only 32out of 1,591 healthy tomato leaf images were miss-classified as unhealthy images and 382 out of 16,570 unhealthy tomato leaf images of nine different categories were missclassified as healthy or any other unhealthy classes.

Discussion
Plant diseases are a major threat to global food security. Latest technologies need to be applied to the agriculture sector to curb diseases. Artificial intelligence-based technologies are extensively investigated in plant disease detection. Computer vision-based disease detection systems are popular for their robustness, ease of acquiring data, and quick results. This research investigates how different CNNbased architectures perform on classification of tomato leaf images. The study was divided into 3 sub-studies of 2 class classification (Healthy, and Unhealthy), 6 class classification (Healthy, Fungi, Bacteria, Mold, Virus, and Mite), and 10 class showed an overall accuracy of 99.67%. In 6 class classification, DenseNet201 showed an overall accuracy of 97.99%, while InceptionV3 showed an overall accuracy of 97.65%. In 10 class classification, DenseNet201 showed an overall accuracy of 98.05%, while InceptionV3 showed an overall accuracy of 97.35%. The results in the paper are comparable to the state-of-the-art results and are also summarized in Table 7. Although the Plant Village dataset used in this study contains images taken in diverse environmental conditions, the dataset is collected in a specific region and is of specific breeds of tomatoes. A study conducted using a dataset containing images of other breeds of tomato plants from different regions of the world may result in a more robust framework for early disease detection in tomato plants. Furthermore, the lighter architecture of CNN models with non-linearity in the feature extraction layers might be useful to investigate for portable solutions.

Conclusion
The stages of the process into the infinite possibilities of machine learning for agriculture applications, complete with case studies. ResNet, MobileNet, DenseNet201, and InceptionV3 are examples of state-of-the-art pre-trained CNN models that do an excellent work of classifying diseases from plant leaf images. When compared to other architectures, the DenseNet201 was found to be better at extracting discriminative features from images. The trained models can be used to detect plant diseases early and automatically. As a result, preventive actions can be adopted faster. This research could help with early and automated disease detection in tomato crops, due to the use of cutting-edge technology like smartphones, drone cameras, and robotic platforms. The proposed structure can be combined with a feedback system that provides appropriate insights, treatments, disease prevention, and control techniques, resulting in improved crop yields.