Updated Research Paper - 295

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Tomato Plant Disease Detection

Pratik Nagare1, Dr. Avinash Bhute2


Computer Engineering, Pimpri Chinchwad College of Engineering Pune, India
[email protected]
[email protected]

Abstract

Tomato cultivation holds significant global importance, particularly in India, ranking second in
production worldwide. However, the crop faces substantial threats from various diseases,
impacting both quality and quantity. Traditional detection methods prove inadequate for
timely and large-scale interventions. To address these challenges, this research explores the
application of deep learning and machine learning techniques for automating tomato leaf
disease detection. By leveraging convolutional neural networks (CNNs) and advanced
algorithms such as EfficientNetV2, YOLOv5, MobileNet and Faster R-CNN, this study aims to
revolutionize disease identification processes. The integration of synthetic images, transfer
learning, and hybrid optimization further enhances the efficacy and efficiency of disease
detection systems. Through this research, we strive to empower farmers with rapid, accurate,
and cost-effective tools to safeguard crop health and bolster productivity.

Keywords : Convolutional neural network (CNN), Deep learning, EfficientNetV2, YoloV5,


Faster RCNN, Hybrid optimization, Transfer learning, Synthetic images.

Introduction

Tomato is the most popular crop in the world and in every kitchen, it is found in different forms
irrespective of the cuisine. Tomato cultivation stands as a cornerstone of global agriculture,
with India emerging as a significant contributor to its production. Despite its widespread
popularity, the tomato crop faces formidable challenges posed by various diseases,
jeopardizing agricultural sustainability and economic prosperity.
Traditional disease detection methods, reliant on manual inspection and expert opinions,
prove time-consuming and impractical for addressing the urgent needs of the agricultural

1
industry. To mitigate these challenges, this research proposes the adoption of cutting-edge
technologies such as deep learning and machine learning. By harnessing the power of
computer vision and advanced algorithms, we aim to develop automated systems capable of
early detection and classification of tomato plant diseases.
Several researchers in 2023 developed various models for detecting diseases in tomato leaves
using machine learning and deep learning techniques. ML and DL techniques have the
potential to revolutionize tomato disease detection. This paper presents a comprehensive
analysis of recent advancements in tomato disease detection, focusing on the application of
convolutional neural networks and deep learning techniques. We delve into the
methodologies employed, including the utilization of EfficientNetV2, YOLOv5, MobileNet and
Faster R-CNN, along with hybrid optimization strategies. Furthermore, we discuss the
integration of synthetic images and transfer learning to enhance the accuracy and efficiency
of disease detection systems. Through this research, we aim to provide insights and
methodologies that contribute to the ongoing evolution of agricultural technology and
empower farmers worldwide.

Literature Survey

Mohit Agarwal et al. [1] conducted research on tomato leaf disease detection using a custom
Convolutional Neural Network (CNN) architecture. They proposed a CNN-based approach that
achieved an average accuracy of 91.2% with their custom architecture, surpassing the
performance of pre-trained models such as VGG16, InceptionV3, and MobileNet. The study
emphasized the model's efficiency by highlighting its reduced storage space, making it suitable
for deployment on mobile devices.

2
Preeti Basera et al. [2] introduced the "TomConv" model, which was a custom four-layered
Convolutional Neural Network (CNN) designed for the classification of tomato plant leaves
into ten categories. The study utilized the PlantVillage dataset and achieved an accuracy of
98.19% using this four-layered CNN model with ReLU activations and max-pooling. This
custom model was noteworthy for its efficiency in the training process and its ability to handle
variations in lighting conditions and noise effectively.
Rakesh Sharma et al. [3] conducted a study titled "Tomato Leaf Disease Detection Using
Machine Learning," where they explored tomato leaf disease detection through machine
learning methods, specifically Convolutional Neural Networks (CNN) and ResNet-50, and
achieved an accuracy of 94.1%. The study highlighted the practicality of the CNN model due
to its ease of implementation and reduced computational demands.
Nagamani H S and Dr. Sarojadevi H [4] conducted research on tomato leaf disease detection
using a range of machine learning techniques, including Fuzzy Support Vector Machine (Fuzzy-
SVM), Convolution Neural Network (CNN), and Region-based Convolution Neural Network (R-
CNN). They achieved the highest accuracy of 96.735% with the R-CNN-based classifier.
However, the study could have been enhanced by providing additional details about the
dataset, experimental setup, and methodology to offer a more comprehensive understanding
of their research.
Badiger and Mathew [5] presented a comprehensive system for tomato plant leaf disease
detection, utilizing deep learning models and a hybrid optimization algorithm that combined
the Gradient-Golden Search Optimization (GSO) with the Jaya algorithm. The system achieved
an accuracy of 98.66% for segmentation and 99.89% for disease detection, surpassing other
deep learning-based methods. It should be noted, however, that the approach necessitated a
substantial dataset for training.
Amreen Abbas et al. [6] introduced an innovative method for tomato plant disease detection,
utilizing transfer learning with Conditional Generative Adversarial Network (C-GAN) synthetic
images. Their approach integrated a C-GAN synthetic image generation module with a tomato
plant disease detection module based on DenseNet121. Remarkably, this method achieved
an impressive accuracy of 99.51%. It should be noted, though, that this approach required a
substantial dataset for training the C-GAN module.
Xu-hang Wu et al. [7] introduced an innovative tomato leaf disease identification system that
combined EfficientNetV2 and YoloV5, achieving an accuracy of 98.66% for tomato leaf
detection and 99.89% for disease classification. However, it should be noted that potential
dataset size limitations and sensitivity to environmental variations were factors to consider in
their approach.
Qimei Wang and Feng Qi [8] introduced a tomato diseases recognition system using the Faster
R-CNN deep learning model, achieving an accuracy of 97.8%. The high accuracy, efficiency,
and ease of deployment make it a valuable tool for tomato disease recognition. Nevertheless,
it should be noted that a substantial dataset was required for training, and its robustness
under diverse lighting conditions should be further assessed.

3
Architecture

Fig. 1 Architecture

Image Dataset: The first step is to collect a dataset of tomato leaf images, both diseased and
healthy. The dataset should be as large and diverse as possible to ensure that the model can
learn to generalize to new images.
Data Preprocessing: Once the dataset has been collected, it needs to be preprocessed. This
may involve resizing the images, converting them to a grayscale or RGB format, and
normalizing the pixel values.
Data Augmentation: Data augmentation is a technique used to artificially increase the size of
the dataset by creating new images from existing ones. This can be done by
flipping, rotating, cropping, and adding noise to the images.
Split Dataset: The dataset is then split into three subsets: training, validation, and test. The
training set is used to train the model, the validation set is used to monitor the model's
performance during training, and the test set is used to evaluate the model's performance on
unseen data.

4
Train Dataset: The CNN model is trained on the training set. This involves feeding the images
to the model and allowing it to learn to extract features from the images and associate those
features with the corresponding disease labels.
Validate Dataset: The model's performance is evaluated on the validation set. This is done to
ensure that the model is not overfitting to the training data. Overfitting occurs when the
model learns the training data too well and is unable to generalize to new data.
Test Dataset: Once the model is trained and validated, it is evaluated on the test set. This gives
a final estimate of the model's performance on unseen data.
Convolutional Neural Network Architecture: The CNN architecture in the diagram consists of
the following layers:

• Convolutional layers: Convolutional layers are responsible for extracting features from the
input images. They do this by sliding a small filter over the image and computing the dot
product between the filter and the image pixels.
• Max-pooling layers: Max-pooling layers are responsible for reducing the spatial
dimensions of the feature maps produced by the convolutional layers. They do this by
taking the maximum value from a small region of the feature map.
• Fully connected layers: Fully connected layers are responsible for classifying the feature
maps produced by the convolutional and max-pooling layers. They do this by computing
the weighted sum of the feature maps and applying a non-linear activation function.
Train Model: The CNN model is trained on the training set using a technique called stochastic
gradient descent (SGD). SGD involves iteratively updating the model's parameters to minimize
the loss function, which measures the model's error on the training data.
Validate Performance: The model's performance is evaluated on the validation set. This is
done to ensure that the model is not overfitting to the training data.
Final Model: The final model is the model that performs best on the validation set.
Test the Model: The final model is evaluated on the test set to get a final estimate of its
performance on unseen data.
Performance of the Model: The performance of the model is typically measured using the
following metrics:

• Accuracy: Accuracy is the percentage of images that the model correctly classifies.
• Precision: Precision is the percentage of images that the model predicts as diseased that
are actually diseased.
• Recall: Recall is the percentage of diseased images that the model correctly classifies as
diseased.
• F1 score: The F1 score is a harmonic mean of precision and recall.

5
Methodology/Approach Comparison

The methods vary in data preprocessing, image augmentation, and dataset sizes. Some use
custom datasets, while others rely on publicly available datasets such as PlantVillage and
Kaggle. Some models focus on segmentation, while others perform classification directly.

Hybrid Optimization Deep Learning Approach :


Badiger and Mathew [5] introduced a hybrid optimization-driven deep learning approach
aimed at segmenting tomato plant leaf diseases and detecting multiple disease classes. This
method comprised two key components: firstly, the tomato leaf disease segmentation
module, which effectively segmented the background and identified diseased regions through
a U-Net model trained with the Gradient-Golden search optimization (GGO) algorithm and the
Jaya algorithm. Secondly, the multiclass disease detection module, designed to categorize the
identified diseased regions into various disease classes using a deep batch-normalized eLu
AlexNet (DbneAlexnet) model trained with the Gradient Jaya-Golden search optimization (GJ-
GSO) algorithm. This comprehensive approach demonstrated its capability to detect a range
of tomato leaf diseases, including early blight, late blight, and leaf curl virus, while also
proficiently segmenting the tomato leaf background and identifying regions affected by
diseases.

CNN Model with 4 Convolutional Approach :


Preeti Basera et al. [2] introduced CNN model in which 16,012 tomato leaf images from
PlantVillage dataset with 10 classes is used After being resized to 150x150 for efficiency and

6
split into 80:20 training-validation. A CNN model with four convolutional layers, ReLU
activation, max-pooling, and two dense layers was used after being trained using the Adam
optimizer for 100 epochs to minimize cross-entropy loss function and improve accuracy. The
model was evaluated on the validation set using accuracy as the metric after being trained.
f(x) = max(0, x)
softmax(zi) = exp(zi) / ∑jexp(zj)
Loss = -∑Mc=1 (yc – log yc)

Faster R-CNN Approach :


Qimei Wang and Feng Qi [8] proposed system which has two modules : Data preprocessing
and tomato diseases recognition. The input images were preprocessed by resizing them to a
fixed size, normalizing them, converting them to grayscale, and augmenting them. The Faster
R-CNN model was trained on the preprocessed dataset to detect and classify tomato diseases
in the images. The trained model was evaluated on a test set of tomato leaf images to assess
its performance. The model was then applied to new images to recognize tomato diseases
and display the predicted disease labels.

7
Artificial Neural Network and ResNet-50 Approach:
Rakesh Sharma et al. [3] proposed a machine learning model in which Data was collected from
the Kaggle website. The images were preprocessed to resize them to a uniform size, normalize
the pixel values, and apply a Gaussian filter to reduce noise. Two different machine learning
models were selected and were trained: Artificial Neural Network (ANN) and ResNet-50.
In the Artificial Neural Network (ANN) approach, ReLU activation functions with predefined
weights were utilized in the hidden layers, while the final output layer employed linear
activation with a weight of 1. The "adam" optimizer was applied for model training. On the
other hand, the Resnet-50 methodology involved employing a ResNet50 model with 48
convolutional layers, which is well-suited for image-related tasks such as classification and
object detection. Additionally, it demonstrated its applicability to non-computer vision tasks,
providing computational efficiency, as previously reported. The performance of the trained
models was evaluated on a held-out test set.

Transfer Learning with C-GAN Model Approach :


Amreen Abbas et al. [6] proposed a system using transfer learning consisting of two modules:
C-GAN synthetic image generation and tomato plant disease detection. The C-GAN model is
trained on a dataset of real tomato plant leaf images and their corresponding disease labels
to generate synthetic tomato plant leaf images with different disease classes. The
DenseNet121 model is initialized with the weights of a pre-trained model on a large dataset
of natural images and then fine-tuned on a dataset of real tomato plant leaf images and their
corresponding disease labels to classify tomato plant leaf images into different disease classes.
To detect tomato plant diseases, synthetic tomato plant leaf images are generated from the
input tomato plant leaf image using the C-GAN model, and the augmented tomato plant leaf
image is classified using the fine-tuned DenseNet121 model. The predicted disease class is the
output of the system.
L_G = E_x[log D(x)] + E_z[log (1 - D(G(z)))]
L_D = E_x[log D(x)] + E_z[log (1 - D(G(z)))]

8
Research Method

MobileNet V2 Approach :
Siti Zulaikha Muhammad Zaki et al. [10] proposes a method to identify tomato leaf diseases
using a deep learning model called MobileNet V2. MobileNet V2, an improvement over
MobileNet V1, retains separable convolution as the core layer, reducing the number of trained
parameters compared to full convolutional networks. This makes MobileNet V2 suitable for
mobile applications with limited resources. Separable convolution consists of two steps:
depthwise convolution and pointwise convolution.
Depthwise convolution, a reduced version of convolution, processes each channel separately.
The input feature map is divided into groups based on the number of channels, reducing the
kernel size and the number of parameters significantly.
Pointwise convolution, on the other hand, has a kernel size of 1x1 and depends on the number
of input channels for its depth. It follows depthwise convolution and helps represent the full
convolution with fewer parameters, adjusting the dimensions of the output channel features.

Fig. 2(a) Architecture of MobileNet

Fig. 2(b) depicted all components of the system where the Tomato leaves dataset was utilized
to train and test the proposed MobileNet V2-based tomato disease screening algorithm. A
total of 32531 images were extracted from the complete dataset, comprising 3051 images of
healthy tomato leaves, 2455 early blight images, 2826 bactorial spot images, 2882 septoria
leaf spot images, 2754 leaf mold images, 3113 late blight images, and 2153 mosaic virus
images, etc. Each leaf was captured individually without interference from other leaves, as
detailed in Table 1. In these experiments, the images were randomly split into two subsets:
25848 training images and 6683 testing images. To meet the input requirement of the
MobileNet V2 model, all images were rescaled to 224 × 224 pixels.

9
Table 1. Some samples of tomato leaf diseases Fig. 2(b) Main components

After that, MobileNet V2 was trained from scratch through random initialization or using
transfer learning techniques. Subsequently, a training progress chart was plotted to
demonstrate the performance of MobileNet V2 in classifying the tomato diseases. The
performance metric of accuracy was then used to measure classification performance, which
was divided into eleven classes.

Datasets

➢ Tomato Leaf Disease Classification


The "Tomato Leaf Disease Classification" dataset, available on Kaggle, consists of over 32,500
images of tomato leaves. These images are categorized into 10 diseases and 1 healthy class,
making a total of 11 classes for classification. The dataset is collected from a variety of sources,
including both lab scenes and in-the-wild scenes. The main objective of this dataset is to
develop a lightweight model that can predict tomato leaf diseases and be deployed offline on
a mobile app.

10
Here's a breakdown of the classes in this dataset:
1. Late Blight
2. Healthy
3. Early Blight
4. Septoria Leaf Spot
5. Tomato Yellow Leaf Curl Virus
6. Bacterial Spot
7. Target Spot
8. Tomato Mosaic Virus
9. Leaf Mold
10. Spider Mites Two-Spotted Spider Mite
11. Powdery Mildew
The majority of the images in this dataset originate from the PlantVillage dataset, with offline
augmentation techniques applied to enhance the dataset. These augmentation techniques
include image flipping, gamma correction, noise injection, PCA color augmentation, rotation,
and scaling. Additionally, some recent images were generated offline using Generative
Adversarial Networks (GANs).

11
➢ Dataset of Tomato Leaves by Mendeley Data
The Tomato Leaf Disease Classification dataset consists of two separate datasets for tomato
leaf images from different sources. The first dataset is derived from the PlantVillage database
and contains ten categories, including nine disease categories and one for healthy leaves. Each
image in this dataset depicts a single tomato leaf with a single background, totaling 14,531
images. The original images were adjusted in size from 256 * 256 to 227 * 227 and then
divided into five subsets for 5-fold cross-validation. The detailed categories of the first dataset
are:
1. Bacterial Spot
2. Early Blight
3. Healthy
4. Late Blight
5. Leaf Mold
6. Septoria Leaf Spot
7. Target Spot
8. Tomato Mosaic Virus
9. Tomato Yellow Leaf Curl Virus
10. Two-Spotted Spider Mite

The second dataset consists of images of Taiwan tomato leaves and includes six categories,
featuring five disease categories and one for healthy leaves. These images vary in composition,
including single leaves, multiple leaves, single backgrounds, and complex backgrounds. The
dataset initially comprises 622 original images, with differing image sizes that were
standardized to 227 * 227. Data augmentation techniques were applied to increase the
number of images, involving clockwise rotations of 90, 180, and 270 degrees, horizontal and
vertical mirroring, as well as adjustments to image brightness. After augmentation, the
dataset contains a total of 4,976 images. The detailed categories of the second dataset are:
1. Bacterial Spot
2. Black Leaf Mold
3. Gray Leaf Spot
4. Healthy
5. Late Blight
6. Powdery Mildew

12
Results Comparison

The models achieve accuracies ranging from 76% to 99.89%. The highest accuracy is achieved
by the transfer learning model with C-GAN synthetic images. Several models surpass the
performance of pre-trained models like VGG16 and InceptionV3. Dataset sizes range from
1,000 to 20,000 images.
Here's a table comparing the results of the eight referenced papers for tomato leaf disease
detection in a more detailed format:

Model Dataset
Reference Data Preprocessing Average Accuracy
Architecture Size

16,012
1 Custom CNN Data augmentation 91.2%
images

16,012 Preprocessing, 80:20 train-


2 4-layered CNN 98.19%
images test split

Various ML 10,000
3 Not specified 94.1%
models images

Image scaling, color


Fuzzy-SVM, 735 thresholding, gradient local
4 96.735%
CNN, R-CNN images ternary pattern, Zernike
moments' features

13
Model Dataset
Reference Data Preprocessing Average Accuracy
Architecture Size

98.66%
U-Net, Not Data preprocessing, feature (segmentation),
5
EfficientNetV2 specified extraction 99.89%
(classification)

C-GAN, Not
6 Synthetic image generation 99.51%
DenseNet121 specified

98.66% (detection),
YoloV5, Not
7 Not specified 99.89%
EfficientNetV2 specified
(classification)

10,000 Resizing, normalizing, and


8 Faster R-CNN 97.8%
images cropping

Fig. 3 Result Comparison Graph of Models

14
Result Analysis

In this paper, experimental results were tested using an AMD Ryzen 5 5600H @ 3.3GHz CPU
with 8 GB memory. No graphics processing unit was utilized, and normal CPU-based
TensorFlow was implemented using the Python platform. Several hyper-parameter
configurations of the MobileNet V2 were tested, including batch size, optimizer selection, and
learning rate.
In MobileNet V2 model, The Adam optimizer was utilized with a learning rate of 0.01 for
optimizing the model's weights during the training process. Adam is a popular optimizer in
deep learning due to its adaptive learning rate and momentum properties, which often result
in faster convergence and improved performance compared to other optimization algorithms.
The results shows that an accuracy of 0.9313 is achieved with learning rate of 0.01 is
implemented.
Batch size is a hyperparameter that controls the number of images is fed to the network for
one training iteration. Here Batch size of 32 is used for one training iteration. Training data is
the dataset used to train the MobileNet V2 with batch size of 808, while testing data is the
sample that is used to evaluate the performance of the trained network with batch size of 12
is used.
In MobileNet V2, the training accuracy and the validation accuracy in Fig. 4(a) are 93.13% and
87.95% respectively. Whereas Fig. 4(b), which represents the training and validation losses,
shows a training loss of 2.03% and a validation loss of 2.18%.

Fig. 4(a) Training & Validation Accuracy

15
Fig. 4(b) Training & Validation Loss

Fig. 4(c) represents the classification report which provides a detailed summary of the model's
performance on the test data, including metrics for each individual class as well as overall
metrics.

Fig. 4(c) Classification Report

Fig. 4(d) displays the confusion matrix, which is a table that summarizes the performance of a
classification algorithm. It is a 2-dimensional array where rows represent the actual classes
and columns represent the predicted classes. Each cell in the matrix represents the number
of instances where the actual class (row) was predicted as the predicted class (column). Fig.
4(e) shows a heatmap visualization of the confusion matrix. The color intensity of each cell

16
indicates the magnitude of the counts: darker colors represent higher counts, while lighter
colors represent lower counts.

Fig. 4(d) Confusion Matrix

Fig. 4(e) Heat Map Representation of Confusion Matrix

The below output Fig. 4(f) shows the final result of predicted leaves vs. actual leaves by
taking some of sample from test dataset and showing results with their actual labels and
predicted labels.

17
Fig. 4(f) Output Result

Conclusion

In this research, we developed a tomato disease detection model using a convolutional neural
network (CNN) architecture, specifically MobileNet, trained on a dataset of tomato plant
images with various diseases. The model's performance was evaluated using a variety of
metrics, including accuracy, precision, recall, and F1-score.
Our findings suggest that the MobileNet-based model demonstrates promising results in
detecting tomato plant diseases. With an overall accuracy of approximately 93% on the test
dataset, the model shows effectiveness in classifying different disease categories. Additionally,
the precision, recall, and F1-score metrics provide insights into the model's performance for
each class, revealing areas of strength and areas for potential improvement.
The nine reference papers that we have studied cover a wide range of deep learning models
for tomato disease detection. The models include Convolutional Neural Networks (CNNs),
Faster RCNN, EfficientNetV2, InceptionV3 and YoloV5. All of the models achieved high
accuracy in detecting tomato diseases. The accuracy of the models ranged from 92% to 98%.
The models were able to detect a variety of tomato diseases, including early blight, late blight,
leaf spot, and mosaic virus.
Comparing our model with alternative architectures, such as InceptionV3, RCNN, YoloV5 we
find that MobileNet offers advantages in terms of computational efficiency and suitability for
deployment on resource-constrained devices.

18
References

1. Agarwal, Mohit, Abhishek Singh, Siddhartha Arjaria, Amit Sinha, and Suneet Gupta.
"ToLeD: Tomato leaf disease detection using convolution neural network." Procedia
Computer Science 167 (2020): 293-301.
2. Baser, Preeti, Jatinderkumar R. Saini, and Ketan Kotecha. "TomConv: An Improved CNN
Model for Diagnosis of Diseases in Tomato Plant Leaves." Procedia Computer
Science 218 (2023): 1825-1833.
3. Sharma, Rakesh, Ankita Panigrahi, Mamata Garanayak, Sujata Chakravarty, Bijay K.
Paikaray, and Lalmohan Pattanaik. "Tomato Leaf Disease Detection Using Machine
Learning."
4. Nagamani, H. S., and H. Sarojadevi. "Tomato leaf disease detection using deep learning
techniques." International Journal of Advanced Computer Science and Applications 13,
no. 1 (2022).
5. Badiger, Manjunatha, and Jose Alex Mathew. "Tomato plant leaf disease segmentation
and multiclass disease detection using hybrid optimization enabled deep
learning." Journal of Biotechnology 374 (2023): 101-113.
6. Abbas, Amreen, Sweta Jain, Mahesh Gour, and Swetha Vankudothu. "Tomato plant
disease detection using transfer learning with C-GAN synthetic images." Computers and
Electronics in Agriculture 187 (2021): 106279.
7. Wu, Xu-hang, Xia Li, Shuo Kong, Yu Zhao, and Lin Peng. "Application of EfficientNetV2
and YoloV5 for tomato leaf disease identification." In 2022 Asia Conference on
Algorithms, Computing and Machine Learning (CACML), pp. 150-158. IEEE, 2022.
8. Wang, Qimei, and Feng Qi. "Tomato diseases recognition based on faster RCNN." In 2019
10th International Conference on Information Technology in Medicine and Education
(ITME), pp. 772-776. IEEE, 2019.
9. Shi, Zhanhao, Cui Wang, and Lin Zhao. "Tomato Disease Identification Application Based
on EfficientNetV2." In Proceedings of the 6th International Conference on Computer
Science and Application Engineering, pp. 1-6. 2022.
10. Zaki, Siti Zulaikha Muhammad, Mohd Asyraf Zulkifley, Marzuraikah Mohd Stofa, Nor
Azwan Mohammed Kamari, and Nur Ayuni Mohamed. "Classification of tomato leaf
diseases using MobileNet v2." IAES International Journal of Artificial Intelligence 9, no. 2
(2020): 290.

19

You might also like