Petals Count and Flower Image Classification using computer vision
1. Masters in Machine Learning
Attempt to find petals of flower
images and classify flowers using
Computer Vision
Indranil Datta
Liverpool John Moores University
4. Introduction
Flowers are very interesting subject for the inquisitive minds of botanists
Flowers attract general people due to its colour, shape, fragrance and petals
Flowers & its importance
Classification of flowers was historically a botanist’s job
Recently ML and AI eased the ways of flower classification
Classification of Flowers
Flower images may have similarities and dissimilarities of colour, shape, petals and
backgrounds
Complexity of Flower classification from images
Number of petals in a particular category of flower may differ.
Petal shapes are not always exactly the same for a particular category of flower.
Petal texture varies within the same flower class.
Complexity of petals count from a flower image
5. Introduction
Classification using machine learning techniques
Classification using deep learning methodologies
Recent trend in flower classification using flower images
Classification of flowers was historically a botanist’s job
Recently ML and AI eased the ways of flower classification
Classification of Flowers
Attempted petals count methods and procedures of categorization of flowers
summary
7. Feature System based on regions
Based on shape characteristics of flowers and
dividing flower image into many feature ring regions
and define their corresponding features. These
feature system is used to distinguish flowers.
Image segmentation and SVM
Based on average colour and variance
of colour distribution, image is
segmented. SVM model is used to train.
Based on local & spatial information
Flower classification is executed by using SVM
after extracting local and spatial information by
SIFT-like feature descriptors and feature context
method.
Identify Structural pattern
Structural pattern identified based on probabilistic
recursive model to categorize flower images.
Literature
Review
Flower classification
without using deep
learning techniques
8. Solving overfitting and local optima
By using transfer learning from CNN models like
VGG16, VGG19, Inceptionv3 and ResNet50 to
classify flower images which solves overfitting and
local optimization issues.
Two step approach
Segment the flower region from the
image and use a specialized CNN
model for categorizing the flowers from
the segmented images.
Retaining colour, shape and texture
Using transfer learning from Inception v3 model
colour, shape and texture of flowers from images
has been retained and that was used to recognize
flowers.
Hue based image segmentation
Hue based image segmentation process is applied
to segregate the flower from the image and later a
custom CNN is used to identify the flower.
Literature
Review
Flower classification
using deep learning
techniques
9. Using repeated building block in NN
ResNeXt model is created by repeating a building
block which accumulates the transformations with
the same topology. This was used to identify
flowers.
Pulling Colour and texture info
By pulling colour information using
normalized colour histogram and by
extracting texture information using gray
level co-occurrence matrix, flower
identification accuracy has been
increased when neural network is used.
Literature
Review
Flower classification
using deep learning
techniques
11. Problem Statements
In order to provide more
details about a flower,
will it be possible to
fetch petals count also
from machine learning
methodologies?
What about petals?
Flower regions from the
flower can be detected
by using previously
discussed techniques.
But can we identify
details about a
particular flower by
these methods?
Details of flower
Instead of extracting
features first and apply
the features to a CNN
model, can there be
single step flower
classification model?
Single Step Model
13. Aim & Objectives
In this research work, attempts need to be
conducted to find out number of petals from
the flower image by machine learning
techniques.
Find ways to count petals
Classification of flowers are also can be
tried by extracting features by transfer
learning from a deep learning model and
using that model predicted flower
descriptions need to be embedded by
LSTM model.
Embedding texts in flower image
Classification of flowers needs to be
attempted using a single deep learning
model.
Single Step Model
15. Methodology
Deep learning methods for predicting
flowers.
Calculation of petals count.
Methodology
Types
CONTENTS
Choice of flower dataset.
16. Calculation of petals count
K-Means Algorithm for
binary segmentation.
Apply K-Means on each of
the image. Take out Image
features from the cluster
centers and save as
masked images
Contents
1
Apply edge detection on
the masked images and
find specific regional area
for each petal.
Contents
1 (b)
Apply hue based image segmentation and find out
circular area belonging to the flower. Get the two
extreme ends of two opposite petals. Create a
triangle with the top points and the center of the
circle and find the area of the triangle. Divide
contour area by the triangle area to find petals
count.
Contents
2
Apply image thresholding
by Otsu’s method on
masked images and find
specific regional area for
each petal.
Contents
1 (a)
17. Flower Prediction
Train LSTM model with
the extracted features
from ResNet50 model
using oxford 102 flower
category images by
creating train and test
dataset by own process.
Contents
1
Train ResNet50 model with train and test image
dataset from the original categories and fine tune it
for overfitting
Contents
2
18. Choice of dataset
Train Test Validation dataset
Train, test and validation dataset
have been sorted beforehand.
These datasets have been used for
another approach of flower image
classification using only ResNet50
model.
Dataset for petals count (2)
Manually chosen flower images
from each category has been taken
for petals count after hue based
image segmentation is performed
on these images.
Oxford’s 102 dataset directly
Training and Test dataset have been
directly created from above dataset
by randomly peeking images from
each of the categories maintaining
80-20 rule programmatically. This
dataset is used for the approach
using transfer learning by ResNet50
model and LSTM model for final
prediction.
Dataset for petals count (1)
The above train-test dataset is used
which is prepared programmatically.
This dataset is used for K-Means
segmentation, thresholding and
edge detection methods.
20. Petals counts
Method 1
In this method a hue based image segmentation has been
performed before petals calculation is performed. The
above flower images (top left) are showing boundaries
found out by it. Correctly calculated categories of petals
are displayed in a table (top right). The metrics of total
matched, unmatched and uncountable categories of
flowers have been displayed on the left.
21. Petals counts
Method 2
In this method K-Means segmentation has been applied.
The masked images after this segmentation can be seen
above. The calculated petals count along with the
thresholded images can be seen on left.
22. Petals counts
Method 3
In this method after K-Means segmentation is applied, the
masked images have been sent through edge detection
and watershed transformation. After final transformation
the images can be seen above. The calculated petals
count along marker images can be seen on the left side.
23. Classification
Method 1
In this classification method ResNet50 model is used to
train the images from Train database as mentioned
previously. 256 epochs have been planned. But after 144
epochs check point triggered to stop the training. The
check point was triggered due to increase in validation
loss. The resulted model was further fine tuned by
providing SGD optimizer and learning rate 0.0001 and run
1 epoch that gave 90% validation accuracy.
24. Classification
Method 2
In this classification method ResNet50 model is used to
transfer learning from the programmatically created train
images. The feaures along with petals count info have
been sent to a LSTM model for final training. The resulted
LSTM model was sent to the test images for evaluating
the accuracy of the model which turns out to be around
75%.
26. Conclusion
01
02
03
ResNet 50 model has given 90% validation accuracy after fine
tuning with SGD removing adam optimizer. Also transfer learning by
ResNet50 and prediction by LSTM model gave 75% accuracy.
Performance of ResNet50 model
Calculation of petals from a flower image has obstacles to be perfect.
Orientation of image may have hide some of the petals.
Flower image has missing petals due to natural disturbances.
Petals count challenges
Only 16 out of 102 categories are correctly predicted through the hue based
segmentation and triangle area of a petal out of circular area of flowers calculation.
Method in which K-Means segmentation and thereafter thresholding or edge detection
applied could not fetch satisfactory petals count.
Petals count algorithms need more fine tuning
27. Future works
01
02
03
Deep masking for segmenting the petals by identifying individual
petal instances from a flower image remains another last but not
least work that can be taken up further .
Deep masking for instance segmentation
In the calculation of petals sepals cannot be separated from petals during the
execution of the function. This leaves a challenging note to differentiate between
petals from sepals.
Petals and sepals
The flower images chosen for this research work have not turned out to be the best for
calculating petals count. Some of the flower images have left challenges in finding their
boundaries properly.
Flower images need to be chosen carefully for petals count
28. Thank You
+91 9900580160
In case of any queries please contact
https://linkedin.com/in/indranildatta-profile
Indranil.datt@outlook.com