You are on page 1of 50

PLANT IDENTIFICATION SYSTEM USING MACHINE LEARNING

A project synopsis submitted in fulfilment of the Academic requirements


for the award of the Degree of

BACHELOR OF ENGINEERING
IN
INFORMATION TECHNOLOGY

By

Y.VENUGOPAL (2451-19-737-301)
B.SANDEEP REDDY (2451-19-737-057)
SK.ABDUL WASAY (2451-19-737-304)

Under the guidance of


Mrs.A.Manasa,
Assistant Professor, Dept. of I.T
Maturi Venkata Subba Rao(MVSR) Engineering College
Nadergul, Hyderabad.

DEPARTMENT OF INFORMATION TECHNOLOGY


MATURI VENKATA SUBBA RAO (MVSR) ENGINEERING COLLEGE
(An Autonomous Institution)
(Affiliated to Osmania University, Hyderabad. Recognized by AICTE)
Nadergul, Saroornagar Mandal, Hyderabad-501510 2022-23
MATURI VENKATA SUBBA RAO (MVSR)
ENGINEERING COLLEGE
(An Autonomous Institution)
(Affiliated to Osmania University, Hyderabad. Recognized by AICTE)
Nadergul, Saroornagar Mandal, Hyderabad-501510

DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE

This is to certify that the project work entitled “Plant Identification System Using Machine
Learning” is a bonafide work carried out by Y.VenuGopal (2451-19-737-301), B.Sandeep Reddy
(2451-19-737-057), SK.Abdul Wasay (2451-19-737-304) in partial fulfilment of the requirements
for the award of degree of Bachelor of Engineering in Information Technology from Maturi
Venkata Subba Rao Engineering College, affiliated to OSMANIA UNIVERSITY, Hyderabad,
during the Academic Year 2022-23. under our guidance and supervision.

The results embodied in this report have not been submitted to any other university or institute for
the award of any degree or diploma.

Signature of the Coordinator Signature of Guide

Signature of Head, ITD Signature of External Examiner

i
DECLARATION

We hereby declare that the contents presented in the Project Thesis titled “PLANT
IDENTIFICATION SYSTEM USING MACHINE LEARNING” submitted in partial fulfillment
for the award of Degree of Bachelor of Engineering in INFORMATION TECHNOLOGY (IT),
MATURI VENKATA SUBBA RAO (MVSR) ENGINEERING COLLEGE affiliated to OSMANIA
UNIVERSITY, Hyderabad is a record of the original work carried out by us under the supervision Of
A. MANASA. Further this is to state that the results embodied in this project report have not been submitted
to any University or Institution for the award of any Degree or Diploma.

Signature of the Student Signature of the Student Signature of the Student


Y. VENUGOPAL B. SANDEEP REDDY SK. ABDUL WASAY
2451-19-737-301 2451-19-737-057 2451-19-737-304

ii
ACKNOWLEDGEMENT

We with extreme jubilance and deepest gratitude would like to thank Ms. A. Manasa, Assistant
Professor, Department of Information Technology, Maturi Venkata Subba Rao (MVSR) Engineering
College, for her constant encouragement and facilities provided to us to complete our project in time.
We would like to extend our gratitude to Dr. D. Shanthi, Project Co-ordinate and Associate
Professor Department of Information Technology, Maturi Venkata Subba Rao Engineering College, for
his valuable suggestions and timely help while the project.

With immense pleasure, we record our deep sense of gratitude to Dr. K. Venu Gopal Rao Dean of
academics and Head of the Department of Information Technology, MVSR Engineering College, for
permitting us to carry out this project.

We express, from the bottom of my heart, my deepest gratitude to my parents and family for the
support, dedication, comprehension, and love.

Finally, we express our heartfelt thanks to each and everyone who directly and indirectly helped
us in the successful completion of this project work.

Y. VENUGOPAL (2451-19-737-301)
B.SANDEEP REDDY (2451-19-737-057)
SK. ABDUL WASAY (2451-19-737-304)

iii
Vision & Mission
MVSR Engineering College Department of Information Technology
COURSE NAME: MINI PROJECT - I
COURSE CODE: PW653IT

VISION
To impart technical education to produce competent and socially responsible engineers in the
field of Information Technology.

MISSION
M1. To make teaching learning process effective and stimulating.
M2. To provide adequate fundamental knowledge of sciences and Information Technology with
cheerful outlook.
M3. To create an environment that enhances skills and technologies required for industry.
M4. To encourage creativity and innovation for solving real world problems.
M5. To cultivate professional ethics in students and inculcate a sense of responsibility towards
society.

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)

The Bachelor’s program in Information Technology is aimed at preparing graduates who will:

I. Apply knowledge of mathematics and Information Technology to analyze, design and


implement solutions for real world problems in core or in multidisciplinary areas.
II. Communicate effectively, work in a team, practice professional ethics and apply
knowledge of computing technologies for societal development.
III. Engage in Professional development or postgraduate education to be a life-long learner.

iv
PROGRAM OUTCOMES (POs)

1. Engineering knowledge: Apply the knowledge of mathematics, science,


engineering fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesisof the
information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modelling to complex engineering activities with
an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive clear
instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and leader
in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

PROGRAM SPECIFIC OUTCOMES (PSOS):


(1) Hardware design: An ability to analyze, design, simulate and implement computer hardware /
software and use basic analog/digital circuits, VLSI design for various computing and communication
system applications.
(2) Software design: An ability to analyze a problem, design algorithm, identify and define the
computing requirements appropriate to its solution and implement the same.

v
COURSE OBJECTIVES:

1. To enhance practical & Professional skills.


2. To familiarize the tools and techniques of symmetric literature survey and documentation.
3. To expose students to industry practices and teamwork.
4. To encourage students to work with innovative and entrepreneurial ideas.

COURSE OUTCOMES:

On successful completion of this course students will be able to:


1. Define a problem of the recent advancements with applications towards society.
2. Outline requirements and perform requirement analysis for solving the problem.
3. Design and develop a software and/or hardware-based solution within the scope of
project using contemporary technologies and tools.
4. Test and deploy the applications for use.
5. Develop the Project as a team and demonstrate the application, with effective writtenand
oral communications.

vi
ABSTRACT

Nature has huge number of plants identifying them and classifying them is important task for
botanists. Identifying a plant requires recognizing it by one or more characteristics and linking that
recognition with a name, either common or scientific name. A system is developed which
recognizes plants automatically based on leaf structure using image processing. Moreover,
evolutionary changes are also taking place in plants, and it has impact on identification and
classification. Botanists visit remote places, jungles where the plants need to be identified and
classified. So an attempt is made to develop an automatic identification system where an individual
can capture the leaf and upload in the web application to get information about the plant.

vii
LIST OF TABLES

SNo Name Page No


1 Literature survey 3
2 Course Outcomes - Cognitive levels 26
3 Number of performance indicators addressed 27
by courseoutcomes
4 Calculation of CO-PO/PSO correlation levels 27
5 Course Articulation Matrix 28
6 PO/PSO addressed by the Project Table 29
7 Rubrics Evaluation 29

LIST OF FIGURES

Figure No Figure Name Page No


1 Architecture of Plant Identification System 9
2 Use Case Diagram 11

3 Class Diagram 12
4 Sequence Diagram 13
5 Activity Diagram 14
6 Python 6
7 PyCharm 8

8 TensorFlow 8

9 Home Page 16
10 Upload Image 16
11 Alstonia Scholaris 17
12 Basil 17

viii
TABLE OF CONTENTS

CONTENTS PAGE NO.s


Certificate i
Declaration ii
Acknowledgement iii
Vision & Mission iv
Abstract vii
List of Tables viii
List of Figures viii
Table of Contents ix

1. Introduction
1.1 Problem statement 1-2
1.2 Objectives
1.3 Motivation
1.4 Existing system
1.5 Proposed system
1.6 Scope

2. Literature Survey 3-4

3. System Requirement Specifications 5


3.1 Software Requirements
3.2 Hardware Requirements
4. Technologies Used 6-12

5. System Design 9-13


5.1 System Architecture / Block Diagram
5.2 Diagrams applicable
6. Implementation 14-17
6.1 Environmental Setup
6.2 Module Description
7. Results 18-20

8. Testing 21-22
8.1 Testing
8.2 Test cases

9. Conclusion & Future Enhancements 23

ix
References 24
Appendix
A: source/pseudo code 25-27
B: Co-Po Mappings 28-37

x
1. INTRODUCTION

• Plant classification is conventionally done by their floral parts, flowers, fruits and leaves by botanist.
Flowers and fruits is not a suitable choice of selection for plant identification as they appear for acute
interval.
• Leaves on the other hand are available for longer duration and are available in abundance and
happen to be a suitable choice for automatic identification of plants.
• Considering the huge amount of species, plant identification is a fairly difficult task even for
botanists. This is where a plant identification app comes in.
• Accurate identification of a plant can be helpful for the farmers and garden enthusiasts to acquire
species knowledge like how it grows as well as how to care and protect it from pests and diseases.

1.1. PROBLEM STATEMENT

Plants are the backbone of life on earth, as it provides us food and oxygen. Hence, A good
understanding of plants is needed to help in identifying new or rare plant species. Such identification will
in turn improve the drug industry, balance the ecosystem as well as the agricultural productivity and
sustainability. Botanists are interested in the variations on leaf characteristics as it helps them to carry out
a comparative analysis on plant.

1.2. OBJECTIVES

The objectives of this project are:


• To identify the plant by its leaf features.
• To provide the information about the plants.
• To increase accuracy of plant identification.

1.3. MOTIVATION

We cannot live without plants, but sometimes they cause us problems. Many plants are
weeds. Weeds are plants that grow where people don’t want them, such as gardens and lawns. They take
up space and use resources, hindering the growth of more desirable plants. People often introduce plants
to new habitats where they lack natural predators and parasites. The introduced plants may spread rapidly
and drive out native plants. Many plants produce pollen, which can cause allergies. Plants may also
produce toxins that harm human health.
1
1.4. EXISTING SYSTEM

The existing systems are based on flowers and medicinal plants, the flower-based identification system
returns the top three most similar flower images. The accuracy is high if their color is distinct. But if
colors are same then it may mislead to classify the image. Identification of medicinal plants give high
accuracy, but leaf vein features and edge features are not considered.

Drawbacks:

• Flower based identification model may mislead to classify the image if the flower colors are
same.
• In medicinal plant identification leaf vein and edge features are not considered some plants
may have similar leaf structure.

1.5. PROPOSED SYSTEM

In proposed plant identification system, we have used the Mendeley dataset consisting high-quality
images of 10 different species with several samples per species. we have developed an web application
using flask framework where a user can capture the leaf of a plant and upload it. The input leaf image is
classified, and the system returns plant information of that leaf. For this, a Convolutional Neural
Network (CNN) model is trained to identify the plant accurately.

ADVANTAGES:

A deep learning architecture considering all these constraints are going to be designed here. The
proposed system is comparatively an easy, inexpensive and reliable method compared to other flower-
based identification and medicinal plant identification systems.

1.6. SCOPE AND PURPOSE

When a user needs to know the details or the features of the Plants, then the user upload a
picture of the leaf to know the details of the plant. Here we are processing the image from the user and
extracting the image to get the details of the plant. A deep learning architecture considering all these
constraints is designed here Plants are important species on the earth they release o2. Building accurate
knowledge of the identity and the geographic distribution of plants is essential for future biodiversity
conservation. Therefore, rapid and accurate plant identification is essential for effective study and
management of biodiversity.

2
2. LITERATURE SURVEY

[1] Flower Recognition System Based on Image Processing


Authors: Tanakorn Tiay, Pipimphorn Benyaphaichit, and Panomkhawn Riyamongkol
This system uses edge and color characteristics of flower images to classify flowers. Hus
seven moment algorithm is applied to acquire edge characteristics. Red, green, blue, hue, and saturation
characteristics are derived from histograms. K- nearest neighbor is used to classify flowers. The system
returns the top three most similar flower images. The Canny edge detection algorithm is applied to the
cropped image to receive edge data. The edge data will be the input into Hus seven-moment algorithm.
Classification: All characteristic values will be classified by the K-nearest neighbor algorithm. The three
nearest flower characteristics are selected; the nearest flower information is displayed.
This system is based on color model so the accuracy is high if their color is distinct. But if
colors are same then it may mislead to classify the image. So, this system can be further improved to
yield more accuracy by combining other features, such as numbers of petals and flower texture. The
accuracy of this system is more than 80%.
[2] plant disease detection using digital image processing techniques and back propagation
neural network
Authors: S. Khirade et Al, Shiroop Madiwalar and Medha Wyawahare
Authors have elaborated different techniques for the detection of plant disease using the images of
leaves. They have implemented Otsu’s thresholding followed by boundary detection and spot detection
algorithm to segment the infected part in leaf. After that they have extracted the features such as color,
texture, morphology, edges etc. for classification of plant disease. BPNN is used for classification i.e. to
detect the plant disease.
Shiroop Madiwalar and Medha Wyawahare analyzed different image processing approaches for
plant disease detection in their research [2]. Authors analyzed the color and texture features for the
detection of plant disease. They have experimented their algorithms on the dataset of 110 RGB images.
The features extracted for classification were mean and standard deviation of RGB and YCbCr channels,
grey level cooccurrence matrix (GLCM) features, the mean and standard deviation of the image
convolved with Gabor filter. Support vector machine classifier was used for classification. Authors
concluded that GCLM features are effective to detect normal leaves. Whereas color features and Gabor
filter features are considered as best for detecting anthracnose affected leaves and leaf spot respectively.
They have achieved highest accuracy of 83.34% using all the extracted features.

3
LITERATURE SURVEY
SNO Author Name Description Techniques Used Accuracy Drawback
1 Tanakorn Tiay , Flower Recognition K- nearest neighbor 80% This system is based on
Pipimphorn System Based on color model so the
Benyaphaichit , Image Processing. accuracy is high if their
Panomkhawn color is distinct. But if
Riyamongkol colors are same then it
may mislead to
classify the image.

2 Pavan Kumar A semi-automatic Random forest classifier 85% Multistage comparison


Mishral, Sanjay plant identification are used in this system
Kumar Maurya, based on leaf and so it takes lot of time
Ravindra Kumar flower images. and space.
Singh

3 C. H. Arun, W. R. Texture Feature Image processing, 85% High computation cost


Sam Emmanuel Extraction for Pattern recognition and it is slow.
and D. Christopher Identification of
Durairaj Medicinal Plants

4
3. SYSTEM REQUIREMENT AND SPECIFICATIONS

3.1 SOFTWARE REQUIREMENTS:

• Operating System : Windows/Linux


• Front End : Html, CSS, JavaScript
• Back End : Flask
• Programming Language : Python
• Coding Platform : PyCharm

3.2 HARDWARE REQUIREMENTS:

• Camera Resolution : 12MP


• Ram : 4GB and above
• Processor : Intel i3 and above or Ryzen 3+ Series
• Hard disk Space : Minimum 5GB of Space Required

5
4. TECHNOLOGIES USED

Python:

Python is an interpreted high-level general-purpose programming language. Its design philosophy


emphasizes code readability with its use of significant indentation. Its language constructs as well
as its object-oriented approach aim to help programmers write clear, logical code for small and
large-scale projects.

Python is dynamically typed and garbage collected. It supports multiple programming paradigms,
including structured (particularly, procedural), object-oriented and functional programming. It is
often described as a "batteries included" language due to its comprehensive standard library.

Guido van Rossum began working on Python in the late 1980s, as a successor to the ABC
programming language, and first released it in 1991 as Python 0.9.0.Python 2.0 was released in
2000 and introduced new features, such as list comprehensions and a cycle-detecting garbage
collection system (in addition to reference counting). Python 3.0 was released in 2008 and was a
major revision of the language that is not completely backward-compatible. Python 2 was
discontinued with version 2.7.18 in 2020. Python consistently ranks as one of the most popular
programming languages.

Fig: 6 Python

PyCharm:

PyCharm is the most popular IDE used for the Python scripting language. This chapter will give you an
introduction to PyCharm and explain its features.

PyCharm offers some of the best features to its users and developers in the following aspects-

• Code completion and inspection


• Advanced debugging
• Support for web programming and frameworks such as Django and Flask

6
Features of PyCharm

• Code Completion
• SQLAlchemy as Debugger
• Git Visualization in Editor
• Code Coverage in Editor
• Package Management
• Local History
• Refactoring

User Interface of PyCharm Editor

Fig: 7 User Interface of PyCharm Editor

TENSORFLOW

Fig: 8 TensorFlow
TensorFlow was developed by the Google Brain team for internal Google use in research and
production. The initial version was released under the Apache License 2.0 in 2015.Google release the
updated version of TensorFlow, named TensorFlow 2.0, in September 2019.

7
TensorFlow can be used in a wide variety of programming languages, most notably Python, as well
as JavaScript, C++, and Java. This flexibility lends itself to a range of applications in many different
sectors.

TensorFlow serves as the core platform and library for machine learning. TensorFlow’s APIs use
Keras to allow users to make their own machine learning models. In addition to building and training
their model, TensorFlow can also help load the data to train the model and deploy it using
TensorFlow Serving.

TensorFlow provides a stable Python API, as well as APIs without backwards compatibility
guarantee for JavaScript, C++, and Java. Third-party language binding packages are also
available for C#, Haskell, Julia, MATLAB, R, Scala, Rust, OCaml, and Crystal. Bindings that are
now archived and unsupported include Go and Swift.

TensorFlow is well-documented and includes plenty of machine learning libraries. It offers a


fewimportant functionalities and methods for the same.

TensorFlow is also called a “Google” product. It includes a variety of machine learning and deep
learning algorithms. TensorFlow can train and run deep neural networks for handwritten digit
classification, image recognition, word embedding and creation of various sequence models.

● It includes a feature that defines, optimizes and calculates mathematical expressions easily
with the help of multi-dimensional arrays called tensors.

● It includes programming support of deep neural networks and machine learning


techniques.

● It includes a highly scalable feature of computation with various data sets.

● TensorFlow uses GPU computing, automating management. It also includes a unique


feature of optimization of the same memory and the data used.

FEATURES OF TENSORFLOW:

● Auto Differentiation
● Eager execution.
● Distribute
● Los

8
5. SYSTEM DESIGN

5.1. SYSTEM ARCHITECTURE/BLOCK DIAGRAM

Here we proposed a methodology to identify the plant name by its leaf the proposed system classifies
the leaf images into labels based on vein features and edge features of leaf. CNN model predicts the
label of the leaf image uploaded by the user. The plant name and information related to that label is
displayed as output.

Fig: 1 Architecture Plant Identification System

5.2 DIAGRAMS APPLICABLE


UML DIAGRAMS:
UML stands for Unified Modeling Language. UML is a standardized general-purpose
modeling language in the field of object-oriented software engineering. The standard is managed,
and was created by, the Object Management Group.
The goal is for UML to become a common language for creating models of object oriented
computer software. In its current form UML comprises two major components: a Meta-model and
a notation. In the future, some form of method or process may also be added to; or associated with,
UML.

9
The Unified Modeling Language is a standard language for specifying, Visualization, Constructing
and documenting the artifacts of software systems, as well as for business modeling and other non-
software systems.
The UML represents a collection of best engineering practices that have proven successful
in the modeling of large and complex systems.
The UML is a very important part of developing objects-oriented software and the software
development process. The UML uses mostly graphical notations to express the design of software
projects.

GOALS:
The Primary goals in the design of the UML are as follows:
1. Provide users a ready-to-use, expressive visual modeling Language so that
they candevelop and exchange meaningful models.
2. Provide extendibility and specialization mechanisms to extend the core concepts.
3. Be independent of programming languages and development processes.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of the OO tools market.
6. Integrate best practices.

USE CASE DIAGRAM:

A use case diagram in the Unified Modeling Language (UML) is a type of behavioral diagram defined by
and created from a Use-case analysis. Its purpose is to present a graphical overview of the functionality
provided by a system in terms of actors, their goals (represented as use cases), and any dependencies
between those use cases. The main purpose of a use case diagram is to show what system functions are
performed for which actor. Roles of the actors in the system can be depicted.

10
Fig.2.Use Case Diagram

CLASS DIAGRAM:
In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of
static structure diagram that describes the structure of a system by showing the system’s classes,
their attributes, operations (or methods), and the relationships among the classes. It explains which
class contains information.

Fig 3: Class Diagram

11
SEQUENCE DIAGRAM:
A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that
shows how processes operate with one another and in what order. It is a construct of a Message
Sequence Chart. Sequence diagrams are sometimes called event diagrams, event scenarios, and
timing diagrams.

Fig 4: Sequence Diagram

12
ACTIVITY DIAGRAM:

Activity diagrams are graphical representations of workflows of stepwise activities and actions
with support for choice, iteration and concurrency. In the Unified Modeling Language, activity
diagrams can be used to describe the business and operational step-by-step workflows of
components in a system. An activity diagram shows the overall flow of control.

Fig 5: Activity Diagram


13
6. IMPLEMENTATION

Environmental Setup:
• Install Python 3.7 version Software by using the link below.
http://www.mediafire.com/file/kipz3ay6alpww0r/python-3.7.0-amd64.exe/file
• Install PyCharm to edit the code.
• Create virtual environment in C directory.
• Install the required python packages like tensorflow, keras etc.,
• Data Set:
• Images downloaded from the Mendeley website. Mendeley dataset consisting of several
images of 10 different plant species.

Module Description:
 Here there are two modules in this project
1. User
2. System
USER
Users are the farmers and garden enthusiasts who can upload the leaf and acquire the species
knowledge.
SYSTEM
System will train the images and label the images. It identifies the label of the leaf uploaded
by the user and provide the plant information related to that label.
Algorithm:
➢ Step 1: Import Required libraries.

14
➢ Step 2: Initializing CNN and adding a convolution layer.

We first need to initiate sequential class since there are various layers to build CNN which all must be in
sequence. Then we add the first convolutional layer.
• Activation function – Relu: Since images are non-linear, to bring non-linearity, the relu activation
function is applied after the convolutional operation. Relu stands for Rectified linear activation function.
Relu function will output the input directly if it is positive, otherwise, it will output zero.
• Input Shape: This argument shows image size – 120*120*3.
➢ Step 3: Pooling Operation

We need to apply the pooling operation after initializing CNN. Pooling is an operation of down sampling
of the image. The pooling layer is used to reduce the dimensions of the feature maps. Thus, the Pooling
layer reduces the number of parameters to learn and reduces computation in the neural network.
➢ Step 4: Adding a second convolution layer we need to repeat steps 2 & 3.
➢ Step 5: Flattening Operation

Flattening operation is converting the dataset into a 1-D array for input into the next layer which is the fully
connected layer.
➢ Step 6: Fully connected layer

15
➢ The output of the flattening operation work as input for the neural network. Here we are using a
dense class from the Keras library from creating a fully connected layer and output layer.
➢ Compiling CNN Model

• Loss function: We are using the categorical_crossentropy loss function that is used in the
classification task.
• Optimizer: We are using adam Optimizer that is used to update neural network weights and
learning rate. Optimizers are used to solve optimization problems by minimizing the
function.
• Metrics: we are using Accuracy as a metrics to evaluate the performance of the
Convolutional neural network algorithm.
• Fitting Model on Training
We are fitting the CNN model on the training dataset with 50 iterations and each iteration has different
steps for training and evaluating steps based on the length of the test and training set.

6.2 ALGORITHM
1. Convolutional Neural Network
Step1: convolutional operation
The first building block in our plan of attack is convolution operation. In this step, we will touch on
feature detectors, which serve as the neural network's filters. We will also discuss feature maps, learning
the parameters of such maps, how patterns are detected, the layers of detection, and how the findings are
mapped out.

16
The second part of this step will involve the Rectified Linear Unit or Relook. We will cover Relook
layers and explore how linearity functions in the context of Convolutional Neural Networks.
Not necessary for understanding CNN's, but there's no harm in a quick lesson to improve your skills.

17
Step 2: Pooling Layer
In this part, we'll cover pooling and will get to understand exactly how it generally works. Our nexus
here, however, will be a specific type of pooling; max pooling. We'll cover various approaches, though,
including mean (or sum) pooling. This part will end with a demonstration made using a visual interactive
tool that will definitely sort the whole concept out for you.
Step 3: Flattening
This will be a brief breakdown of the flattening process and how we move from pooled to flattened layers
when working with Convolutional Neural Networks. Flattening operation is converting the dataset into a
1-D array for input into the next layer which is the fully connected layer.

After finishing the 3 steps, now we have pooled feature map. We are now flattening our output after two
steps into a column. Because we need to insert this 1-D data into an artificial neural network layer.

18
Step 4: Fully connected layer and output layer
The output of the flattening operation work as input for the neural network. The aim of the artificial
neural network makes the convolutional neural network more advanced and capable enough of
classifying images.

6.3 MODULE DESCRIPTION:

Here there are two modules in this project

1. User
2. System

USER

Users are the farmers and garden enthusiasts who can upload the leaf and acquire the species knowledge.

SYSTEM

System will train the images and label the images. It identifies the label of the leaf uploaded by the user
and provide the plant information related to that label.

19
7. RESULTS

Fig:9 Home Page

Above screen is the home page of the web application where user can upload image. By clicking on
“Choose File” button user will directed to the screen below.

Fig:10 Upload image

Here user can browse the image from internal storage and upload the file and then click on “Predict”.

20
Fig:11 Alstonia Scholaris

After uploading the image and by clicking on “Predict” button user will get the information according
to the image uploaded.

Fig:12 Basil

Above screen shows the Basil plant and the uses of the basil plant.

21
Arjun

22
8. TESTING

8.1 Testing

Unit Testing:

Unit testing is usually conducted as part of a combined code and unit test phase of the software
lifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinct
phases.

Test strategy and approach

Field testing will be performed manually and functional tests will be written in detail.

Test objectives

● All field entries must work properly.

● Pages must be activated from the identified link.

● The entry screen, messages and responses must not be delayed.

Features to be tested

● Verify that the entries are of the correct format

● No duplicate entries should be allowed

● All links should take the user to the correct page.

Integration Testing

Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.The
task of the integration test is to check that components or software applications, e.g. components
in a software system or – one step up – software applications at the company level – interact
without error.

23
Test Results: All the test cases mentioned above passed successfully. No defects were
encountered.

Acceptance Testing

User Acceptance Testing is a critical phase of any project and requires significant participation by
the end user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects were
encountered.

8.2 Test Cases

S. Test Case Expected Results Actual Result Status


No Name/Input
1 Choose file Redirecting to choose file Redirected to choose file Success
2 Select image Preview selected file name File name Success
3 Alstonia.jpg Display information about Displayed information about Success
Alstonia Scholaris Alstonia Scholaris

4 Arjun.jpg Display information about Displayed information about Guava Fail


Arjun
5 Arjun01.jpg Display information about Displayed information about Arjun Success
Arjun
6 Jatropha.jpg Display information about Displayed information about Success
Jatropha Jatropha

24
9. CONCLUSION AND FUTURE ENHANCEMENTS

In this project, a web application for leaf species identification has been presented. It is based on
a set of leaf descriptors that have given promising results on leaf datasets. We achieved better accuracy of
90%. The accuracy of the identification makes this application useful to non-experts who are interested in
acquiring information about plants and as well as experts.

Future Enhancements:
We would like to develop an user friendly Android Application.

REFERENCES

[1] N. Boujemaa, J. Fauqueur, M. Ferecatu, F. Fleuret, V. Gouet, B. Lesaux, and H. Sahbi. Ikona:
Interactive specific and generic image retrieval. In International workshop on Multimedia Content-Based
Indexing and Retrieval (MMCBIR), 2001.
[2] H. Go¨eau, P. Bonnet, A. Joly, I. Yahiaoui, D. Barth´el´emy, N. Boujemaa, and J.-F. Molino. The
IMAGECLEF 2012 Plant identification Task. In CLEF 2012, Rome, Italy, Sept. 2012.
[3] A. Joly and O. Buisson. Random maximum margin hashing. In CVPR, pages 873–880, 2011.
[4] N. Kumar, P. N. Belhumeur, A. Biswas, D. W. Jacobs, W. J. Kress, I. C. Lopez, and J. V. B. Soares.
Leafsnap: A computer vision system for automatic plant species identification. In 12th European
Conference on Computer Vision (ECCV 2012), pages 502–516, Florence, Italy, Oct. 2012.
[5] S. Mouine, I. Yahiaoui, and A. Verroust-Blondet. Advanced shape context for plant species
identification using leaf image retrieval. In Proceedings of the 2nd ACM International Conference on
Multimedia Retrieval, pages 49:1–49:8, 20

25
APPENDIX

Sample Code:

Training.py

from tensor flow. compact. v1 import ConfigProto


from tensor flow. compat.v1 import Interactive Session

config = ConfigProto ()
config.gpu_options.allow_growth = True
session = Interactive Session(config=config)

from tensorflow.keras.models import Sequential


from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensor flow.keras.preprocessing.Image import ImageDataGenerator
import tensor flow as tf
tf.compat.v1.disable_eager_execution()
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
import matplotlib.pyplot as plt
import numpy as np

#basic cnn
# Initializing the CNN
model = Sequential ()

# Step 1 - Convolution
model. Add(Conv2D(32, (3, 3), input shape = (128, 128, 3), activation = 'relu'))

# Step 2 - Pooling
model. Add(MaxPooling2D(pool size = (2, 2)))

# Adding a second convolutional layer


model. Add(Conv2D(32, (3, 3), activation = 'relu'))
model. Add(MaxPooling2D(pool size = (2, 2)))

# Step 3 - Flattening
model. Add(Flatten())

# Step 4 - Full connection

26
model. Add(Dense(units = 128, activation = 'relu'))
model. Add(Dense(units = 10, activation = 'sigmoid'))

# Compiling the CNN


model. Compile(optimizer = 'adam', loss = 'categorical_crossentropy', metrics = ['accuracy'])

train_datagen = ImageDataGenerator(rescale = 1./255, shear range = 0.2, zoom range = 0.2,


horizontal flip = True)

test_datagen = ImageDataGenerator(rescale = 1./255)

training set = train_datagen.flow_from_directory('Dataset/train', # relative path from working directoy


target size = (128, 128),
batch_size = 6, class_mode = 'categorical')
valid_set = test_datagen.flow_from_directory('Dataset/val', # relative path from working directoy
target_size = (128, 128),
batch_size = 3, class_mode = 'categorical')

labels = (training_set.class_indices)
print(labels)

leaf.py

from flask import Flask, render_template, request

import numpy as np
import os

os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

from tensorflow.keras.preprocessing.image import load_img


from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.models import load_model

filepath = 'model.h5'
model = load_model(filepath)
print(model)

print("Model Loaded Successfully")

def pred_leaf(leaf):
test_image = load_img(leaf, target_size=(128, 128)) # load image
print("@@ Got Image for prediction")

27
test_image = img_to_array(test image) / 255 # convert image to np array and normalize
test_image = np.expand_dims(test image, axis=0) # change dimension 3D to 4D

result = model. Predict(test_image) # predict plant


print('@@ Raw result = ', result)

pred = np.argmax(result, axis=1)


print(pred)

28
CO-PO/PSO MAPPING

Course Statement Cognitive PO / PSO addressed


code Student will be able to Level

PW961.1 Define a problem of the recent advancements An PO1,PO2,PO3,PO4,PO5,PO6,PO7,PO8,PSO1,PSO2


with applications towards society.
PW961.2 Outline requirements and perform requirement An PO1,PO2,PO3,PO4,PO5,PO6,PO7,PO8,PSO1,PSO2
analysis for solving the problem.
PW961.3 Design and develop a software and/or hardware AP, E, An PO1,PO2,PO3,PO4,PO5,PO6,PO7,PO8,PSO1,PSO2
based solution within the scope of project using
contemporary technologies and tools.
PW961.4 Test and deploy the applications for use. AP,E,An PO8,PO9,PO10,PO11,PO12,PSO1,PSO2

PW961.5 Develop the Project as a team and Demonstrate C PO8,PO9,PO10,PO11,PO12,PSO1,PSO2


the application, with effective written and oral
communications.

Table 1: Course Outcomes - Cognitive levels


Cognitive Levels: R-Remember; U-Understand; Ap-Apply; An=Analyze; E-Evluate;
C-Create

29
Table 2: Number of performance indicators addressed by course outcomes
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
Course Code
No. of PIs addressed by 4 4 4 4 4 4 4 5 5 7 4 6 5 6
course for a given PO

CO1 2 2 2 1 3 1 1 1 3 3 1 2 1 3
CO2 3 2 3 2 3 1 1 1 3 3 3 2 2 3
CO3 3 3 3 2 3 1 1 3 3 3 3 2 2 3
CO4 3 3 3 3 2 2 2
CO5 1 3 3 3 2 2 3

Table 3: Calculation of CO-PO/PSO correlation levels


PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
Level

Level

Level

Level

Level

Level

Level

Level

Level

Level

Level

Level

Level

Level
PW961I

%
T % % % % % % % % % % % %
CO1 50 3 50 2 50 2 25 1 50 3 25 1 25 1 20 1 50 3 50 3 25 1 30 1 20 1 50 3
CO2 75 3 50 2 75 3 50 2 50 3 25 1 25 1 20 1 50 3 50 3 75 3 30 1 50 3 50 3
CO3 75 3 75 3 75 3 50 2 50 3 25 1 25 1 50 3 50 3 75 3 75 3 30 1 50 3 50 3
CO4 50 50 3 50 3 75 3 75 3 30 1 20 1 50 3
CO5 50 20 1 50 3 50 3 75 3 30 1 40 2 50 3
No.
3 9 3 7 3 11 3 8 3 9 3 3 3 3 5 9 5 15 5 15 5 13 5 5 5 10 5 15
Mapped
Average
9/3=3 7/3=2.3 8/3=2.6 8/3=2.6 9/3=3 3/3=1 3/3=1 9/5=1.8 15/5=3 15/5=3 13/5=2.6 5/5=1 10/5=2 15/5=3
of Level
Rounded
average 3 2 3 3 3 1 1 2 3 3 3 1 2 3
level

30
Table 4: Course Articulation Matrix
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
PW961IT
CO1 3 2 2 1 3 1 1 1 3 3 1 1 1 3
CO2 3 2 3 2 3 1 1 1 3 3 3 1 3 3
CO3 3 3 3 2 3 1 1 3 3 3 3 1 3 3
CO4 3 3 3 3 1 1 3
CO5 1 3 3 3 1 2 3
PW961IT 3 2 3 3 3 1 1 2 3 3 3 1 2 3

31
RUBRICS ANALYSIS

Table 5: PO/PSO addressed by the Project


In-house /
Project Name Domain PO/PSO addressed Name and Signature of Guide
Industry

Table 6: Rubrics Evaluation


PO4,PO5, PO4,PO5,
PO/PSO PO1,PO2,PO6,PO7 PO3 PO8 PO9 PO10 PO11 PO12
PSO1 PSO2
Rubrics R1 R2 R3 R4 R5 R6 R7 R8 R9
CI CII CIII Total CIV CV CVI CVII CVIII CIX CX Total CXI CXII Total CXIII CIV
Roll. No.
4 4 4 12 4 4 4 4 4 4 4 12 4 4 8 4 4

32
Rubrics
for project
Focus
Areas:
1. Problem Formulation (PO1,PO2, PO6,PO7)
2. Project Design (PO3)
3. Build (PO4,PO5,PSO1)
4. Test& Deploy (PO4,PO5,PSO2)
5. Ethical responsibility (PO8)
6. Team Skills (PO9)
7. Project Presentation (P10)
8. Project Management (PO11)
9. Lifelong Learning (PO12)

Focus Criterion [c] Exemplary 4 Satisfactory 3 Developing 2 Unsatisfactory 1


Areas
I - Identify/Define Problem Demonstrates a skillful Demonstrates ability to Identify / Demonstrates some ability to Demonstrates minimal or no
Ability to identify a suitable ability to identify /articulate articulate a problem and identify / articulate a problem ability to identify / articulate a
problem and define the project a problem and theobjectives All major objectives are that is partially connected to problem and many major
objectives. are well defined And identified. the issues and most major objectives are not identified.
prioritized. objectives are identified but
one or two minor ones are
missingor priorities are not
established.

II-Collection of Background Collect sufficient Collects sufficient Collects some relevant Minimal or no ability to collect
Information: Ability to gather relevant background relevant background background information from relevant background information
backgroundInformation (existing information from information from appropriate Sources.
knowledge, research,and/or appropriate sources, and appropriate sources;
indications of the problem) is able to identify
pertinent /critical
Problem information;

33
Formulation III- Define scope of the Demonstrates a skillful Demonstrates ability to define Demonstrates some ability to Demonstrates minimal or no
(PO1,PO2, problem ability to define thescope of problem scope mentioning the define problem scope ability to define problem scope
PO6, PO7) Ability to identify problem scope problem accurately relevant fields of engineering mentioning some of the and fails to mention relevant
suitable to the mentioning the relevant broadly. Considers and explains relevantfields. Some fields of engineering. Minimal or
degree considering the fields of engineering the impact of engineering consideration of the impact of no consideration of
impact on society and precisely. Considers,explains interventions on society and engineering interventions on the impact of engineering
environment and evaluates theimpact of environment society and environment. interventions on society and
engineeringinterventions on environment
Society and environment.

IV- Understanding the Design Demonstrates a Demonstrates an ability to Demonstrates some ability Demonstrates minimal or no
Process and Problem Solving: comprehensive ability to understand and explain a design to understand and explain a ability to understand and explain a
Ability to explain the design understand and explain a process. Considers design process. Considers a design process. Considers a single
process including the design process. Considers multiple few approaches to approach to solving a problem.
Project importance of needs, multiple approaches to approaches to solving a problem, solving a problem; Does not consider consequences.
Design specifications, concept solving a problem, and can which is justified and considers doesn't always
(PO3) generation and to develop an articulate reason for consequences. consider consequences.
approach to choosing solution
solve a problem.

34
V- Implementing Design Demonstrates skillful Demonstrates an ability to Demonstrates some ability to Demonstrates minimal or no
Strategy: Ability to execute a ability to execute a solution executea solution taking into execute a solution but not ability to execute a solution.
solution taking into taking into consideration all consideration designrequirements using most relevant tool. Solution does not directly attend to
consideration design design requirements using the using relevant tool. the problem.
Build
requirements using most relevant tool.
(PO4,PO5, appropriate tool
PSO1) (software/hardware);
VI- Evaluating Final Design: Demonstrates skillful Demonstrates an ability to Ability to evaluate/confirm the Demonstrates minimal or no ability
To ability to evaluate/confirm the functioning functioning of the finaldesign, to evaluate/confirm the functioning
evaluate/confirm the evaluate/confirm the of the final design. Theevaluation but the evaluation lacks depth of the final design.
functioning of the final design. functioning of the is complete and has sufficient and/or is incomplete.
Test & Deploy
To deploy the project on the finaldesign skillfully, depth.
(PO4, PO5,
target environment with deliberation for
PSO2)
further Improvement
after deployment.

VII - Proper Use of Others’ Always recognizes and Recognizes and applies proper Some recognition and Minimal or no recognition
Work: Ability to recognize, applies proper ethical use ethical use of intellectual application of proper ethical and/or
Ethical understand and apply proper of intellectual property, copyrighted materials, use of intellectual property, application of proper ethical use
responsibility ethical use of intellectual property, copyrighted and others’ research. copyrighted materials, and of intellectual property,
(PO8) property, copyrighted materials, and others’ research. Copyrighted materials, or
materials,and research. others’ research. others ‘research.

VIII - Individual Work Designated jobs are Designated Jobs are Designated jobs are Some Designated jobs are
Contributions and accomplished by deadline; jobs completed accomplished by accomplished by
Time completed work iscarefully accomplished work deadline; completed work deadline;completed meets work
Management: and meticulously prepared deadline; meets meets most requirements. some
Ability to carry out individual and meets all requirements. requirements.
Responsibilities and requirements.
manage time (estimate,
prioritize, establish
deadlines/
milestones, follow
timeline, plan for contingencies,
adapt to change).

35
IX - Leadership Skills: Ability Exemplifies leadership Demonstrates leadership skills. Demonstrates some Demonstrates minimal or no
to lead a team. skills. leadership skills Leadership skills.
Team Skills (i) Mentors and accepts at times.
(PO9) mentoring from others.
(ii) Demonstrates
capacity for initiative while
respecting others' roles.
(iii) Facilitates others'
involvement. (iv)
Evaluates team
Effectiveness and plans
for improvements

36
X - Working with Others: Skillfully listens to, Listens to, collaborates with, and Sometimes listens to, Rarely listens to, collaborates
Ability to listen to, collaborate collaborates with, and champions the efforts of others. collaborates with, and with, or champions others' efforts.
with, and champion the efforts of champions the efforts of champions others' efforts.
others. others.

XI - Technical Writing Main idea is clearly and Main idea is Main idea is somewhat Main idea is difficult to
Skills precisely stated. understandable. Material moves Understandable. understand. Material has
Ability to Materials logically forward, Illustrations are Material has some logical orderand is little logical order, and is
communicate the main are properly used to support ideas somewhat coherent or easy to follow. often unclear, incoherent.
idea with clarity. Ability seamlessly arranged in a Illustrations are for the most part Illustrations are used, but
to use illustrations logical sequence properly used to support ideas minimally support ideas.
properly to supportideas Illustrations (not properly cited etc)
(citations, position on are
page etc) skillfully used to support
ideas
XII - Communication Presentation logically and Presentation has clear structure Presentation has some structure. Key Presentation rambles. Not
Skills for Oral Reports skillfully and is easy to follow. Key ideas ideas generally identifiable, although organized; key ideas are
Ability to present strong structured. Key ideas are clearly and concisely not very remarkable. difficult to identify, and
Project key ideas and supporting are compelling, and articulated, and are interesting. Introduction, supporting are unremarkable. No
Presentation details with clarity and articulated There is sufficient detail to details and/or summary clear
(P10) concision. with ascertain speaker's may be too broad, toodetailed or introduction,
Maintain exceptional clarity authority, and missing. Credibility supporting details
contact with audience, and presentation includes of the speaker andsummary.
and abilityto complete in concision. anintroduction may be Speaker
the allotted time Introduction, and summary. questionable at times. Presentation has no
supportingdetails and Presentation does not quite fitwithin time credibility.
summary areclearly fitswithin time constraint; Presentation
evident constraint, though presenter is
and presentermight have to subtly rush has to rush or slow down atend unsuitablably short
memorable, and or slow down. or
ascertain the unreasonably long.
credibility of the speaker
Presentation fits
perfectly
within time constraint.

37
XIII - Monitors timelines and Monitors timelines and progress Seldom monitors timelines and Does not monitor timeline
Monitoring an progress toward project toward project goals most of the progress toward project goals. s andprogress toward
dControlling the goals on a daily basis. time. Provides relatively acc urate, yet project goals. Provides
Project Provides accurate, Provides clearly incomplete, inaccurate,
Project
completereports of project relatively accurate, complete reports of project progress incomplete
management
progress. reports of project progress reports of
(PO11)
withonly mi nor errors or project
omissions progress
XI V - Extend Scope of Demonstratesa skillful Demonstrates an ability to Demonstrates some abilityto Demonstrates minimal or
Work: ability to explorea explore a explore a subject/topic, providing no ability to explore a
Ability to extend the subject/topic thoroughly, subject/topic, and shows some knowledge subject/topic,
Lifelong project through discusses the road map to possible areas in which project of areas in whichproject can be and does not discuss
Learni implementation other extend the project in other can be extended extended future work clearly
ng study areas areas. mentioning other areas
(PO12)

38
39

You might also like