Plant Specification Using Deep Learning
Plant Specification Using Deep Learning
BY
Himanshu Gupta (2001640130022)
Vishal Singh (2001640130048)
Submitted to the
Department of Information Technology
DECLARATION…………………………………………………………… i
CERTIFICATE……………………………………………………………...ii
ACKNOWLEDGEMENT…………………………………………………iii
ABSTRACT
CHAPTER 1:
INTRODUCTION…………………………………………………………1
1.1 Prior Work
1.2 Problem definition
1.3 Project overview/Specification
1.4 Hardware Specification
1.5 Related Work
1.6 Method
CHAPTER 5: IMPLEMENTATION……………………………………….
5.1 Algorithm and pseudocode
5.2 Code
5.3 Snapshots
REFERENCES………………………………………………………………….
DECLARATION
We hereby declare that the project entitled : Plant Specification using Deep
Learning submitted for the B. Tech. (IT) degree is our original work and the
project has not formed the basis for the award of any other degree , diploma ,
fellowship or any other similar titles. The best of our knowledge and belief, it
contains no material previously published or written by any other person nor
material which to a substantial extent has been accepted for the award of any
other degree or diploma of the university or other institute of higher learning
except where due acknowledgement has been made in the text.
Signature:
Name :
Roll No:
Date :
Signature:
Name :
Roll No:
Date :
CERTIFICATE
This is to certify that the project titled “Plant Specification Using Deep
Learning” is the bonafide work carried out by .
Himanshu Gupta(2001640130022)
Vishal Singh(2001640130048)
In partial fulfilment of the requirements for the award of the degree of Bachelor
of Technology (Information Technology) student of B. Tech (IT) of Pranveer
Singh Institute of Technology, Kanpur affiliated to Dr. A.P.J. Abdul Kalam
Technical University, Lucknow, Uttar Pradesh(India) during the academic year
2022-23, and that the project has not been formed on the basis for the award
previously of any other degree, diploma, fellowship or any other similar title.
Project supervisisor
Department of Information Technology
Date: Pranveer Singh Institute of Technology, Kanpur
ACKNOWLEDGEMENT
We would like to express our gratitude towards our project mentor, Himanshu
Kr, Dwiedi, Associate Professor , Department of Information Technology,
without whose guidance and support this work would not have been possible.
We would also like to thank Mr. Piyush Bhushan, Head of Department,
Information Technology. For always motivating us to take up challenging and
interesting projects that develop our knowledge in new domains
Lastly, we would like to thank our parents, family and friends for keeping us
motivated in all our life‘s
Endeavour‘s.
Signature:
Name:
Roll No:
Date:
Signature:
Name:
Roll No:
Date:
ABSTRACT
Plant specification is a critical aspect of agriculture and environmental
monitoring, encompassing the identification and characterization of various
plant species. This project explores the application of deep learning techniques
in the field of plant specification, aiming to enhance accuracy and efficiency in
plant recognition and classification. Leveraging a comprehensive dataset of
plant images, a deep learning model is developed to automatically identify and
categorize different plant species.
The results of the analysis demonstrate the efficacy of the deep learning model
in accurately classifying plant species, even in complex environments and
diverse ecosystems. The discussion section addresses the implications of these
findings in agriculture, biodiversity monitoring, and ecological research.
Limitations and challenges are acknowledged, providing insights for future
research directions.
5. Comparative Studies:
- Comparative studies such as [Reference 7] have evaluated the
performance of traditional methods versus machine learning
approaches in plant species identification. These studies contribute
valuable insights into the strengths and limitations of different
methodologies, providing a foundation for the comparative
analysis within this project.
1.6 METHODOLOGY
1. Dataset Acquisition:
- Objective:Collect diverse and extensive datasets representing
various plant species, growth stages, and environmental conditions.
- Actions:
- Source high-quality images from botanical databases,
research institutions, and ecological studies.
- Ensure the dataset covers a wide range of plant morphologies
and variations.
2. Data Preprocessing:
- Objective:Prepare the dataset for training by addressing issues
such as noise, variations in lighting, and image quality.
- Actions:
- Resize and standardize images to a consistent format.
- Apply image augmentation techniques to increase dataset
diversity.
- Remove irrelevant information and artifacts.
4. Model Training:
- Objective: Train the deep learning model using the
preprocessed dataset to learn plant features.
- Actions:
- Split the dataset into training and validation sets.
- Utilize transfer learning or train the model from scratch based
on dataset size.
- Fine-tune hyperparameters to optimize model performance.
5. Evaluation Metrics:
- Objective: Assess the model's accuracy, precision, recall, and
F1 score to ensure robust performance.
- Actions:
- Employ metrics to evaluate the model's ability to correctly
identify plant species.
- Validate the model on a separate test dataset to gauge
generalization.
LITERATURE SURVEY
3.1 OVERVIEW
We propose an innovative approach to plant species identification
leveraging advanced deep learning techniques. Our system is
designed to revolutionize the conventional methods of plant
specification, offering a solution that is both accurate and scalable.
Key elements of our project include:
The paper carefully curates a dataset that reflects the variability of plant
species in the wild, including diverse ecosystems, lighting conditions, and
weather scenarios.
Real-world challenges such as occlusions, varying viewpoints, and inter-
species similarities are integrated into the dataset to ensure a rigorous
evaluation.
Motivation:
Challenge Design:
The dataset focused on 997 species mainly from the Guiana Shield and
the Northern Amazon rainforest, boasting exceptional plant diversity.
It included:
321,270 herbarium sheets: Mostly digitized via the e-ReColNat2 project,
with around 12% from French Guyana.
7,993 field photos: To bridge the gap between herbarium specimens and
real-world images.
Evaluation:
Analysis of Results:
Conclusion:
Additional Points:
The paper also delves into the dataset details, the participating systems
and their approaches, and provides a more nuanced analysis of the results.
7. Plant Recognition Using Morphological Feature Extraction and
Transfer Learning over SVM and AdaBoost By:
ShubhamMahajan 1,*, Akshay Raina 2 , Xiao-Zhi Gao 3 and
Amit Kant Pandit
Key Aspects:
Contributions:
The paper utilizes specific algorithms like Hu's moments and Freeman chain
code to extract shape-based features like area, perimeter, eccentricity, and
compactness.
Texture features like smoothness and roughness might be explored for future
enhancement.
Transfer Learning:
The study investigates the use of VGG16 and ResNet-50 as pre-trained CNNs
for feature extraction.
Different layers of these networks are explored to find the optimal level of
abstraction for plant recognition.
Fine-tuning the pre-trained models on the plant image dataset could further
improve performance.
AdaBoost and SVM Combination:
The study paves the way for exploring other feature types like leaf venation
patterns and color information.
Investigating different pre-trained CNN architectures and fine-tuning strategies
could potentially lead to higher accuracy.
Applying this approach to larger and more diverse datasets would test its
generalizability and robustness.
Data Availability:
- Assessment: Evaluate the availability and accessibility of diverse and
comprehensive plant image datasets. Ensure that the datasets cover a
wide range of species, growth stages, and environmental conditions.
- Outcome: If suitable datasets are readily available, technical feasibility
is high. Otherwise, efforts may be required for data collection and
curation.
Technology Infrastructure:
- Assessment: Examine the existing technology infrastructure, including
computational resources and software tools, to determine compatibility
with deep learning model requirements.
- Outcome: Technical feasibility depends on the adequacy of the current
infrastructure. Upgrades or modifications may be necessary.
Model Complexity:
- Assessment: Consider the complexity of deep learning models required
for accurate plant specification. Assess the availability of pre-trained
models and the need for custom architectures.
- Outcome: Technical feasibility hinges on the availability of suitable
pre-trained models and the capability to develop or fine-tune models for
plant identification.
2. Economic Feasibility:
Operational Costs:
- Assessment: Anticipate ongoing operational costs, including
maintenance, personnel training, and potential costs associated with
model updates.
- Outcome: Economic feasibility relies on the sustainability of
operational costs within the allocated budget.
3. Operational Feasibility:
Phased Implementation:
Our target is to build a model that can identify and provide relevant
knowledge about the given plant image based on the features of its
leaf image shape of image etc. This model will provide as a
backend service provider for our frontend UI application which
will directly interact with normal user and provide the input cases
to model for making evaluation and predictions.
Functional Requirements
Technical Requirements
. Testing Requirements
Success Criteria
If image has
extension as Stop
jpeg/jpg/png
If image is
predicted Show
unknown Eror
Show Predictions
4.3Software Specification
4.3.1 Web Application
A web application is made to act as a GUI for the prediction and
interaction with model process. The application simulates the
original design. It generates a user-friendly interface for the model
prediction. The application firstly takes the input via some
uploader function made by inbuilt python functions, then the
provided image is pre-processed using some image processing
techniques such as Augmentation, scaling , cropping and height
and noise removal. The major function for a pre-processing
pipeline is to normalize the input image into some proper scaling
formats that are compatible to model structure.
4.3.2 PROTOTYPE
The Prototype consist of two parts, each built to simulate how
predictions are made by our model. Out of these two parts one part
presents the GUI and other while represents the back-end part
which show the functioning of the pre-trained model that makes
prediction over the provided data by user.
4.3.3 TOOLS
In order to perform model training and testing Google Colab has
been extensively used with Google Backend Compute Engine that
provided the T4 GPU support which enhances the model training
and also reduces the training time.
Google Colab, in short, is a free cloud platform that lets you write and
run Python code in your browser. It's like having a powerful Jupyter
notebook on the web, with access to Google's computing resources
including GPUs and TPUs. It's popular for:
Pre-Identification:
1. Download the app: Users download the Plant Identification app from a
trusted app store or website.
2. Device permissions: Grant the app permission to access your camera or
device storage for uploading leaf images.
3. (Optional) Account creation: Users can optionally create an account for
personalized experiences and data storage (e.g., saved identifications).
Identification Stage:
Post-Identification:
1. Result Display: The app displays the predicted plant species prominently
with the associated confidence score.
2. Additional Information: (Optional) Provide users with access to additional
information about the identified plant, such as:
o Scientific name
o Family or genus
o Habitat and ecological significance
o Interesting facts or uses
o Links to external resources for further exploration
CHAPTER – V
IMPLEMENTATION
5. IMPLEMENTATION
5.1ALGORITHM & PSEUDOCODE
User
Plant
Identification App
Front-End Unit
Back-End Deep
Learning Model
Audit Result
Show Predictions
MobileNet
In the domain of deep learning for image recognition, MobileNet stands out as a
paradigm shift. While traditional models employ extensive convolution layers
for meticulous pixel-level analysis, MobileNet adopts a more parsimonious
approach, prioritizing efficiency and speed, particularly on resource-constrained
platforms like mobile devices.
Imagine analyzing an image for both its color and shape simultaneously.
Traditional convolutions do this in one step, requiring many intricate
calculations. MobileNet separates these tasks:
2. Bottleneck Layers:
Think of these as checkpoints for information flow. They "squeeze" the data
through thin layers before expanding it again. This helps:
3. Linear Bottlenecks:
A special type of bottleneck layer where the expansion and contraction happen
using simple 1x1 convolutions. These further decrease computational cost
without sacrificing performance.
Instead of using fully connected layers at the end, MobileNet replaces them
with global average pooling. This averages the information from all spatial
locations in the feature maps, summarizing the crucial features effectively.
The main job done by this code snippet is to increase the size of our dataset by
using cv2 features provided by python, This makes an image crop and apply
various filters to it based on variation defined inside it , also same work can be
done with the help of python pre provided API known as ImageDataGenerator
that provides a more easy and convienent way to do same which id defined
under the Keras tensorflow module.
Figure 5.4 : Backend Transfer Learning Model
Note : Figure 5.4 & 5.5 shows import and loading dataset from mounted drive in colab
Figure 5.7 : showing import of required libraries for model architecture creation and
also for various further process
Figure 5.8 : Version 6.0 of our model which was AlexNet model Defined using proper
customization
Figure 5.9 : defining all the variables and pipeline for our train set of dataset
Figure 6.0: finding out all classes that are present in our dataset
Figure 6.1 :: Code Section showing implementation of MobileNetV2 Model, this also
shows the customizations that have been applied
Figure 6.3 :: this responds to the model training Phase, The model has been trained on
25 Epochs cycle with each epoch haing a batch_size of 32
Figure 7.1:: Heat Map for classification report against all validation set
Figure 7.2 :: Code to plot relation-ship curve between Validation and Train Accuracy
Figure 7.3 :: Plot between Train and Validation Accuracay against each Epochs
Figure 7.4:: Plot for Model’s Loss Function during training and validation phase
against each Epoch Cycle
CHAPTER – VI
TESTING
6.1 INTRODUCTION
The testing stage encompasses several goals, including affirming the project
quality, detecting and resolving any remaining errors from prior stages,
validating the software as a solution to the original problem, and establishing
operational reliability of the system. During testing, efforts are focused on
examining and modifying the source code. Various test cases are executed to
evaluate the software behavior. Each test case is described, and the
corresponding steps to be followed, expected results, current status, and
accompanying screenshots are provided. Testing is a crucial process that aids in
identifying and rectifying defects, enhancing the overall quality of the product,
and ensuring its adherence to desired specifications. By meticulously executing
the defined test cases and meticulously analyzing the outcomes, potential issues
can be unearthed and mitigated, thereby bolstering the software performance
and reliability.
In the world today, technology is used to create several machines and make life
easier. The software could have multiple bugs and might not be working as it is
intended to. Hence testing is required to control and make sure that the software
is error-free. It identifies all the defects that the software and makes sure the
software is meeting the required specifications. Testing is also very cost-
effective. It prevents failure from occurring in the future. It will also be cheaper
to fix the bugs when it is in anearlier stage. It also improves the quality of the
products after it is tested. This project uses streamlit as the testing framework
to unit test and integration test all of our test cases for the application.
(i) Unit Testing: This is the first and the most important level of testing. Its
need begins from the moment a programmer develops a unit of code. Every unit
is tested for various scenarios. Detecting and fixing bugs during early stages of
the Software Lifecycle helps reduce costly fixes later on. It is much more
economical to find and eliminate the bugs during early stages of application
building process. Hence, Unit Testing is the most important of all the testing
levels. As the software project progresses ahead it becomes more and more
costly to find and fix the bugs. Steps for Unit Testing are:-
Step 1: Creation of a Test Plan
Step 2: Creation of Test Cases and the Test Data
Step 3: Creation of scripts to run the test cases wherever applicable
Step 4: Execution of the test cases, once the code is ready
Step 5: Fixing of the bugs if present and re testing of the code
Step 6: Repetition of the test cycle until the Unit is free from all types of
bugs.
(ii) Integration Testing: Integration strategy stands for how individual modules
will be combined during Integration testing. The individual modules can be
combined in one go, or they can be joined one by one. A decision on how to put
the pieces together is called the Integration Strategy. We have used bottom-up
integration approach to integrate test our application.
6.2 TESTING ANALYSIS
Key Advantages:
Speed and Accuracy: The transfer learning approach combines speed and
accuracy, enabling users to identify plants with confidence in real-time.
Continuous Improvement: The model can be further enhanced through
ongoing training with additional plant images, ensuring its adaptability to new
species and environments.
Mobile-Friendly: The app's design ensures smooth performance on mobile
devices, making it accessible to users on the go.
Privacy Considerations:
Local Processing: To protect user privacy, the app performs identifications
entirely on the user's device, eliminating the need to transfer personal data to
external servers.
No User Data Collection: The app does not store or collect any user data,
ensuring that identification queries remain private and anonymous.
Focus on User Experience:
Intuitive Interface: The app features a user-friendly interface that guides users
through the identification process seamlessly.
Informative Results: Identification results are presented clearly and concisely,
providing essential information about the identified plant species.
By combining transfer learning with a privacy-centric approach, this plant
identification app empowers users to quickly and accurately identify plants
while safeguarding their personal information.
6.3 OUTPUTS
This screen is shown to user when model predicts the class for given image
using loader , firstly the obtained image from file_loader() function is
preprocessed using numpy and then it is feeded to .h5 fixed weight model saved
file, This file on given test case generates a array containing votes for each
label.
Then by using np.arg(max()) function the output is decided with high
confidence and accuracy value.
CHAPTER VII
1. Performance:
2. Key Findings:
[7] P.HeandL.Huang,“Featureextractionandrecognitionofplant
leaf,” JournalofAgriculturalMechanizationResearch,vol.6,p.
52, 2008.
[8] G. Cerutti, L. Tougne, J. Mille, A. Vacavant, and D. Coquin,
“Understanding leaves in natural images- a model-based
approach for tree species identification,” Computer Vision and
Image Understanding,vol.117,no.10,pp.1482–1501,2013.
[9] N. Liu and J.-M. Kan, “Plant leaf identification based on the
multi-feature fusion and deep belief networks method,” Journal
of Beijing Forestry University,vol.38,no.3,pp.110–119,2016.
[15] https://www.microsoft.com/en-us/research/project/flowerre
co/.