(IJCST-V12I1P5) :debashis Dey, Samiran Das, Pallavi Thakuri, Dr. Bornali Gogoi, Prof. Nelson Varte

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

International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

RESEARCH ARTICLE OPEN ACCESS

Detection Of A Few Plants Leaf Disease Using Custom CNN


Debashis Dey [1], Samiran Das [2], Pallavi Thakuri [3], Dr. Bornali Gogoi [4],
Prof. Nelson Varte [5]
[1],[2],[3]
Student, Department of Computer Application, Assam Engineering College, Guwahati, Assam, India
[4],[5]
Associate Professor, Department of Computer Application, Assam Engineering College, Guwahati, Assam, India
ABSTRACT
Todays agriculture faces numerous challenges, including increasing global food demand, climate change, limited resources, and the
need for sustainable farming practices. The major reason for minimizing crop productivity is various diseases in plants. Plant leaf
diseases detection is the important because profit and loss are depending on production. In this context, the model proposed is a
deep learning-based approach for image recognition. A customized Convolutional Neural Network (CNN) is used in this project for
image classification that detects three (3) different classes of Plant Leaf Diseases with accuracy ranging from 92% - 96.66% and
suggests the Cure for the disease. This custom CNN model is using 7 layers, 48 kernels and 11 neurons. The proposed paper
includes implementation steps like dataset collection, data preprocessing, model architecture building, User interface building, etc.
using CNN to classify the leaves which are diseased based on the models prediction.
Keywords: Deep Learning, TensorFlow, Keras, Plant disease detection, LeNet.

I. INTRODUCTION process while minimizing the computational resources


This work develops a smart system for detecting plant leaf required for effective disease detection.
disease by using a carefully designed CNN architecture. With 2.4 Empowering Farmers:
the goal of providing farmers with an effective tool for crop
The overarching goal is to empower farmers with a tool that
health management, it addresses the pressing need for early enhances their capacity to manage crop health effectively. By
and accurate disease identification in agriculture, reducing providing timely and accurate information, the system
losses and improving food security. supports farmers in making informed decisions regarding
disease control measures.
II. LITERATURE REVIEW
2.5 Local Plant Leaf Data Integration:
2.1 Customized CNN Architecture:
To further underscore the efficiency of the model in real-
A customized CNN architecture designed to meet the
world scenarios, it incorporates a small local plant leaf
difficulties of plant leaf disease detection is the foundation of
dataset collected from the specific region. This inclusion
the project. With this tailored architecture, optimal sensitivity
demonstrates the system's adaptability and effectiveness in
and specificity are ensured while recognizing various leaf
working with smaller datasets, reflecting the diverse nature
disease types.
of agricultural practices.
2.2 Early Detection and Classification:
2.6 Impact on Agricultural Productivity:
One of the primary objectives is to enable early detection of
Through its multifaceted approach, the project envisions a
diseases, providing a crucial window for intervention and
positive impact on overall agricultural productivity. The
mitigation. The system goes beyond mere identification,
reduction of crop losses, coupled with sustainable farming
employing advanced classification algorithms to precisely
practices, contributes to the long-term resilience of farming
categorize detected diseases.
communities.
2.3 Resource Optimization:
This initiative, rooted in technological innovation and
Recognizing the resource constraints often faced in agricultural science, holds the promise of transforming the
agricultural settings, the CNN architecture is strategically way farmers engage with crop health management, ensuring
streamlined. This design choice aims to expedite the training a more secure and sustainable future for global agriculture.

ISSN: 2347-8578 www.ijcstjournal.org Page 30


International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

III. RESEARCH METHODOLOGY IV. PROPOSED SYSTEM


The suggested study uses a trained model that was
The proposed approach is related to predictions of Plant learned using a deep learning technique to forecast plant
Diseases for early Prevention. The relevant research and the leaf disease. It can also be changed to provide
methodology used to position the suggested system in the appropriate recommendations based on the type of
literature are displayed. disease that has been identified.
Title: Agro-Samadhan - a plant leaf disease detection tool.

This Plant Leaf Disease Detection system utilizes a


customized Lenet-5 CNN model with 2 Convolutional
layers, 2 Maxpooling layers, 2 fully connected layers, and a
Flatten layer to efficiently identify and classify plant
diseases. The model strategically employs a minimal number
of layers and neurons, accelerating training time and
optimizing computer resources. This approach aims to
facilitate disease monitoring, minimize crop losses, enable
sustainable farming practices, and enhance farmer
knowledge, thereby improving agricultural productivity and
ensuring preventive disease control.

The entire procedure of plant leaf disease has been divided


into the 6 steps:
A. Acquisition of Images
Fig 4.1: system workflow
B. Pre-processing
C. Extraction of features
4.1 Convolutional Neural Networks
D. Final Classification
E. User Interface Formation Convolutional Neural Networks (CNN) has become a
F. Model Deployment industry standard for resolving tasks related to images. The
key to solving tasks such as recognition of objects, face, pose
Much effort is put into manually selecting the and more, all of them have one or another architecture
appropriate image to capture RGB pixels of the leaf. The variant of CNN.
photos undergo pre-processing to improve contrast and
remove noise. 4.2 Customized CNN model (Lenet-5):

The data collection involves gathering plant leaf images Custom CNN Model architecture:
in jpg format, labeling each with its respective name, and
The Custom CNN Model is inspired by the LeNet- 5
categorizing them into disease classes. The dataset is
architecture of CNN. It consists of 7 layers with 48 kernels
primarily sourced manually from cultivation fields,
and 11 neurons.
comprises of 300 leaf images categorized into 3 classes
based on species and disease. Some of the image dataset is The key features and components of the Custom CNN
leveraged from online data source Plant Village to solve the model are:
problem of data scarcity. The goal is to efficiently train the
model to detect diseases in plant leaves, including rare ones. 4.2.1 Input Layer:
The images are resized to 640x640 pixels for computational This layer receives images of dimension 640x640 pixels with
efficiency during model training and predictions. This small- 3 colour channels (RGB) i.e. (640,640,3).
scale dataset provides valuable insights into disease detection
for a variety of plant leaves, optimizing resource utilization. 4.2.2 Convolutional Layers:

ISSN: 2347-8578 www.ijcstjournal.org Page 31


International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

Custom CNN starts with a convolutional layer that performs computes the function: f(x) = max (0, x).
the initial feature extraction from the input image. The
subsequent layers consist of residual blocks, each containing SoftMax: The SoftMax activation function is utilized in the
multiple convolutional layers. These convolutional layers last dense layer of a neural network for multi-class
learn and extract increasingly complex features from the classification tasks. Its primary purpose is to convert the raw
input data. output scores of the network into a probability distribution
over multiple class.
We use the Convolution2D class to create the convolution
layer in the neural net by passing a pair of arguments.
4.2.7 Compiling and building the model:
I. First Conv2D layer convolves the input image with Keras library supplies the ‘compile’ method via the
32 filter/kernel, each of size 3x3. ReLu (Rectified previously instantiated model.
Linear Unit) activation is used here.
II. Second Conv2D layer convolves the input image Backpropagation:
with 16 filter/kernel, each of size 3x3. ReLu Backpropagation is used to optimize model weights by
(Rectified Linear Unit) activation is used here. iteratively adjusting the loss function. This minimizes
4.2.3 Pooling Layers: prediction errors, enhancing the model’s accuracy.

In addition to convolutional layers, Custom CNN Adam [Learning Rate = 0.0001]


incorporates pooling layers, such as max pooling, to metrics= accuracy
downsample the feature maps. Pooling reduces the spatial loss function = categorical cross entropy
dimensions while retaining the most salient information.
Adam (short for Adaptive Moment Estimation) is an
• First MaxPool layer uses 32 filters with pool size 3x3. optimization algorithm commonly used for training neural
• Second MaxPool layer uses 16 filters with pool size 2x2. networks to efficiently update model weights during the
backpropagation process.
4.2.4 Flatten Layer:
Metrics ([‘accuracy’]): ‘accuracy’ is chosen as the metric.
In this layer, the 2D feature maps is taken from the preceding Accuracy is a measure of the model’s correctness. It’s a
convolutional and pooling layers and converts them into 1D commonly used metric for classification tasks because it
vectors. This is done by arranging all the values of the provides a straightforward interpretation of the model’s
feature maps into a linear array. performance.
4.2.5 Fully Connected Layers: Categorical cross entropy: “Categorical Crossentropy” is a
loss function used in multi-class classification tasks,
Towards the end of the architecture, Custom CNN includes
measuring the dissimilarity between predicted probability
fully connected layers or Dense layer that convert the
distributions (model output) and true class distributions.
extracted features into class probabilities or predictions.
These layers map the learned features to the desired output Learning rate: The parameter 0.0001 represents the initial
classes. learning rate for the optimizer. It controls the size of the steps
I. First Dense layer has 8 neurons and uses activation taken during optimization. A smaller learning rate can lead to
more precise weight updates but might increase training
function ReLu.
time.
II. Second Dense layer is also called output layer has 3
neurons and uses activation function SoftMax, this
layer predicts the class with highest probability.

4.2.6 Activation function:

ReLu: ReLU introduces non-linearity to the model. The


primary purpose of activation functions in neural networks is
to introduce non-linearities, allowing the model to learn
complex patterns and relationships in the data. which simply

ISSN: 2347-8578 www.ijcstjournal.org Page 32


International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

We commence the implementation part with importing the


below libraries:

• TensorFlow: Platform for implementing, training, and


deploying machine-learning models.
• Keras: Library for implementing neural net
architectures to be run on CPU as well as GPU.
• NumPy: Library for numerical calculation of N-
dimensional matrices.

After importing all the libraries, we'll now bring in the data
set. The Keras library has several dataset tools that can be
used with ease for this purpose.

4.4 Data Splitting:

We also need to break the data set into following parts:

• Training data set:


The image dataset includes 300 images in jpg format.
Considering the test size of 0.2, the resulting training
dataset consists of [300 × (1 - 0.2)] = 240 images.

• Validation data set:


The validation dataset is of test Size 0.2 of the remaining
data after training split. So, Validation Data = (240
×0.2)= 48 images.

• Test data set:


The test dataset is of test Size 0.2 of the total data which
consists of 300 images. So, testing Data = (300 × 0.2) =
60 images.

0-1 is the required pixel intensity of the images among the


data set, if the pixel intensity is not within that range, we
need to normalize them among the data set.

4.5 Building User-Friendly Interface:

To enhance user experience, a graphical user interface (GUI)


will be created. Users can effortlessly obtain accurate results
and access recommended remedies for specific diseases. This
component utilizes the Streamlit framework, an open-source
Python library known for rapid model deployment in web
interfaces. Developers can swiftly craft visually appealing
user interfaces. The GUI receives user-input images,
Fig 4.2: Network Architecture of the Model processes them through the model, predicts the specific plant
disease, and provides relevant disease information along with
potential solutions.
4.3 LeNet TensorFlow Implementation:

ISSN: 2347-8578 www.ijcstjournal.org Page 33


International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

5. PERFORMANCE MATRIX: • Validation Loss: The loss computed on a validation


dataset during model training is 0.9936374 suggesting
To assess the predictability and reliability of the model, the that the model generalizes well to unseen data.
following performance matrices have been used:

5.1 Accuracy:

The training process for the leaf disease detection model


achieved an impressive accuracy rate ranging from 92% to
96.66%. During training, the training data went through 25
epochs in approx. 4 batches of 50 batch size each.

Last monitored performances:

• Test accuracy: The model gained a test accuracy of


96.66% on the test dataset consisting of 60 images. The
model has also proved its performance on unseen data.
• Validation Accuracy: The model gained a test accuracy
of 97.91%. It gauges the model's effectiveness on a
validation set, helping to assess its performance during Fig 5.2: Model Training Loss graph
training and prevent overfitting.

Fig 5.3: Context diagram of the system workflow


Fig 5.1: Model Training Accuracy graph

5.2 Loss:

Loss in training a model measures the disparity between


predicted and actual values. It is calculated to guide the
optimization process, enabling the model to adjust its
parameters to minimize errors, improving performance on
unseen data.

• Training Loss: The loss calculated on the training


dataset during model training is 0. 01077591.The model
demonstrates effective training as evidenced by a low
training loss.

ISSN: 2347-8578 www.ijcstjournal.org Page 34


International Journal of Computer Science Trends and Technology (IJCST) – Volume 12 Issue 1, Jan - Feb 2024

REFERENCES
Fig 5.4: Front-End Demonstration (Output) of the plant disease
prediction [1] Juan K. Leonard, Ph.D. ‘Image Classification and Object
Detection Algorithm Based on Convolutional Neural Network’
[2] Ashwani Kumar*, Sonam Srivastava. ‘Object Detection
System Based on Convolution Neural Networks Using Single
Shot Multi-Box Detector’
[3] Arpit Pawar, D.Bharath Kumar, Kuldeep Tamakuwala, Mrs. R.
Logeshwari. ‘Realization of Plant Leaf Disease Recognition
Using Lenet’.
[4] Rahul Chauhan, Kamal Kumar Ghanshala, R.C Joshi.
‘Convolutional Neural Network (CNN) for Image Detection
and Recognition’.
[5] Sachin D. Khirade, Plant Disease Detection using Image
Processing, ICCCCA, 2015.
[6] Prof. Patil Ashish and Patil Tanuja, “Survey on Detection and
Classification of Plant Leaf Disease in Agriculture
Environment”, International Advanced Research Journal in
Science, Engineering and Technology, Vol.4, Sp. Issue 4, Jan
2017.
[7] Chit Su Hlaing, Sai Maung Maung Zaw, ‘Plant disease
recognition for Smart Farming Using Model-based Statistical
Features’, IEEE 6th Global Conference on Consumer
Electronics (GCCE), 2017.
[8] Vipinadas. M. J, ‘A Survey on Plant Disease Identification’,
International Journal of Computer Science Trends and
Technology (IJCST) – Volume 3 Issue 6, Nov-Dec 2015
[9] Arpita Patel and Mrs. Barkha Joshi, “A Survey on the Plant
Leaf Disease Detection Techniques”, International Journal of
Advanced Research in Computer and Communication
CONCLUSION
Engineering, Vol. 6, Issue 1, January 2017.
The study specifically concentrates on the detection of plant [10] Justine Boulent, Samuel Foucher, Jérôme Théau, Pierre-Luc
diseases, recognizing their detrimental impact on crop health
and productivity. With the objective of addressing this issue, St-Charles. ‘Convolutional Neural Networks for the Automatic
we have successfully developed robust machine learning Identification of Plant Diseases’. Article published on Front.
models for disease prediction, achieving an accuracy rate of
Plant Sci., 23 July 2019 Sec. Technical Advances in Plant
92%-96.66%.
Science.

ISSN: 2347-8578 www.ijcstjournal.org Page 35

You might also like