You are on page 1of 33

Plant Disease Detection

System using Raspberry Pi


Project Mentor and Supervisor - DR. SANKAR PEDDAPATI

Batch
Olety Anjani Vinay -
511961
S Rishikesh Yadav - 511972
Shaik Mohammad Masood - 511980
TABLE OF CONTENTS

● INTRODUCTION
● OBJECTIVES
● METHODOLOGY
○ Overview of Tomato Plant Diseases
○ Different methods of plant disease detection
○ Comparison of different detection method systems
● HARDWARE AND SOFTWARE USED
● SYSTEM ARCHITECTURE AND FLOWCHART
● CONVOLUTION NEURAL NETWORK
○ Transfer Learning
○ MobileNet Algorithm
● TRAINING AND TEST DATA USED
● DATA PREPROCESSING TECHNIQUES
● LIMITATIONS AND CHALLENGES FACED
● RESULTS OBTAINED
● POSSIBLE FUTURE IMPROVEMENTS AND DEVELOPMENTS
ABSTRACT

Plant diseases are one of the major problems faced by farmers, leading to significant losses in crop
yields and quality. Early detection and diagnosis of plant diseases are crucial for farmers to take
timely action and prevent the spread of diseases. However, manual detection and diagnosis of plant
diseases can be a time-consuming and error-prone process.
To address this problem, this project proposes the development of a plant disease detection system
using Raspberry Pi. The system uses a camera connected to the Raspberry Pi to capture images of
plant leaves. These images are then processed using image processing techniques to extract features
such as color, texture, and shape. Machine learning algorithms such as Support Vector Machine
(SVM) and Convolutional Neural Networks (CNNs) are then used to classify the images into
different disease categories.
The system architecture and flowchart are designed to ensure that the captured images are processed
efficiently and accurately. The system is evaluated using various performance metrics such as
accuracy, precision, recall, and F1-score. The results show that the system achieves a high level of
accuracy in detecting various plant diseases such as rust, powdery mildew, and leaf spot.
The developed system has the potential to be a useful tool for farmers to monitor the health of their
crops, reduce losses due to plant diseases, and improve crop yields. Moreover, the system can also be
easily integrated with other smart farming technologies such as irrigation systems and weather
monitoring sensors to create a more comprehensive smart farming solution.
In summary, this project demonstrates the feasibility and effectiveness of using Raspberry Pi-based
systems for plant disease detection, providing a practical and cost-effective solution to help farmers
tackle the challenge of plant diseases.
INTRODUCTION
Machine learning algorithms have been used to develop automated plant disease detection systems,
which can analyze plant images and identify disease symptoms.
The Raspberry Pi-based plant disease detection system can provide a cost-effective and efficient way
to detect and diagnose plant diseases, particularly in remote and low-resource areas where the
infrastructure for plant disease diagnosis is limited.
The proposed project will leverage the capabilities of Raspberry Pi and machine learning algorithms
to develop an automated plant disease detection system that can provide a practical solution for
farmers to monitor the health of their crops, reduce losses due to plant diseases, and improve crop
yields. The system will use image processing techniques to extract features from plant images, which
will be fed into machine learning algorithms to classify the images into different disease categories.
OBJECTIVES

The specific objectives of the project are as follows:


1. Design and develop a plant disease detection system using Raspberry Pi.
2. Capture images of plant leaves using a camera connected to Raspberry Pi.
3. Pre-process the images using image processing techniques to enhance the features of plant
diseases.
4. Extract features from pre-processed images using various feature extraction techniques.
5. Train machine learning algorithms using the extracted features to classify the images into
different disease categories.
6. Deploy the trained model on Raspberry Pi to detect and diagnose plant diseases in real-
time.
7. Evaluate the performance of the proposed system in terms of accuracy, precision, recall,
and F1
8. Test the system on different plant species to assess its generalization capability.
OVERVIEW OF TOMATO PLANT DISEASES

Classification of different diseases of tomato plant


● Early Blight: This fungal disease is caused by Alternaria solani and can infect the leaves, stems,
and fruits of tomato plants. Symptoms include brown spots on the leaves that develop into
concentric rings.
● Late Blight: This fungal disease is caused by Phytophthora infestans and can infect the leaves,
stems, and fruits of tomato plants. Symptoms include brown spots on the leaves that develop into
a grayish mold.
● Septoria Leaf Spot: This fungal disease is caused by Septoria lycopersici and can infect the
leaves of tomato plants. Symptoms include small, circular brown spots with a grayish center that
appear on the leaves.
● Bacterial Spot: This bacterial disease is caused by Xanthomonas campestris pv. vesicatoria and
can infect the leaves, stems, and fruits of tomato plants. Symptoms include small, water-soaked
lesions that turn brown .
● Two_spottted_spidermitte: These spider mites are tiny pests that can cause significant damage
to the plant by piercing and sucking on the plant's leaves, which can lead to yellowing,
bronzing, and ultimately death of the leaves.
● Tomato Yellow Leaf Curl Virus (TYLCV): This viral disease is transmitted by whiteflies and
can infect tomato plants. Symptoms include yellowing and curling of leaves.
● Target spot : Target spot is a fungal disease that affects various crops, including tomatoes. The
disease is caused by the fungus Corynespora cassiicola, which infects the leaves, stems, and
fruit of the plant.
● Mosaic_virus : The virus is characterized by a distinct mosaic pattern of light and dark green
areas on the leaves, as well as stunted growth and reduced fruit production.
● Leaf_mold : It is caused by the fungus Fulvia fulva and is characterized by the appearance of
yellowish-green spots on the leaves.
DIFFERENT METHODS OF PLANT DISEASE DETECTION

● Visual inspection - It involves visually examining the plant for signs and symptoms of disease.
This method is low-cost and can be performed by anyone with basic training, but it is highly
subjective and may not be reliable for detecting early-stage infections.
● DNA-based methods - . Polymerase chain reaction (PCR) is the most commonly used DNA-
based method for plant disease detection. It is highly sensitive and specific, but it requires
expensive equipment and trained personnel.
● Serological methods - Enzyme-linked immunosorbent assay (ELISA) is the most commonly
used serological method for plant disease detection. It is highly sensitive and specific, but it
requires expensive equipment and trained personnel.
● Machine learning-based methods - This method can be highly accurate and can detect
diseases at an early stage, but it requires a large dataset for training the algorithm and
sophisticated data analysis.
● Spectroscopy - This method involves measuring the interaction of light with the plant tissue to
detect changes in the plant's biochemical composition. This method is non-invasive and can be
used to detect diseases at an early stage, but it requires expensive equipment and sophisticated
data analysis.
● Thermal Imaging - This method involves using an infrared camera to detect changes in the
temperature of the plant tissue caused by disease. This method is non-invasive and can be used
to detect diseases at an early stage, but it requires expensive equipment and sophisticated data
analysis.
COMPARISON OF DIFFERENT DETECTION METHODS AND SYSTEMS

DNA-based methods, serological methods, and machine learning-based methods are typically more
accurate than visual inspection and spectroscopy.
Visual inspection is the least expensive method, while DNA-based methods, serological methods, and
spectroscopy are more expensive. Machine learning-based methods can be low-cost if the dataset for
training the algorithm is available.
Visual inspection is the fastest method, while DNA-based methods, serological methods, and
spectroscopy are slower. Machine learning-based methods can be fast once the algorithm is trained.
DNA-based methods and serological methods are more sensitive and specific than visual inspection
and spectroscopy. Machine learning-based methods can achieve high sensitivity and specificity if
trained on large datasets.
HARDWARE AND SOFTWARE USED

The hardware components include a Raspberry Pi, a camera module, and a power source. The
Raspberry Pi acts as the main processing unit of the system, while the camera module captures
images of the plant leaves. A power source is required to power the Raspberry Pi and the other
hardware components.

The software components used in the system include Python, OpenCV, TensorFlow, and Tkinter.
Python is used to write the code for the system, while OpenCV processes the images captured by the
camera module. TensorFlow is used for image classification, and Tkinter is used for the system to
display the results of disease detection.
SYSTEM ARCHITECTURE AND FLOWCHART
The images captured by the camera module are
processed by the Raspberry Pi, which uses the
OpenCV library to pre-process the images then the
images are passed through the TensorFlow library,
which is used for image classification. The
TensorFlow library is trained using a pre-existing
dataset of tomato plant images with known diseases,
and it classifies the images as either healthy or
diseased. The classification results are then
displayed on a Tkinter, which runs on the Raspberry
Pi.
CONVOLUTION NEURAL NETWORK

Fig. 3.3.1 - Figure Depicting the Convolution Neural Network Layers


CNN layers are described below.

1.Convolution layer- It is the first layer for dimension extraction from any input image. Convolution
layer consists of filters which help extract particular characteristics, which results in a feature map of
the input images.

2. Pooling Layer - The pooling layer functions in such a way that a 2D filter slides over every channel
of the feature map and conveys the features lying within the area enveloped by the filter.

3. Max Pooling Layer - It is that feature map region from where maximum numbers of elements are
selected and hidden by the filter. Thus the max-pooling layer output is a feature map which contains
the most prominent features of the preceding feature map.
4. Fully Connected Layer - The fully connected(FC) layer in the CNN represents the feature vector
for the input. It contains crucial information about the input. During the training of the network, this
feature vector is further used for classification, regression etc. It is also being used as an encoded
vector. During training, this is used to determine the loss and helps the network to get trained. The
convolution layers before the FC layers hold vital information about local features in the input image
such as edges, blobs, shapes, etc.

5. Filters and Feature Maps - Filters are not predefined in CNN, rather self-learned by the model
itself. In a convolution layer filters learn to detect abstract concepts, like the boundary of a face or the
eyes of a person. Several convolution layers together can extract in-depth information from an image.
It is like a membrane that only allows desired characteristics to pass from it. Feature maps are the
outputs of filters in the convolution layer.
TRANSFER LEARNING
MOBILENET ALGORITHM

MobileNet is a deep convolutional neural network architecture designed for mobile and embedded
devices. The goal of MobileNet was to create a model that could achieve high accuracy in computer
vision tasks, such as image classification and object detection, while also being efficient enough to
run on mobile and embedded devices with limited computational resources.
The key innovation of MobileNet is the use of depth wise separable convolutions, which are much
faster and more efficient than traditional convolutional layers. In a depthwise separable convolution,
the input image is first convolved with a set of filters that operate independently on each input
channel (depthwise convolution). Then, the outputs of the depthwise convolution are combined using
a set of 1x1 convolutional filters (pointwise convolution) to generate the final output.
By using depth wise separable convolutions, MobileNet is able to achieve a high level of accuracy
while requiring fewer computations and parameters than traditional convolutional neural networks.
TRAINING AND TEST DATA USED
The training dataset consists of a large number of images of plants with known diseases. The images
are pre-processed using image processing techniques to enhance their quality and remove any noise
or distortions. The pre-processed images are then used to train the machine learning algorithm, which
learns to recognize the patterns and features of healthy and diseased plants.
The test dataset is used to evaluate the accuracy and reliability of the system. The test dataset consists
of images of plants with known diseases, which are not used in the training dataset. The system uses
the test dataset to classify the images as either healthy or diseased, and the accuracy of the
classification is calculated.
DATA PREPROCESSING TECHNIQUES
GUI

The system is implemented in a user-friendly


way, with a simple graphical user interface
(GUI) that displays the results of the disease
detection. We provided three different options
for input selection,
● Take a photo
● Upload from a pendrive or other storage
device
● Live detection
Taking a photo :
In this mode a single photo is taken from the connected camera module or a usb webcam of the
provided specimen. The image later undergoes preprocessing like setting image size etc.
This mode is preferable if the photo of the specimen had to be used for later analysis or bookkeeping.
Uploading from a storage files :
In this mode the input for analysis is provided from a storage device like a usb pendrive or selected
from the files of the device itself.
When the user selects the option of “Upload from files”, a file selection box appears to select the
target image, navigate to the directory where the image is placed, whether in-device or connected
external storage like pendrive.
Live Detection :
In this mode instead of taking a single photo of the specimen the device runs a live video analysis.
The device shows the top three estimates in the classification of the specimen on the upper-left corner
of the video.
This mode is preferred for on the go predictions and gaining a general idea of the health without
having to save or take photos for further usage or analysis.
RESULTS OBTAINED

Considering one of the above options, using


“uploading from a storage files” we can upload
an image and can find whether the image is
healthy or diseased, considering the image of a
leaf with “Tomato_Late_Blight” disease, our
model predicted with a probability of 0.72.
Similarly the actions with other options of
detection also work well for the tomato leaf
with any disease.
LIMITATIONS AND CHALLENGES FACED

One of the primary challenges was collecting a diverse and representative dataset for training the
machine learning algorithm. Although a significant amount of effort was put into collecting images of
healthy and diseased plants, it was difficult to capture images of plants that were affected by multiple
diseases simultaneously.
Another limitation of the system was the computational resources required for image processing and
classification. As the size of the dataset grew, it became increasingly difficult to process images in a
timely manner, even with a high-performance computing system. This necessitated the need for
optimizing the algorithm to minimize the computational requirements.
The lighting conditions also posed a challenge during the image capture process. In some cases, the
lighting was not uniform, leading to variations in the color and intensity of the images. This made it
difficult to accurately classify the images, especially in cases where the disease symptoms were
subtle.

Finally, the accuracy of the system was limited by the availability of disease samples for training. In
some cases, it was difficult to obtain a sufficient number of samples for rare diseases, making it
challenging to train the algorithm to recognize them accurately.
POSSIBLE FUTURE IMPROVEMENTS AND DEVELOPMENTS

The proposed system has the potential for several improvements and developments in the future.
Some of the possible enhancements that could be made to the current system include increasing the
number of diseases that can be detected by the system, improving the accuracy of disease detection,
and increasing the overall speed of the system.
One potential way to increase the number of diseases that can be detected is to expand the dataset
used to train the machine learning models. By including more images of different types of plant
diseases and incorporating more features into the models, the system can be trained to detect a wider
range of plant diseases with greater accuracy.
Another potential improvement to the system could be to integrate it with other technologies such as
drones or sensors that can collect data on plant health and send it back to the system for analysis. This
would enable more frequent and accurate monitoring of plant health and enable early detection of
plant diseases before they become widespread.

Overall, the developed tomato plant disease detection system can be a useful tool for farmers and
plant disease experts to quickly identify the presence of diseases in tomato plants, allowing them to
take timely and appropriate actions to prevent the spread of diseases and minimize crop losses.
THANK YOU

You might also like