0% found this document useful (0 votes)
105 views5 pages

Flower Classification Using CNN and Transfer

The document discusses flower classification using convolutional neural networks (CNNs) and transfer learning in CNNs from an agricultural perspective. It proposes a prototype CNN model architecture and examines transfer learning approaches using VGG16, MobileNet2, and ResNet50 architectures on a publicly available flower dataset. Flower classification has many applications in fields like agriculture, but it is a difficult task due to similarities between flowers and variations in images from natural environments. Deep learning methods like CNNs have achieved good accuracy on computer vision tasks and have been applied to problems in areas such as robotics, language processing, and more.

Uploaded by

Nagaraj Lutimath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views5 pages

Flower Classification Using CNN and Transfer

The document discusses flower classification using convolutional neural networks (CNNs) and transfer learning in CNNs from an agricultural perspective. It proposes a prototype CNN model architecture and examines transfer learning approaches using VGG16, MobileNet2, and ResNet50 architectures on a publicly available flower dataset. Flower classification has many applications in fields like agriculture, but it is a difficult task due to similarities between flowers and variations in images from natural environments. Deep learning methods like CNNs have achieved good accuracy on computer vision tasks and have been applied to problems in areas such as robotics, language processing, and more.

Uploaded by

Nagaraj Lutimath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Proceedings of the Third International Conference on Intelligent Sustainable Systems [ICISS 2020]

IEEE Xplore Part Number: CFP20M19-ART; ISBN: 978-1-7281-7089-3

Flower classification using CNN and transfer


learning in CNN- Agriculture Perspective
Ms.Chhaya Narvekar Dr.Madhuri Rao
Department Of Information Technology Department of Information Technology
2020 3rd International Conference on Intelligent Sustainable Systems (ICISS) | 978-1-7281-7089-3/20/$31.00 ©2020 IEEE | DOI: 10.1109/ICISS49785.2020.9316030

Xavier Institute of Engineering TSEC, Bandra.


Mumbai, India Mumbai, India
[email protected] [email protected]

Abstract-- Classification of flowers is a difficult task because of similarity and intra class variation [21][14]. Background,
the huge number of flowering plant species, which are similar in variation in illu mination, occlusion, and images taken in a
shape, color and appearance. A flower classification can be used natural environ ment are the factors that affect accuracy. Deep
in various applications such as field monitoring, plant learning, especially CNN recently gained wide interest
identification, medicinal plant, floriculture industry, research in because of good accuracy in many co mputer vision tasks
plant taxonomy. In this study, the authors have demonstrated
[18,19,25] , for instance detection of object area, object
and analyzed the recent developments in deep learning methods
such as CNN and transfer learning in CNN. Prototype CNN recognition, classification and many more. Plant identification
model architecture proposed and transfer learning approach as is an interdisciplinary task in botanical taxonomy [6]. Over the
well examined on VGG16, MobileNet2 and Resnet50 architecture last few years Deep Learn ing has been applied to a variety of
for flower classification on publicly available flower dataset. problems such as robotic vision, face recognition, voice
generation, natural language processing and many mo re. In
Keywords—Deep Learning, CNN, MobileNet, VGG, ResNet, many cases Deep Learning showed extremely good results [3]
transfer Learning. [21]. Deep Learn ing is also experimented by academicians to
study intelligence and in the various businesses to build
I. INT RODUCT ION
automated systems to help humans in various tasks, such as
IOT based solutions for auto mation in agriculture,
Flower is the most prosperous creature on the planet. There pharmaceutical, e -co mmerce, social media, newspaper and so
exists about 369000 species of flowering plants in the world on.
[1] [21].Flo wers are one of the important species around us.
They can feed insects, birds, animals and humans. They are A. Flower classification in agriculture
also used as medicines for humans as well as animals. A good Flower classification applications exclusively in agricu lture
understanding of flowers is essential to help in identifying new itself are many. Co mmercial Floriculture is fast emerging and
or rare species when came across [7,12,23]. Experts in plant recognized as the most remunerative profession with potential
taxono my identify p lants according to its flower[1,11]. This for good returns per unit area[23][25][27]. Flower farming is
needs expert ise in a specific do main which very few people an age old concept in India and one that has immense demand
have so automated recognition helps common non experts. and potential. Flo wers are symbols of beauty all over the
Flower classification is important due to its applicability in world, and flower giving is one among the most popular
different domains such as computer vision, precision customs during festivals, celebrations, official functions as a
agriculture, botanical research, plant monitoring , ayurvedic token of love and care. Generally, crops are defined as
medicine ,and CBIR[12][23][27]. a plant or plant product that can be grown and harvested
extensively for profit or survival. Crops are broadly
Flower farming is an age-old farming activity in India having
categorized into these classes : food crops, consumption as
huge demand and potential for generating a good amount of
food for human, feed crops for cattle or animal consumption ,
emp loyment opportunities and entrepreneurship in both rural fiber crops for clothing and textiles, o il crops for consumption
and urban areas. In recent years it has emerged as a pro fitable
as edible oil or industrial uses, ornamental crops -used for
agricultural business in India. Information technology based landscape garden , and industrial crops for various industrial
automation in agriculture, s mart field management and
uses . In our country flowers are considered ext remely
mach ine vision based precision agriculture activit ies needs
important in so many ways. The climatic conditions in India
detailed in formation about the farm , environ ment condition
are conducive to produce most varieties of flowers. One
and the phenotype of individual plants[7]. Flo wer
important aspect from an agriculture perspective is flo wers
classification looks appealing in its usefulness but there are can be grown throughout the year. They are used as
limitat ions in realizat ion, due to constraints like inter class

978-1-7281-7089-3/20/$31.00 ©2020 IEEE 660

Authorized licensed use limited to: Konya Teknik Universitesi. Downloaded on May 18,2021 at 22:33:24 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Intelligent Sustainable Systems [ICISS 2020]
IEEE Xplore Part Number: CFP20M19-ART; ISBN: 978-1-7281-7089-3

ornamental decoration, used for religious festivals, computer vision based classification would help non experts.
celebrations, weddings, as offering to God in temples and so Authors in [13] developed a visual vocabulary making use of
on. As the demand is severe ,this industry will never go out of color, texture and shape that distinguish one flower fro m
style in Ind ia and has great potential to provide livelihood to another. In [14] the author came up with an algorith m for
millions. Cut flowers are in b ig demand and there is a lot of automatically segmenting flowers. In 2008, [15] co mputed
potential for cut flower p roduction and development. IT based four different features for the flo wers and combined the
farm management capable o f identify ing , analy zing, and features using a multip le kernel framework with a SVM
managing temporal and spatial variab ility within fields for classifier, the accuracy on Oxford-102 flower dataset got 88 %
optimu m productivity. Availability of data leads to more . Histogram of o riented Grad ient[8,9], SIFT[14], KNN is also
automatic, precise, cheap agricultural solutions. Availability of used for classification [17], Deep learn ing used for plant
a wide range of sensors to capture image and machine vision identification[7], CNN[4,6,13,14,18,19,20,21,22,23,26], and
with machine learn ing are pro mising technologies to capture transfer learning is used for classification of flower[25,26].
such informat ion and further process it to be able to realize
autonomous farming[4][5]. Flower in any crop in the field is
the strongest indicator fo r the y ield estimation. In fruit , III. TECHNIQUES USED
vegetable and flower farming , the recent adoption of mach ine A. Convolutional Neural Network
vision allows farmers to categorize p roducts based on quality
Deep Learning is a subset of Machine Learn ing that relies on
grading and safety with automated systems which make use of
features that are automatically ext racted by feeding in the
features such as color, shape, size. Accurate quality
training data. State-of-art performance is attained by
classification is one of the important requirements of the
Convolutional Neural Networks. CNNs have fulfilled the need
flower market as it will help producers and consumers in
of robustness and have removed the dependency of hand
setting up better agreement fo r proper pricing [23]. This will
crafted features[20]. A Convolutional Neural Network (CNN)
lead to automated sale and purchase of flo wers. Quality and
is a deep learning algorith m that can recognize and classify
quantity of on plant flowers is d irectly related with y ield in all
images for computer vision [5][2][6][19][20][26]. CNN
types of crop like vegetable, fruits, grain etc. Use of modern
designed to analyze visual inputs and perform tasks such as
technology in the floriculture industry is the area of future
image classification [7], image recognition and object
research[25]. Automat ic and accurate flower recognition and
detection, which are useful in various places such as automatic
classification defin itely plays an important role in precision
vehicle driving, robots in intelligent farms. It uses weights and
agriculture . Fig.1. shows four steps proposed framework for
biases to ext ract various features fro m the images. It is capable
agricultural classifier for different applications such as grading
of learning very simp le features such as brightness and edges,
fruits, flower or recognition. First step is very important as
corners, as well as learn co mplex features such as texture that
huge amount of labeled data is required for train ing CNN
uniquely define the object as the layers progress. Ult imately
models which needs expertise. Then normalizat ion and
these features learned by the Neural Net work helps it to
preprocessing of data. Third step is select particular CNN
classify images. The h idden features present in the images
architecture and lastly train and test the model. Sect ion IV
cannot be detected with p lain DNN. While feeding an image
discusses on imp lementing prototype model and transfer
as an input to a DNN and further it is required to flatten the
learning on Kaggle flower dataset which can be replaced with
pixels. This result in the change in position of the pixels fro m
actual dataset from actual field.
the original position and the prediction of classes would have
impact when it co mes to comp licated images having pixel
dependencies throughout. CNN can capture spatial and
temporal dependencies in an image by using appropriate size
filters. CNN is capable of automatically learning mult iple
stages of invariant features for specific tasks. Nu mber of
layers in the network are based on the complexity of problem
and accuracy required [3].
A CNN may perform different rounds of convolution and
Fig. 1. Proposed Framework for Agricultural pooling. To end with when the features are at the right level of
granularity, it creates a fully -connected neural network that
II. RELAT ED WORK analyzes the final probabilities and makes a decision of which
class the test image belongs to .
Flower recognition is a research area in botany, ayurveda,
B. Transfer Learning
floriculture and it's more interesting because of its
applicability over a wide range. Carl Linnaeus invented a level Transfer Learning- It is quoted these days to use pre-trained
hierarchical plant classificat ion system in the 18th century convolutional neural networks like A lexNet, LeNet-5, VGG-
which is used world wide, it can recognize 369000 species. 16, VGG-19, Mobilenet,Inception [25,26]. This is done so that
Flower classification needs expert do main knowledge so knowledge gained by the pre trained networks can be used to
further transfer and train a model for a new classification task

978-1-7281-7089-3/20/$31.00 ©2020 IEEE 661

Authorized licensed use limited to: Konya Teknik Universitesi. Downloaded on May 18,2021 at 22:33:24 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Intelligent Sustainable Systems [ICISS 2020]
IEEE Xplore Part Number: CFP20M19-ART; ISBN: 978-1-7281-7089-3

with less computation time where the labeled training data


available is quite less[5][6].The reason why transfer learning
is possible is because the initial layers in the CNN architecture
tend to learn very simp le features such as edge , brightness
and corner and so on and the deeper layers of the architecture
learn the more relevant and low level features which are
useful. Hence, when you train your pre-trained neural
network, you fine tune just the basic features and the more
relevant features remain the same. The ability of learning fro m
a large nu mber of instances, and transferring knowledge into
different environmental situations is transfer learning [25].
The transfer learning is often used for transferring knowledge
across various tasks, rather than generalizing within a specific
task. Deep learn ing techniques are called data hungry as it
needs huge amounts of data in order to learn the millions of
parameters in a neural network. For transferring knowledge
fro m one task to another it should be appropriate. But how to
define appropriateness in this context is very difficult, only
experimentation is essential. In this paper few pre-trained
CNN models are examined with Keras API. Fig. 3.1 T raining Accuracy

IV. PROPOSED ARCHIT ECT URE AND RESULT S


A. Proposed CNN Model Architecture –
B. Model is trained and tested on Kaggle flo wer dataset. Fig. 3.2 T esting Accuracy
Model architecture is as shown in the Fig. 2. Input is 224X224
images, the model consists of four convolution layers with
filter 32,64,96,96 respectively and different kernels and
activation function used is Relu. In all pooling layers max
pooling is used. Then flattening layer, dense layer with 512
and final output layer is with five classes with soft -max
activation. Libraries used utils ,tensorflow ,nu mpy matplotlib
and sklearn. Dataset size is 4323 images splited into training
3890 and testing 433. Nu mber of epoch are 10. Fig. 3.1 shows
traning accuracy 95% and Fig.3.2 shows testing accuracy
91%. Fig.3.3 gives predicted labels for test images.

Fig. 3.3 Predicted Label

C. Transfer Learning based experiment-


D. First step is creating HDF5 file o f the entire dataset.
Then
using this HDF5 dataset, and training, validation, test are
generated. Total number o f images: 4323, fro m Kaggle.
Train Images: 2766
Val Images: 692
Test Images: 865
Epochs: 25.
Tools used are keras, utils , numpy and h5py.
Trained the following models via Transfer Learn ing, with the
Fig.2. CNN Model Architecture pre-trained weights of ImageNet dataset for all the models and
then added MAXPOOL - DENSE - DENSE layers at the end .

978-1-7281-7089-3/20/$31.00 ©2020 IEEE 662

Authorized licensed use limited to: Konya Teknik Universitesi. Downloaded on May 18,2021 at 22:33:24 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Intelligent Sustainable Systems [ICISS 2020]
IEEE Xplore Part Number: CFP20M19-ART; ISBN: 978-1-7281-7089-3

Fig.4 to Fig. 6 shows the training plots of these three models


. All results are summarized in Table-1. Results shows that
T ABLE- 1 RESULT SUMMARY
Mobilenet is not accurate enough to be used in real
Sr. Model Validation Testing
application. Mobile based automatic plant identification is
no. Accuracy Accuracy
necessary in day to day life for many purposes. The purpose of
1 Proposed CNN 95% 91%
testing with Mobilenet model is to check the feasibility in size
Framework
and to deploy on mobile devices or microcontrollers like
2 Transfer learning 95.39 89.35%
Raspberry pi so that it can be incorporated in embedded and
smart IOT based feasible and economical solutions in VGG16
agriculture as well as biodiversity mon itoring co mmunity. 3 Transfer learning 97.07% 92.12%
Any common nature observer as well can take the advantage Resnet50
of this technology advancement . 4 Transfer learning 91.88% 71.75%
MobileNetV2

V. CONCLUSION

A deep learning based method along with transfer learning


presented here to classify flower images. Fro m this experiment
what is observed is AI, Machine learn ing techniques has
potential to benefit agriculture industry greatly with
automation, it can be us ed in marketing agricu ltural product,
flower are fo rever in demand as a second source of income
farmer can go for flower farming as Indian climate is suitable
and crop can be taken at any time of the year it is not seasonal
that is great advantage. Smartphone’s are easily availab le even
Fig.4. T raining and testing loss- Accuracy VGG16
with farmer researchers who can exp lore further to develop
small size lightweight models in different applications such as
object recognition, classification, object counting, weed
management, pred ictions and so on in precis ion agriculture.
Flower is one of the indicators used in precision agriculture
for yield estimation, the number of flowers on a plant is
directly related to the yield.

VI. A CKNOWLEDGMENT

I would like to thank Xavier Institute Of Engineering for


organizing a workshop on “Experiment Design and
Optimization of Research in Machine Learning”.

REFERENCES
Fig.5. T raining and Validation Loss-accuracy MobileNetV2

[1] Madirakshi Das, R. Manmatha, and Edward M. Rireman,


“Indexing Flower” using domain knowledge, University of
Massachusetts,Intelligent Information Retrieval-1999.
[2] Andrew G. Howard Menglong Zhu Bo Chen Dmitry
Kalenichenko, “MobileNets: Efficient Convolutional Neural Networks for
MobileVision Applications,”
[3] Siddhesh Shinde, Tanmey Saraiya, Jayesh Jain, Chhaya
Narvekar,” Automatic Data Collection from Forms using Optical Character
Recognition” International Research Journal of Engineering and Technology
(IRJET ) e-ISSN: 2395-0056 Volume: 06 Issue: 10 | Oct 2019.
[4] Karen Simonyan & Andrew Zisserman, “VERY DEEP
CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE
RECOGNIT ION” Published as a conference paper at ICLR 2015.
[5] Sebastian Haug and J¨orn Ostermann,” A Crop/Weed Field Image
Dataset for the Evaluation of Computer Vision Based Precision Agriculture
T asks” CVPPP-2014.
Fig.6. T raining and testing loss- Accuracy ResNet50

978-1-7281-7089-3/20/$31.00 ©2020 IEEE 663

Authorized licensed use limited to: Konya Teknik Universitesi. Downloaded on May 18,2021 at 22:33:24 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Intelligent Sustainable Systems [ICISS 2020]
IEEE Xplore Part Number: CFP20M19-ART; ISBN: 978-1-7281-7089-3

[6] Lloyd Windrim, Arman Melkumyan, Richard J. Murphy, Anna [17] Simonyan, K., Zisserman, A.: ‘Very deep convolutional networks
Chlingaryan, and Rishi Ramakrishnan,” PreTraining for Hyperspectral for large- scale image recognition’. Proc. Int. Conf. Learning Representations,
Convolutional Neural Network Classification”,IEEE transactions-2018. San Diego, CA, May 2015, arXiv preprint arXiv:1409.1556
[7] YuSun,YuanLiu,GuanWang,andHaiyanZhang,” Deep Learning for [18] He, K., Zhang, X., Ren, S., et al.: ‘Deep residual learning for
Plant Identification in Natural Environment”, Hindawi Computational image recognition’. Proc. IEEE Conf. Computer Vision and Pattern
Intelligence and Neuroscience Volume 2017, Article ID 7361042, 6 pages Recognition, Las Vegas, NV, June 2016, pp. 770–778.
https://doi.org/10.1155/2017/7361042. [19] Szegedy, C., Liu, W., Jia, Y., et al.: ‘Going deeper with
[8] P. Felzenszwalb, D. McAllester, D. Ramaman, “A discriminatively convolutions’. Proc. IEEE Conf. Computer Vision and Pattern Recognition,
trained, multiscale, deformable part model”, Proceedings of the IEEE CVPR Boston, MA, June 2015, pp. 1–9
2008. [20] Ayesha Gurnani,Viraj Mavani, Vandit Gajjar,Yash Khandhediya.
[9] Navneet Dalal and Bill Triggs, “Histograms of oriented gradients “Flower Categorization using Deep Convolutional Neural Networks”
for human detection”, Proceedings of the IEEE CVPR 2005. [21] Yuanyuan liu,Fan T ang,Dengven Zhou,Yiping Meng,Weiming
[10] DG Lowe, “ Distinctive image features from scale-invariant Dong “Flower Classification via Convolutional Neural Network”, IEEE
keypoints”, International Journal of Computer Vision, 2004. International Conference on Functional Structural plant growth modeling
[11] Seeland M, Rzanny M, Alaqraa N, Wäldchen J, Mäder P, “Plant simulation, visualization and applications 2016.
species classification using flower images—A comparative study of local [22] V. M. Abdul Hakkim, E. Abhilash Joseph1 , A. J. Ajay Gokul2 ,
feature representations”. doi:10.1371/journal.pone.0170629 K. Mufeedha1 “Precision Farming: T he Future of Indian Agriculture” Journal
[12] Hazem Hiary, Heba Saadeh, Maha Saadeh, Mohammad of Applied Biology & Biotechnology Vol. 4 (06), pp. 068 -072, Nov-Dec,
Yaqub,”Flower classification using deep convolutional neural networks” IET, 2016
April 2018. [23] S.K. Datta “Present Status of Research on Floriculture in
[13] M.-E. Nilsback and A. Zisserman. A visual vocabulary for flower India” LS International Journal of Life Sciences · August 2019 DOI:
classification. In Proc. CVPR, volume 2, pages 1447– 1454, 2006. 10.5958/2319-1198.2019.00006. - Volume 8, Number 2, May-August, 2019,
pp. 71-93.
[14] M.-E. Nilsback and A. Zisserman. Delving into the whorl of flower
segmentation. In Proc. BMVC., volume 1, pages 570–579, 2007. [24] Chaku Gamit, Prof. Prashant B. Swadas , Prof. Nilesh B.
Prajapati,” Literature Review on Flower Classification “,International Journal
[15] Maria-Elena Nilsback and Andrew Zisserman,”Automated flower of Engineering Research & Technology (IJERT) ISSN: 2278 -0181
classification over a large number of classes”2008 IJERT V4IS020561 Vol. 4 Issue 02, February-2015.
[16] Krizhevsky, A., Sutskever, I., Hinton, G.: ‘ImageNet classification [25] Cahit Deniz GÜRKAYNAK, Nafiz ARICA, “A Case Study on
with deep convolutional neural networks’, in Pereira, F., Burges, C., Bottou, Transfer Learning in Convolutional Neural Networks”,978-1-5386-1501-
L., et al. (ED.): ‘Advances in neural information processing systems’ (Curran 0/18/$31.00 © 2018 IEEE.
Associates, Inc., Red Hook, NY, USA, 2012), pp. 1097–1105
[26] Xiaoling,” Inception-v3 for Flower Classification,” International
conference on Image , Vision and computing, 2017.

978-1-7281-7089-3/20/$31.00 ©2020 IEEE 664

Authorized licensed use limited to: Konya Teknik Universitesi. Downloaded on May 18,2021 at 22:33:24 UTC from IEEE Xplore. Restrictions apply.

You might also like