You are on page 1of 21

Image Classification of Rice Blast

Disease
(Proof of Concept)
A
Dissertation Work
Submitted as Mini Project in Partial fulfilment for the award of Msc in Data Analytics.

Submitted to

Cochin University of Science and Technology, Kochi

Conducted By
Indian Institute of Information Technology and
Management- Kerala

Submitted By

Anitta Augustine 31118007


Sandeep MA 31118024

1
DECLARATION

This is to declare that the project entitled “Image Classification of

Rice Blast Disease” being submitted by Anitta Augustine and Sandeep

M A, students of III Semester, MSc Computer Science in Data Analytics

have done their work as Mini Project for Partial fulfilment of the degree

from CUSAT, Kochi (Kerala) is a record of bonafide work out by us under

your supervision.

Dr. T. K. Manoj Kumar Anitta Augustine


Guide Sandeep MA
(Msc DA 2018-’20)

2
ACKNOWLEDGEMENT

We take this opportunity to express our cordial gratitude and deep sense
of indebtedness to our guide Dr. T. K. Manoj Kumar for the valuable guidance and
inspiration throughout the project duration. We feel thankful to him for his innovative
ideas, which led to successful completion of this project work. We feel proud and
fortunate to work under such an outstanding mentor in the field of Image
Classification. He has always welcoming our problems and helped us to clear our
doubts. We will always be grateful to him for providing us the moral support and
sufficient time. To Prof. Ajith Kumar R for sharing his ideas and giving us an
opportunity for doing this project.

We would also thank our Institution, faculty members and staff without
whom this project would have been a distant reality. We also extend our heartfelt
thanks to our family and well wishers.

Anitta Augustine
Sandeep MA

3
APPROVAL CERTIFICATE

This is to certify that the project entitled Image Classification of

Rice Blast Disease being submitted by Anitta Augustine and Sandeep

MA students of Third Semester, MSc Computer Science in Data Analytics

has done their work as Minor Project for partial fulfilment of the degree

from CUSAT, Kochi (Kerala).

Dr. T. K. Manoj Kumar


Guide

4
TABLE OF CONTENTS

Introduction ------------------------------------------------------------------ 6

Literature Review ----------------------------------------------------------- 7

Methodology ----------------------------------------------------------------- 9

Implementation ------------------------------------------------------------- 15

Future Enhancements ----------------------------------------------------- 20

References -------------------------------------------------------------------- 21

5
INTRODUCTION

The era of fourth industrial revolution is abruptly transforming all walks


of modern society. Agriculture, being the backbone of growth of any society, also
witnesses this transformation. We need more robust and more accurate techniques
and systems for developing agricultural practises unprecedently to cater the needs of
millions. In this regard, identification of plant diseases are mostly ardent job and
requires expertise. By application of data analytics and machine learning, we can
bridge the information gap between fellow farmers and expert opinions. In this
project we uses the application of Convolutional Neural Networks (CNN) know what
disease is infected on given leaf of paddy with an available bundle of already availabe
data.
As CNN constitute probably the most popular and widely used technique in
agricultural research today, in problems related to image analysis, the current work
focuses on this specific sub-set of Deep Learning models and techniques. And more
specifically here we use CNN for the image classification of paddy blast disease. At
the user level, with the input image being obtained from the user, the image
classification will undergo several steps in order to find the category of the image it
belongs to, and provides the corresponding response. i.e, whether the paddy leaf is
affected with blast disease or not.

6
LITERATURE REVIEW
Deep learning (DL) constitutes a modern technique for image processing, with
large potential. Having been successfully applied in various areas, it has recently also
entered the domain of agriculture. In the current project, we are analysing a set of
paddy leaf images that employ convolutional neural networks (CNN), which
constitute a specific class of DL, applied to various agricultural and food production
challenges. Here we analyse the images of paddy leaves and conclude whether they
are infected by blast diseases or not.

Smart farming is important for tackling various challenges of agricultural


production such as productivity, environmental impact, food security and
sustainability. As the global population is growing continuously, a large increase of
food production must be achieved. This must be accompanied with the protection of
natural ecosystems by means of using sustainable farming procedures. Food needs to
maintain a high nutritional value while its security must be ensured around the world.

A large sub-set of the volume of data collected through remote sensing and the
IoT involves images. Images can provide a complete picture of the agricultural fields,
and image analysis could address a variety of challenges. Hence, image analysis is an
important research area in the agricultural domain, and intelligent analysis techniques
are used for image identification/classification, anomaly detection, etc., in various
agricultural applications. Also, images can be collected manually.

The most common techniques used for image analysis include machine
learning (K-means, support vector machines (SVM) and artificial neural networks
(ANN). The current survey examines the problems that employ a particular class of
DL named convolutional neural networks (CNN), defined as deep, feed-forward
ANN. Convolutional neural networks extend classical ANN by adding more ‘depth’
into the network, as well as various convolutions that allow data representation in a
hierarchical way and they have been applied successfully in various visual imagery-
related problems. CNN have been employed recently in agriculture, with growing
popularity and success, and the fact that today more than 20 research efforts
employing CNN exist for addressing various agricultural problems. As CNN
constitute probably the most popular and widely used technique in agricultural
research today, in problems related to image analysis, the current survey focuses on
this specific sub-set of DL models and techniques.

7
Convolutional neural networks can increase their probability of correct
classifications, provided there are adequately large data sets (i.e. hundreds up to
thousands of measurements, depending on the complexity of the problem under
study) available for describing the problem. They consist of various convolutional,
pooling and/or fully connected layers. The convolutional layers act as feature
extractors from the input images whose dimensionality is then reduced by the pooling
layers, while the fully connected layers act as classifiers. Usually, at the last layer, the
fully connected layers exploit the high-level features learned, in order to classify
input images into predefined classes. The highly hierarchical structure and large
learning capacity of CNN models allow them to perform classification and
predictions particularly well, being flexible and adaptable in a wide variety of
complex challenges. Convolutional neural networks can receive any form of data as
input, such as audio, video, images, speech and natural language, and have been
applied successfully by numerous organizations in various domains, such as the web
(personalization systems, online chat robots), health (identification of diseases from
MRI scans), disaster management (identifications of disasters by remote-sensing
images), post services (automatic reading of addresses), car industry (autonomous
self-driving cars), etc.

Various convolutions are may be applied at some layers of the network,


creating different representations of the learning data set, starting from more general
ones at the first, larger layers and becoming more specific at the deeper layers. A
combination of convolutional layers and dense layers tends to present good precision
results. However, the success of each CNN model is highly dependent on the quality
of the data set used.

8
METHODOLOGY

The steps that go into this process are broken down as follows:
Step 1: Convolution
Step 1b: ReLU Layer
Step2:Pooling
Step 3: Flattening
Step 4: Full Connection

The first thing you need to know here is the elements that are included in the
operation:
 Input image
 CNN
 Output label (image class)

These elements interact in the following manner:

Step 1 - The Convolution Operation

In reality, convolutional neural networks develop multiple feature detectors and


use them to develop several feature maps which are referred to as convolutional
layers.Through training, the network determines what features it finds important in
order for it to be able to scan images and categorize them more accurately.

Based on that, it develops its feature detectors. In many cases, the features
considered by the network will be unnoticeable to the human eye, which is exactly
why convolutional neural networks are so amazingly useful. With enough training,
they can go light years ahead of us in terms of image processing.

9
For example, think of the feature detector as a window consisting of 9 (3x3)
cells. Here is what we do with it:

 We place it over the input image beginning from the top-left corner within the
borders we see demarcated above, and then we count the number of cells in
which the feature detector matches the input image.
 The number of matching cells is then inserted in the top-left cell of the feature
map.
 We then move the feature detector one cell to the right and do the same thing.
This movement is called a and since we are moving the feature detector one
cell at time, that would be called a stride of one pixel.
 What you will find in this example is that the feature detector's middle-left
cell with the number 1 inside it matches the cell that it is standing over inside
the input image. That's the only matching cell, and so we write "1" in the next
cell in the feature map, and so on and so forth.
 After we have gone through the whole first row, we can then move it over to
the next row and go through the same process.

After going over every pixel in the input image in the example above, we
would end up with these results:
(PTO)

10
Step 1(b): The Rectified Linear Unit (ReLU)

The Rectified Linear Unit, or ReLU, is not a separate component of the


convolutional neural networks' process. It's a supplementary step to the convolution
operation. We're going to consider both of them to be components of the first step in
our process. We should be familiar with the rectifier function that we see in the image
below.

The purpose of applying the rectifier function is to increase the non-linearity in


our images. The reason we want to do that is that images are naturally non-linear.
When we look at any image, we’ll find it contains a lot of non-linear features (e.g. the
transition between pixels, the borders, the colours, etc.). The rectifier serves to break
up the linearity even further in order to make up for the linearity that we might
impose an image when we put it through the convolution operation.

11
The essential difference between the non-rectified version of the image and the
rectified one is the progression of colours. After we rectify the image, we will find the
colours changing more abruptly. The gradual change is no longer there. That
indicates that the linearity has been disposed of.

Step 2 - Max Pooling

The purpose of max pooling is enabling the convolutional neural network to


detect the given object when presented with the image in any manner. Max pooling is
concerned with teaching our convolutional neural network to recognize that despite
all of these differences that we mentioned, they are all images of the object. In order
to do that, the network needs to acquire a property that is known as "spatial variance."

This property makes the network capable of detecting the object in the image
without being confused by the differences in the image's textures, the distances from
where they are shot, their angles, or otherwise. In order to reach the pooling step, we
need to have finished the convolution step, which means that we would have a feature
map ready.

Max Pooled Feature Map


Our main focus here will be max pooling. The process of filling in a pooled
feature map differs from the one we used to come up with the regular feature map.
This time you'll place a 2x2 box at the top-left corner, and move along the row. For
every 4 cells your box stands on, you'll find the maximum numerical value and insert
it into the pooled feature map. In the figure below, for instance, the box currently
contains a group of cells where the maximum value is 4.

12
Step 3: Flattening

After finishing the previous two steps, we’re supposed to have a pooled feature
map by now. As the name of this step implies, we are literally going to flatten our
pooled feature map into a column like in the image below.

The reason we do this is that we’re going to need to insert this data into an
artificial neural network later on. We have multiple pooled feature maps from the
previous step. What happens after the flattening step is that we end up with a long
vector of input data that you then pass through the artificial neural network to have it
processed further.

Step 4: Full Connection


As we see from the image below, we have three layers in the full connection step:

 Input layer
 Fully-connected layer
 Output layer

13
We call the layer in the middle the hidden layer whereas in the convolutional
context we are using the term fully-connected layer. The fully connected layer
connects all neurons in the previous layer to each and every neurons in the current
layer without taking any convolutions. The input layer contains the vector of data that
was created in the flattening step. The features that we distilled throughout the
previous steps are encoded in this vector. At this point, they are already sufficient for
a fair degree of accuracy in recognizing classes. We now want to take it to the next
level in terms of complexity and precision.

Throughout this entire process, the network’s building blocks, like the weights
and the feature maps, are trained and repeatedly altered in order for the network to
reach the optimal performance that will make it able to classify images and objects as
accurately as possible.

14
IMPLEMENTATION
DATA COLLECTION

The data used in this project is collected from a group of farmers directly. The
images used here are raw data given by farmers on paddy blast disease. We are
supposed to create a model using this data and evaluate it by determining whether it is
blast affected or not. Hence basically it is a binary classification problem.
The data we received was a messy one. From around thousand images we
manually selected 45 images each in yes and no class and saved to working directory.

DATA PREPARATION AND CREATION OF WORKSPACE

The selected images had to go through a series of modifications during the


whole process. Therefore, they must be carefully segregated into adequate folders.
9The tree strucute of folders that we created is given below.
Our finalized images are initially saved into yes and no folders. Since the
images came from different sources, we decided to rename them all so as to deal with
it more easily. The renamed images are saved in respective folders. Then we wanted
to know the size of images. After finding the size range of images we resized them
uniformly for easy feeding into subsequent CNN.

15
The follwing flowchart shows the whole process of data preparation at a
glance.

In addidition the program in Python for these are given below.

16
 Then we will resize images categorized in different folders i.e., like ‘yes
labels’, ‘no labels’ etc.
Python program corcerning this is given as follows:

BUILDING CNN

 For image classification we were supposed to do CNN technique. For this we


manually created for training and validation and path is assigned as variable.

17
 Next, we created a CNN model. This part is so tricky that we need to tweak the
arguments such as number of filters, window size, type of activation function
etc... to arrive at a better model.

DATA VALIDATION AND INTERPRETATION

18
For validation of the dataset we will rescale the data as train set and test set.
Then we will set a fit generator model with 5 epochs to find the accuracy of dataset.
The results are as shown.

From the above model we can say that the model has an accuracy of 74.29%.
Next is the test case of a single image. We are taking an image with yes
category of blast and wanted to know if the classifier predicts it as yes.

Here the model is able to predict the output correctly. That means the model
classified the image as having affected with blast disease.

19
FUTURE ENCHANCEMENT

This system can be used by farmers for detecting blast diseases in paddy
leaves. The future enhancement can be done by improving collecting better images,
more number of images for training and validation, by pre-processing to increase
the accuracy of images. Also, better collection of image data can be done for
enhanced accuracy. We also suggests to take images to train and validate, in the range
of thousands.
The whole system can be integrated with mobile phones. By integrating the
system with the DB associated with it, the user with the help of an application can test
whether his crop is affected with blast or not. Whereby the testing image is nothing
but taken from their mobile camera. The scope of the project can be extended to
multiclass classification also.

20
REFERENCES
1) Advancements in Image Classification using Convolutional Neural Network -
Farhana Sultana, Abu Sufian and Paramartha Dutta.
2) Image classification using Deep learning -M Manoj krishna, M Neelima , M
Harshali , M Venu Gopala Rao.
3) Image Classification Using Convolutional Neural Networks- Deepika Jaswal,
Sowmya.V, K.P.Soman.
4) Image Classification using Convolutional Neural Networks-Muthukrishnan
Ramprasath, M.Vijay Anand, Shanmugasundaram Hariharan.

21

You might also like