Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

CS299 - Innovative Lab Design

Plant Leaf Recognition


Varsha Tumburu (1901CS69)
Under Dr. Samrat Mondal

Spring Semester 2021


Why take time to classify leaves?
● From being an excellent mood booster to the primary source of consumption,
plants are ubiquitous and more than anything, essential for human life.
● From traditional times, the leaf has always been the primary method of
identifying a plant or tree.
● The traditional plant classification method is mainly realized by artificial
recognition, which has the disadvantages of being time-consuming, susceptible
to subjective judgment, and low recognition accuracy, far from meeting the
requirements for rapid and accurate plant identification.
● Therefore, the rapid and accurate identification of plants is very challenging
and meaningful.
This project aims to classify leaves
using traditional handcrafted features
Task Description and features extracted from pre-
trained deep CNNs. The input to our
system is raw images from a dataset
and the output is the label for each
species. By the end of the project, we
should be able to predict a plant
species by taking in a leaf image from
the user.
Overcoming Challenges
Leaf classification is considered a fine-
grained image recognition problem and hard
to solve due to the subtle differences
between species in the same class.
Sometimes, such fine differences can be
even challenging to human experts. Adding
on, this requires large training data per
class, but it is not feasible due to the
numerous species. Swedish Leaf Dataset
Dataset Hunting
The images you train your model on is so much more important than building the actual model. Here
are the various datasets I had to pick from:

● UCI’s 100 Leaf Dataset: Sixteen samples of each leaf of one-hundred plant species. This
consisted of a total of 1600 samples spanning over 100 classes.
● Swedish Leaf Dataset: Contains pictures of 15 species of leaves, with 75 images per species.
Images are clean with a white background, with very few variations of luminance.
● Flavia Leaf Dataset: Consists of clean images only, which is characterized with a well-aligned
leaf on a contrasting background, with little or no variations of luminance or colour. Around 33
species, each having around 60 samples for training.
● ImageCLEF Dataset: Noisy dataset with considerable variations on lighting conditions,
viewpoints, background clutters and even occlusions. The dataset can be further split into two
subsets: uniform (total of ~10,800 images over 66 species), which is taken in a more controlled
environment, and natural (total of ~3,100 images over 57 species), which is taken in a natural
environment.
Approach and Classifier Advantages Disadvantages

Training Artificial Neural Network


(ANN)
1. Capable of distinguishing complex
nonlinear relationships between
1. Great tendency of data overfitting.
2. Bigger computational load.
Methods independent and dependent variables.
2. Simplistic statistical training.
There is no single feature
extraction technique that
can be considered as the Convolutional Neural 1. Multiple features can be extracted 1. High computation level.
Network (CNN) simultaneously. 2. Incapable of generalization.
best method since different 2. Robust to noise.
problems require different
approaches and different
mechanisms.
CNN Training Flowchart
Data Augmentation ● Augmentation is used to change the
orientation and layout of a particular image,
thereby creating multiple different versions
of the same image.
● This trains the model to be more adjustable
to minor deviations, also helping us
expanding the dataset using pre-existing
images.
● I was able to make the dataset about 5x
larger. A dataset that previously had a total
of 1125 images, now had 6120 images,
meaning around 330 more images per
class.
Image Pre-Processing Pre-processing our data is just as
important as training our model.
The pre-processing step can consist Maintaining uniformity amongst the
of image reorientation, cropping, images ensures better training
grey scaling, binary thresholding, performance.
noise removal, contrast stretching,
threshold inversion, and edge Grayscale conversion of the image into
recognition. geometrical data is implemented to
optimize the contrast and intensity of
images. Later, the thresholding process
creates a binary image giving each
pixel an assigned value from 0 to 255
depending on its brightness.
Training
I started by developing the classifier from scratch, keeping the following
guidelines in mind:
● Convolutional layer learning ranges from general to specific;
giving it more layers helps with the transition to the latter.
● Dropout reduces overfitting.
● Use aggressive pooling to reduce the dimensionality.

This model has been designed based on the architecture beside. It has
shown a pretty good outcome for the Swedish Leaf Dataset, but we
cannot conclude the same for other datasets. A deeper ConvNet with
more aggressive filters is needed to extract the features more efficiently
and to deal with the noise and variation of other datasets.
Analysing Results
● 20% of our images from the dataset
are saved for validation.
● Our model brings us a validation
accuracy of 96.8% towards the end of
training of all the epochs.
● On observation, the graphs are not
completely monotonic and this can be
mainly related to the overfitting of
data.
● However, both graphs do recover and
we can see the validation loss
approaches an all-time low.
Shortcomings
We were able to propose an automatic plant species identification approach which is
employed machine learning techniques to classify plant leaf images. However, this
model too has its own setbacks:
● Based upon the smaller dataset that was utilised to create a
larger one
● Fails with images with multiple leaves since the model is
trained with only clean single leaf images.
● Although images with an unclean background are
inaccurately judged by the model proposed, applying a
customized mask does help improve the predictions.
● However, this mask works on the principle of filtering out
the green elements, which will not be helpful in the case of a
green background or in the presence of other leaves in the
background.
Working Model Screenshots

On feeding clean images On feeding noisy images


There will always be
drawbacks to any kind
of solution proposed. We
must try to seek
solutions that will
minimize problems and
prove to be suitable to
the real-world scenario.

Final Product
Future Scope
● Acquire more data and fine-tune
ConvNets to fight overfitting
problems.
● Engage advanced techniques for
image augmentation.
● Explore state-of-the-art methods to
detect and locate leaves from the
background. This should allow
ConvNet to focus on the essential
features.
● Expand the dataset and improve the
model to improve predictions on
noisy images as well.

You might also like