I Eee Crop Analyzer

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Crop Disease Analyzer Using Deep Learning

Chirag Patil#1 , Karan Kale*2


Vivekanand Education Society's Polytechnic, Chembur
Email: [email protected] , [email protected]

Abstract— This paper presents an threat to the world's food security.


AI-driven crop analysis system using Traditional disease evaluation techniques,
deep learning, integrated into a user- which rely on time-consuming physical
friendly web app built with Flask. inspections, frequently prove to be
The model, trained on diverse crop inefficient. In this research, we present a
images, utilizes convolutional neural novel computational framework for crop
networks (CNNs) for accurate health evaluation that makes use of cutting-
classification into categories like edge deep learning methods. Our technology
healthy crops and various disease features an intuitive web interface created to
stages. The user-friendly web make it simple to submit cropped
interface makes it accessible for photographs for automated analysis
farmers and agronomists to monitor Convolutional neural network (CNN)
crop health. The system's practical architecture that has been painstakingly
applications, such as precision trained and exposed to a broad dataset
agriculture and disease spanning a range of crop situations, from
management, hold promise for robustly healthy to various disease stages,
enhancing global food security by forms the basis of our methodology.
automating crop disease detection Underscoring the model's effectiveness is its
and minimizing losses amazing potential for precise classification,
Keywords— Agriculture, Crop notably in identifying various disease phases
disease analysis, Deep learning, and healthy crop conditions. The system's
Convolutional Neural Networks, correctness and dependability have been
Disease detection, Flask framework, confirmed through meticulous validation
Web application, Image classification. methods. Our study has far-reaching
implications for the field of precision
I. INTRODUCTION
agriculture and the effective management of
Crop diseases can seriously affect
crop diseases. It holds the promise of
agricultural productivity, posing a serious
making substantial contributions to global
1
food security initiatives. By automating the utilize these advanced technologies. While
detection and monitoring of crop diseases, these advancements are promising, it is
our work aims to minimize yield losses. important to continue exploring and refining
II. LITERATURE REVIEW deep learning models and their integration
In recent years, the application of deep into practical applications. Moreover,
learning, specifically convolutional neural understanding the scalability, reliability, and
networks (CNNs), has shown promising real-world impact of these systems remains
results in automating crop analysis. These a key area of research interest.
models can process vast amounts of image Dataset Overview: The 'New Plant Diseases'
data and accurately classify crop conditions, dataset, created by SAMIR BHATTARAI
including the identification of various and available on Kaggle, contains roughly
diseases. The identification of the crop 87,000 RGB photos that classify healthy and
species is the basic requirement before we diseased crop leaves into 38 unique
identify the class of disease. Abdul Kadir in classifications. These photos have been
his research work has used color features properly organized, making them an
like mean, standard deviation, skewness and invaluable resource for plant pathology and
kurtosis are made on the pixel values of the machine learning research.[1]
leaves. He has consolidated features coming Research and Discoveries: This dataset can
through grey level co-occurrence matrix be used by researchers to investigate plant
(GLCM) disease detection and categorization.
functions which identify the texture of an Machine learning and computer vision
image. It generates a GLCM that produce techniques can provide useful insights into
statistical measures by calculating how early disease identification, assisting in
frequently pairs of pixels with specific proactive agricultural management practices.
values and in a specified spatial relation Dataset Overview: The 'New Plant
occur in an image.[2] Diseases' dataset, created by SAMIR
The utilization of frameworks like Flask has BHATTARAI and available on Kaggle,
further facilitated the deployment of these contains roughly 87,000 RGB photos that
AI models in web-based applications. Flask, classify healthy and diseased crop leaves
known for its simplicity and flexibility, into 38 unique classifications. These photos
enables the development of user-friendly have been properly organized, making them
interfaces that empower farmers and an invaluable resource for plant pathology
agricultural experts to easily access and and machine learning research.[1]
2
Research and Discoveries: This dataset
can be used by researchers to investigate
plant disease detection and categorization.
Machine learning and computer vision
techniques can provide useful insights into
early disease identification, assisting in
proactive agricultural management practices.
Fig. 1 Example of Data Preprocessing
[2]
C. Data Augmentation:

III. PROPOSED METHODOLOGY Make use of the potential of data

A. Utilizing the "New Plant Diseases augmentation techniques [Fig. 2] to

Dataset" for Research: diversify the dataset, improving the deep

In the pursuit of advancing the field of learning model's ability to generalize.

crop disease detection, the "New Plant Rotation, flipping, cropping and color

Diseases Dataset" [1] accessible via Kaggle tweaks are augmentation techniques that can

emerges as a valuable resource. This dataset be systematically used to increase the

serves as a foundational component in


conducting research related to the utilization
of deep learning techniques for accurate and
timely plant disease classification.

B. Data Acquisition and Preprocessing:


Begin by acquiring the dataset from the dataset and lower the likelihood of

Kaggle repository, ensuring compliance overfitting.

with licensing terms and appropriate Fig. 2 Example of Data Augmentation[4]

citation. Subsequently, embark on a rigorous D. Data Splitting and Cross-Validation:

data preprocessing phase [Fig. 1], Data Divide the dataset strategically into

cleaning, encompassing the normalization of separate training and testing subgroups,

pixel values, resizing of images to a following the traditional 80/20 split ratio.

consistent resolution, and the organization of Consider including cross-validation

data into structured directories. approaches as well, especially when dealing


with restricted data resources, to thoroughly
evaluate model performance.

3
hyperparameters like epochs, batch size, etc
as necessary.
E. Model Development:
YOLO (You Only Look Once) is a real-
time algorithm that divides an image into
grid cells and predicts bounding boxes and
class probabilities directly. It involves
designing convolutional neural networks
(CNNs) to process input images, integrating
grid cell division, predicting bounding
boxes, and optimizing loss functions for
Fig. 4 Example of Training and
simultaneous object detection and
Optimization
classification. Considering the number and
G. Model Evaluation and Metrics:
design of convolutional layers [Fig. 3], filter
Evaluate the trained model's performance
sizes, pooling layers, and fully connected
rigorously using the designated testing
layers must all be carefully chosen to
dataset. Employ established evaluation
complement the peculiarities/patterns of the
metrics, including accuracy, precision,
dataset and the goals of the research.
recall, and F1-score [Fig 5], to quantitatively
assess the model's classification prowess.
The construction of confusion matrices [Fig
6] affords valuable insights into
classification outcomes.
TP+TN
Accuracy =
TP+ TN + FP+ FN
Fig. 3 Example of CNN Layers[5]
------------ (1)

F. Model Training and Optimization: TP


Precision = ------------ (2)
Execute the training phase with precision, TP+ FP
specifying the optimization algorithm like
TP
‘ADAM’ and loss function while defining Recall = ------------ (3)
TP+ FN
key training parameters [Fig.4]. Monitor the
convergence of the model and remain Precicion∗Recall
F1 = ------------ (4)
Precision+ Recall
vigilant against overfitting, adjusting

4
Fig. 5 Example of Evaluation Metrices ii. F1 Curve (Graph):

iii. Loss-Precision-Recall (Graph) of


Training and Validation:

I. Model Deployment:
In instances where deployment is vital,
utilization of a robust web framework such
as Flask to facilitate model deployment [Fig.
7]. Construct a user-friendly interface
enabling end-users to interact with the
model, submitting input images for real-time
disease classification.

Fig. 6 Example of Confusion Matrix Fig. 7 Example of Model Deployment

H. Results: J. Website UI and Features:


i. Confusion Matrix (Normalized): Currently our website is in prototype
phase, so we haven’t yet did work on UI part
much, but here are some features of our
5
website, firstly on main page we have a
simple banner and below it we have ‘choose
a file’ option where we can choose a file
from our local system [Fig. 8]. Secondly, we
have a predict button beside the that option,
which will run the prediction on the input
image given, at back-end. After predicting
the image, it will show the results whether it  This AI is so future proof that we only
is diseased or healthy [Fig. 9]. Also, there have to upload new and different crops
will be 2 more options View Doc and for keeping update to date.
Download Doc [Fig. 9]. After clicking the  This AI predicts the crops health while
‘Download Doc’ button it will open a the Crop is in production period so that
window, where to save it. [Fig. 10]. After our farmers will be able to regain the
clicking the ‘View Doc’ button it will open a health back to its normal condition.
 iii. Fast crop disease detection of real-
time images

L. Disadvantages/Limitations:

new window in browser, where it will open  Farmers would have to go to the fields

the corresponding Doc which contents the for capturing the photos.

information about the Disease [Fig. 11].  Farmers would require to have Laptops to

Fig. 8 Main Page (Before Predicting) get analysis of the Crops Health.

Fig. 9 After Predicting  The proposed system can only detect the

Fig. 10 After Clicking on Download Doc disease if it is present on the leaf and not

Fig. 11 After Clicking on View Doc other parts of the crop such as stem and

K. Advantages: fruits

M. Future Scope:-
In this era of Developing India, Farming
is a considered to play a huge role in India.
Many of the different crops and grains are
being exported out of India to different
Aboard countries. Producing a large quantity

6
of crops with same consistence and Quality crop management and enhancing food
is mostly required. With increasing security around the world going forward.
population of India, demand of food supply
is increasing day by day. Keeping this all V. ACKNOWLEDGEMENT:
things we decided to build this AI Model to We would like to express our
help our farmer friends to have a great and appreciation to our mentors for their
healthy yield of crops. priceless advice. We value the dataset
sharing by the Kaggle community.
N. Future Improvements:-
Important resources were provided by
 In future we will build a drone / RC Car
[VESP]. Finally, also Mr Prashant Kamble
to drive this AI model to click live
Sir. for guiding us as our Industrial Mentor I
images from the farm to have a great
would want to express my sincere gratitude
consistency.
to farmers and stakeholders for their support
 Create a App for communicating with
of our work. This study is evidence of
real time farming experts to have a ONE
academic cooperation and of our common
TO ONE CHAT and also MONITOR
commitment to finding solutions to
HEALTH.
agricultural problems
 In upcoming times, we will add different
Crops and Abroad crops so that this AI VI. REFERENCES:
will be used by abroad consumers. [1] Author, Samir Bhattarai (2018). New
Plant Diseases Dataset.
IV. CONCLUSION Link:https://www.kaggle.com/datasets/
This research uses deep learning methods vipoooool/new-plant-diseases-dataset
and the Kaggle "New Plant Diseases
Dataset" to develop an effective [2] Kadir, A., “A Model of Plant
custom CNN model for crop disease Identification System Using GLCM,
identification. The model exhibits Lacunarity and Shen Features,” Research
outstanding performance metrics, such as Journal of Pharmaceutical, Biological, and
accuracy, precision, recall, and F1-score, Chemical Sciences Vol.5(2) 2014.
thanks to data augmentation. The model's
[3] Kulkarni, Omkar. "Crop disease
simple Flask deployment underscores its
detection using deep learning." 2018 Fourth
potential for real-world use. This study
international conference on computing
offers a strong foundation for improving
7
communication control and automation
(ICCUBEA). IEEE, 2018.

[4] https://pranjal-ostwal.medium.com/data-
augmentation-for-computer-vision-
b88b818b6010

[5]
https://www.parking.net/parking-news/survi
sion/artificial-intelligence-lpr-evolution-or-
revolution

8
9

You might also like