TOMATO PLANT DISEASE
PREDICTION AND
CLASSIFICATION BY
LEAF IMAGE ANALYSIS
BY TEAM QUaNTITaTIvE
CONQUERORS
The Tomato Leaf Disease Prediction System is a cutting-edge application of machine
learning aimed at revolutionizing the way tomato farmers detect and combat plant diseases.
Tomatoes are one of the most widely cultivated and economically important crops
worldwide. However, they are susceptible to various diseases that can significantly reduce
yields and affect the quality of produce. Timely and accurate identification of these diseases
is crucial for implementing effective control measures and minimizing crop losses.
Traditional methods of disease detection often involve manual inspection by agricultural
experts, which can be time-consuming, labor-intensive, and subject to human error. Such
experts are not easily available in rural areas where most farms are located, and most Indian
farmers do not have the knowledge or budget to hire them. This project seeks to address
these challenges by leveraging the power of modern artificial intelligence and image
analysis techniques.
UNDERSTANDING
THE PROBLEM
The tomato crop holds immense importance in the world's agriculture
and culinary landscape. As a rich source of essential nutrients like
vitamin C, potassium, and antioxidants, tomatoes contribute
significantly to a balanced diet and promote overall health.
Economically, tomatoes are a major cash crop, supporting livelihoods of
countless farmers.
Additionally, their cultivation aids in crop rotation and soil health. Given
its nutritional, gastronomic, and economic significance, the tomato crop
remains a fundamental staple and an essential ingredient in global food
security.
IMPORTANCE OF TOMATO
CROP
1.Bacterial Spot: A bacterial disease causing dark, raised lesions on tomato leaves, leading to reduced
photosynthesis and yield loss.
2.Early Blight: A fungal disease causing concentric rings with dark borders on lower leaves, potentially
defoliating the plant if left untreated.
3.Healthy: Represents disease-free tomato leaves used as a reference for comparison with diseased
samples.
4.Late Blight: A highly destructive disease caused by a water mold, resulting in large irregular-shaped
lesions with a water-soaked appearance.
5.Leaf Mould: A fungal disease leading to pale yellow lesions on the upper surface of tomato leaves,
reducing photosynthesis.
TYPES OF
DISEASES IN
TOMATO PLANT
6.Tomato Mosaic Virus: A viral disease causing mosaic-like patterns on leaves, stunting growth and
reducing fruit quality.
7.Septoria Leaf Spot: Characterized by small, circular lesions with dark borders and light
centres, often leading to premature defoliation.
8.Two-Spotted Spider Mites: Not a disease but a common pest, these mites cause stippling and
webbing on leaves, affecting plant health.
9.Target Spot: Causing circular, dark lesions with concentric rings resembling a target,
affecting the lower leaves of the plant.
10.Yellow Leaf Curl Virus: A virus causing yellowing and upward curling of leaves, often
resulting in severe yield losses.
TYPES OF
DISEASES IN
TOMATO PLANT
Associated Chambers of Commerce and Industry of India reports that
annual crop losses due to pests and diseases amount to Rs.50,000 crore.
Worldwide crop loss due to plant disease is estimated annually to be $220
billion USD or 14.1% of the total production by the Food and Agriculture
Organization of the United Nations.
Managing these diseases is labor-intensive, and market quality may suffer
due to blemished fruits. Additionally, climate change exacerbates the issue.
To address these challenges effectively, an efficient disease prediction
system is essential. Such a system would enable early detection, timely
interventions, and the implementation of preventive measures, supporting
sustainable tomato crop production and enhancing farmers' livelihoods.
PREDICTIVE
DISEASE SYSTEM
NECESSITY
14.1
%
14.1
%
PROPORTION
OF CROPS
LOST TO
PLANT
DISEASES
WORLDWIDE
$220
BILLION
IMPACT
OF
THESE
DAMAGES ON
THE
ECONOMY
85.9%
Source: Food and Agriculture Organization (FAO)
https://www.fao.org/news/story/en/item/140292
0/
EXPLORATORY
DATA ANALYSIS
(EDA)
The dataset we are using is sourced from the PlantVillage database.
It consists of 14,531 images with ten categories,
including nine disease types and one healthy category.
The images were resized to 227 * 227 during model training.
This comprehensive dataset enables the model to accurately detect
and classify various tomato leaf diseases, promising significant
contributions to crop disease management and improved
agricultural productivity.
DATA COLLECTION
PROCESS
DATA SOURCE
https://data.mendeley.com/datasets/ngdgg79rzb/1
The dataset used in the project contains ten distinct categories representing
different conditions of tomato leaves.
Categories include various diseases like Bacterial Spot, Early Blight, Late Blight,
Leaf Mould, Septoria Leaf Spot, Target Spot, Tomato Mosaic Virus, and Yellow
Leaf Curl Virus.
The "Healthy" category represents disease-free tomato leaves.
Each category is crucial for training the model to accurately detect and
classify tomato leaf images.
The dataset's diversity and balance ensures the model's effectiveness.
The comprehensive coverage of diseases contributes to sustainable crop
production and food security.
DATASET CATEGORY OVERVIEW
CATEGORY DISTRIBUTION
VISUALIZATIONS
Yellow Leaf Curl Virus
29.5%
Bacterial Spot
11.7%
Late Blight
10.5%
Septoria Leaf Spot
9.7%
Two-Spotted Spider Mite
9.2%
Healthy
8.8%
Target Spot
7.7%
Early Blight
5.5%
Leaf Mold
5.2%
Tomato Mosaic Virus
2.1%
(the imbalance present
in some classes has
been
fixed during preprocessing)
BSEB
H
LBLMSLS
TS
TMV
YLCVTSSM
5,000
4,000
3,000
2,000
1,000
0
(the imbalance present
in some classes has
been
fixed during preprocessing)
BUILDINGA
SOLUTION
OBJECTIVE OF OUR
PROJECT
We aim to help farmers detect plant
diseases at an early stage.
Timely detection will allow for corrective
measures such as targeted treatments or
adjustments to farming practices, which
can prevent the further spread of diseases
and minimise crop losses.
This will help boost crop yields and
positively impact both the farmer’s income
and the nation’s food security.
We are using a Convolutional Neural Network (CNN) model
for this system.
CNNsaredeeplearning modelsspecificallydesigned
for processingandanalyzingvisualdata,such
asimagesand tasks
,
image
videos.CNNsarewidelyusedincomputer
vision includingimageclassification,object
detection, segmentation, and more.
Due to their effectiveness in handling visual data, CNNs
have become the backbone of many computer vision
applications and have achieved state-of-the-art results in
various similar tasks.
MODEL
USED
Python
Flask
Jupyter
Lab
Google
Colab Replit
HTML, CSS, JavaScript
(Vue.js) GitHub
TOOLS & FRAMEWORKS
USED
PYTHON LIBRARIES
USED
●Numpy and Pandas - loading and preprocessing
data
●Matplotlib and Seaborn - visualisation
●PIL (Pillow) - image processing
● Tensorflow and Keras - loading and
training CNN image classification model
ENDPRODUCT
Web App (Vue.js):
https://mlpranav.github.io/tomatoleaf/frontend/
API (Flask):
https://tomato.sarthakgoelart.repl.co/
LIVE DEMO
ARCHITECTURE
AT A GLANCE
Web App
(Vue.js)
Server
(Flask
)
Model
(Tensorflow
)
Image
Processed
Result
Resul
t
Processed
Image
Allows farmers and gardeners to quickly upload pictures of tomato plant leaves and get
a diagnosis of any possible diseases.
Connected to a Python Flask backend server that uses our trained model to detect the
presence of diseases in the supplied images and classify them.
Supports regional languages like Hindi, Tamil and Bengali to enable maximum reach.
Displays valuable information like visual cues, prevention, cure, future steps etc so that
the detected diseases can be resolved.
Uses Vue.js for seamless integration and a responsive
layout. Available on all platforms and devices.
FEATURE
S
SCREENSHOT
S HOME
PAGE
image
cropper
image
uploade
r
SCREENSHOT
S HOME
PAGE
SCREENSHOT
S RESULT
PAGE
donut chart
of probability
info
about
disease
collage for
visual
confirmatio
n
regional
language
support
SCREENSHOT
S RESULT
PAGE
SCREENSHOT
S RESULT
PAGE
SCREENSHOT
S RESULT
PAGE
THEFUTURE
IMPACT
1.Early Disease Detection: This system can detect the onset of tomato leaf diseases at an
early stage. Early detection allows farmers to take proactive measures to contain the
spread of the disease and minimize its impact on the crop.
2.Increased Crop Yield: With timely disease detection and appropriate interventions, the tool
can help prevent or reduce the severity of diseases. This, in turn, can lead to higher crop
yields and better-quality tomatoes.
3.Cost Savings: By minimizing the use of chemical treatments and optimizing the application
of fungicides or pesticides, the prediction tool can result in cost savings for farmers. They
can target specific areas affected by the disease instead of treating the entire crop.
4.Farmer Education: The tool can also serve as an educational resource for farmers, helping
them understand various diseases, their causes, and how to identify and manage them
effectively.
5.Increased Tomato Quality: By preventing or reducing disease incidence, the prediction tool
can lead to improved tomato quality, making them more marketable and desirable to
consumers.
Support for Various Crops: Our underlying technology and methodology can be extended to
other crops as well. By collecting and annotating datasets for different crops, the model can
be adapted to predict diseases in a wide range of agricultural plants, expanding its
applicability.
Accessibility Features: Adding features like narration and voice commands will
significantly expand the reach of our system to farmers who cannot read or write.
Offline Mobile Application: A user-friendly mobile app would allow farmers to quickly and
conveniently assess their crop health using their smartphones or tablets. We will also
integrate a lightweight model for on-device prediction in the absence of cellular reception.
Real-Time Disease Monitoring: Integrating IoT devices and sensor networks in the field can
enable real-time disease monitoring. IoT-enabled devices can continuously collect data on
environmental conditions and crop health, providing farmers with immediate alerts if
disease outbreaks occur.
Geo-Tagged Data Collection: Collecting geo-tagged data along with crop images can
enable spatial analysis. This can help identify disease hotspots in specific regions and
facilitate targeted disease management strategies for different geographic locations.
SCALABILITY AND
POTENTIAL ENHANCEMENTS
OUR VISION FOR THE FUTURE
OF CROP DISEASE
MANAGEMENT
1. Early Detection and
Prevention
:AI-powered models for diverse crops, enabling early disease detection and prompt action.
2. Customized
Solutions
:Tailored recommendations based on real-time data and regional conditions.
3. Accessibility for
All
:Widely available offline applications, reaching farmers in remote areas.
4. Continuous
Learning
:Regular updates from crowdsourced data and research, improving model
accuracy.
5. Sustainable
Practices
:Promoting eco-friendly approaches, reducing reliance on
chemicals.
6. Global
Collaboration
:Joint efforts of agricultural communities and technology
companies.
7. Empowering
Farmers
:Equipping farmers with knowledge for informed decision-making and improved
livelihoods.
THANK
YOU!
DIABETES
PREDICTION
MODEL
Data Analytics-IBM Internship
DIABETES DETECTION AND DATA ANALYSIS
Brogrammers
TEAM MEMBER
37
38
The consequences of poorly managed diabetes can
be severe and may include various complications,
such as heart disease, kidney damage, nerve
damage (neuropathy), vision problems
(retinopathy), and a compromised immune system.
Diabetes is a chronic health condition
characterized by elevated levels of glucose (sugar)
in the blood. The body's inability to properly
regulate blood sugar levels is either due to
insufficient production or ineffective utilization of
insulin, a hormone produced by the pancreas.
Insulin plays a crucial role in facilitating the uptake
of glucose into cells, where it is used as energy or
stored for later use. Without sufficient insulin or its
effective action, glucose accumulates in the
bloodstream, leading to hyperglycemia.
There are three main types of diabetes:
Type 1 Diabetes
Type 2 Diabetes
Gestational Diabetes
INTRODUCTION
Why Dangerous?
Almost 422 million people in the world have diabetes
PROJECT SUMMARY
Diabetes becomes common in the world. 540m people worldwide
have diabetes. Diabetes is curable if it can be detected earlier with
proper diagnostic. Diabetes is responsible for 6.7 million deaths in
2021 - 1 every 5 seconds. Diabetes caused at least USD 966
billion dollars in health expenditure.
We are using our Machine Learning technique to identify Diabetes
by checking some parameters.
In this project, we have worked on diabetics detection using some
Python libraries for visualization like NumPy, pandas, matplotlib,
Seaborn and sklearn.
39
40
The project aims to illustrate DIABETES
cases from different countries, using
the data set which contains a
country-wise total patients.
PURPOSE OF THE PROJECT
Our goal is to provide complete
analysis and detection from the
predefine dataset.
SOURCE OF DATA USED
41
Data Source - Data is taken from Kaggle. There are several attributes in the data set on the basis of
which we are predicting, analyzing, visualizing, and detection of diabetes.
Link -
https://www.kaggle.com/
datasets/uciml/pima-indi
ans-diabetes-database
42
DATA BEFORE CLEANING
43
DATA AFTER CLEANING
DATA VISUALIZATION 44
We are showing the data visualizations as follows:
Fig – 1 : Count
Plot
9 Fig – 2 :
Histogram
Fig – 3 :Pair Plot
Histogram of the features included in the Dataset Pair-Plot of the features included in the Dataset
46
Fig – 4 : Scatter
Plot
47
Fig – 5 :
Heatmap Correlation
of each feature in the dataset
OUTPUTS OF DIFFERENT MACHINE
LEARNING ALGORITHMS –
LOGISTIC REGRESSION
48
Confusion matrix of Logistic
Regression
Roc-AUC score chart comparison of Logistic
Regression
49
Confusion matrix of
KNN
Roc-AUC score chart comparison of
KNN
KNN ALGORITHM
50
Confusion matrix of Naive
Bayes
Roc-AUC score chart comparison of Naïve
Bayes
NAIVE BAYES
51
SUPPORT VECTOR MACHINE
Confusion matrix of
SVM
Roc-AUC score chart comparison of
SVM
52
DECISION TREE
Roc-AUC score chart comparison of Decision
Tree
Confusion matrix of Decision
Tree
53
Confusion matrix of Random
forest
Roc-AUC score chart comparison of Random
Forest
RANDOM FOREST
CONCLUSION
After conducting data analysis using Python, it
was found that the predictive model for
diabetes yielded promising results. By
analyzing relevant features and employing
machine learning algorithms, the model
demonstrated a significant ability to accurately
predict the likelihood of diabetes in individuals.
This data-driven approach provides valuable
insights that can aid in early diagnosis and
targeted intervention, potentially improving
healthcare outcomes for those at risk. Further
refinement and validation of the model with
larger datasets and rigorous testing can
enhance its reliability and applicability in
real-world clinical settings.
54