0% found this document useful (0 votes)
56 views3 pages

Mango Classification Using Convolutional Neural Networks

Uploaded by

Hema malini
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)
56 views3 pages

Mango Classification Using Convolutional Neural Networks

Uploaded by

Hema malini
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/ 3

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 05 Issue: 11 | Nov 2018 www.irjet.net p-ISSN: 2395-0072

Mango Classification using Convolutional Neural Networks


Rohan Sriram1, Amar Tejas M2, Prof. J. Girija3
1,2Department of Computer Science and Engineering, Bangalore Institute of Technology, Bengaluru, India
3Associate Professor, Department of Computer Science and Engineering, Bangalore Institute of Technology,
Bengaluru, India
------------------------------------------------------------------------***-------------------------------------------------------------------------
Abstract - This paper facilitates the development of an obtain binary image. Later, morphological operations on
automated system for classification of mango images. digital images of different mango fruits using MATLAB.
Automatic identification and recognition of Mango species is
necessary in the Indian market. In recent years, mango species [3] Uses the basic idea of classification of clothing items
recognition is carried out based on the shape, geometry and using convolution neural network. Area has applications in
texture. While modern search engines provide methods to e-commerce websites, social media advertising. [4]
visually search for a query image that contains a mango class, Introduces a unified approach that can combine many
it lacks in robustness because of the intra-class variation features and classifiers that requires less training. All
among millions of mango species around the world. Hence in features are simply concatenated and fed independently to
this proposed research work, a Deep learning approach using each classification algorithm. Besides that, the presented
Convolutional Neural Networks (CNN) is used to recognize technique is amenable to continuous learning, both when
mango species with high accuracy. refining a learned model and also when adding new classes
to be discriminated. [5] we use an exisiting CNN which has
Key Words: ANN, CNN, transfer learning, mango been pretrained, retrained using tranfer learning. In order to
classification train and test our system, we use a vast dataset of different
classes of mango images captured in real-time.
1. INTRODUCTION
3. METHDOLOGY
There are about numerous named species of mangoes in the
world. Generally, experienced taxonomy experts can identify Once the CNN is trained to identify a feature, it is recognized
different species. However, it is difficult to distinguish these irrespective of its position in the image. In this section, we
mangoes for most people. To know the names or describe in brief the working of CNN. In the initial step, the
characteristics of the mangoes, we usually consult with image is broken into a series of overlapping smaller image
specialists, query with mango guidebooks or browse tiles. This is done by passing a sliding window over the
relevant web pages through keywords searching. An image. Each image tile is then fed into a small neural
effective way to identify name can be done by classifying network. Results from processing each tile are saved into a
mango images, especially with the widely use of digital grid which is same as the arrangement of the original
cameras, mobile phone, etc. While the mango classification is image. The resulting matrix contains information regarding
appealing in its usefulness and meaningfulness, several the required features. This process is known as convolution
restrictions have limited its realization. Unlike other obvious as can be seen in Fig. 1. The output array may be large
objects classification in which we need to distinguish and hence it is down-sampled using the max pooling
obvious categories such as car and desk from each other, algorithm which selects the maximum value from each sub-
mango classification is a more difficult task because of inter- region of a rectangular area and hence helps in reducing
class similarity and a large intra-class variation and some are dimensionality. Finally, the reduced array is converted into
deformed due to weather conditions. What is more, it is a feature vector, fed into the fully connected neural network.
tough to distinguish the difference of some kinds that are Each feature is voted, the one with the maximum votes and
very different based on aspect ratio and angle. Hence, by minimum error rate is classified as the particular class of
using the concept of Convolutional Neural Networks we mango.
classify mangoes with highest accuracy.
In practice, CNN is trained on a very large dataset and the
2. RELATED WORK trained CNN weights are used either as an
initialization or a fixed feature extractor for the task of
Vast amount of work has been done in the past related to interest.
mango classification. [1] C.S nandi used, Gaussian Mixture
Model (GMM) is used to estimate the parameters of the
individual classes for prediction of maturity. Size of the
mango is calculated from the binary image of the fruit.
Disadvantage being. When one has insufficiently many
points per mixture, estimating the covariance matrices
becomes difficult.[2] Preprocessing techniques used to

© 2018, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1729
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 05 Issue: 11 | Nov 2018 www.irjet.net p-ISSN: 2395-0072

Class ID Class type Number of Number of


training testing
images Images

1 Totapuri 315 265

2 Alphanso 420 270

3 Malgoba 400 285

4 Raspuri 304 295

5 Badami 408 265

4. IMPLEMENTATION Training and testing

In this section we discuss the implementation of our system Transfer learning is a technique that shortcuts much of this
which involves the following steps: by taking a piece of a model that has already been trained on
1. Data Collection a related task and reusing it in a new model. In this tutorial,
2. Training and Testing we will reuse the feature extraction capabilities from
powerful image classifiers trained on ImageNet and simply
Data collection train a new classification layer on top.

The data collection phase involved collecting data from the The first phase analyzes all the images on disk and calculates
Indian market. . We intend to use this dataset solely and caches the bottleneck values for each of them.
for non-commercial, academic and research purposes. 'Bottleneck' is an informal term we often use for the layer
This dataset which we use to retrain the GoogLeNet just before the final output layer that actually does the
consists of 5093 images ranging over 5 classes and is classification. (TensorFlow Hub calls this an "image feature
insufficient to train a network as complex as GoogLeNet vector".) This penultimate layer has been trained to output a
from scratch. The GoogLeNet architecture [6] which we set of values that's good enough for the classifier to use to
use here for mango classification is a 22 layer deep distinguish between all the classes it's been asked to
neural network and was initially trained on the ImageNet recognize. That means it has to be a meaningful and compact
dataset[7] which consists of more than a one million images summary of the images, since it has to contain enough
ranging over thousand classes. The network was designed information for the classifier to make a good choice in a very
with practicality and computational efficiency in mind so small set of values.
that inference could be run on individual devices including
even those with limited resources for computational Once the bottlenecks are complete, the actual training of the
tasks. top layer of the network begins. The training accuracy shows
what percent of the images used in the current training
Hence, we use the weights from the GoogLeNet which is batch were labeled with the correct class. The validation
trained on the ImageNet dataset. accuracy is the precision on a randomly-selected group of
images from a different set.
We remove the final layer of the Inception v3 GoogLeNet
A new softmax and fully-connected layer is added and
model which is shown in Fig. and train a new final layer to
trained to identify new classes. For training the model we
classify the mango dataset.
run 4,000 training steps. Each step selects ten images at
random from the training set, finds their bottleneck value
from the cache, and feeds them to the final layer of the
CNN to get predictions. These predictions are compared
against the original labels to find the deviation. The final
layer's weights are updated in accordance with the
deviation observed through a back-propagation method.
This method is used in the Gradient Descent Algorithm
where the error rate is calculated at the output and
distributed back to the previous layers. The algorithm
Fig 2 Model architecture of Inception V3 model [8] adjusts the weights of the array. This phase goes under a
loop until minimum error rate is fetched.

After all the training steps are complete, we run a test


accuracy evaluation on a set of images that are kept separate

© 2018, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1730
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 05 Issue: 11 | Nov 2018 www.irjet.net p-ISSN: 2395-0072

from the images used for training. This test 6. CONCLUSION


evaluation provides the best estimate of how the trained
model will perform on the task of classification. Considering the benefits offered by the
convolutional neural networks to recognize images we try to
5. RESULTS DEPICTING PREDICTION use them for mango classification. We have implemented a
convolutional neural network by retraining final layer of
ImageNet for the task of classifying mangoes. Classification
of mangoes can be improved by replacing the traditional
filters with image filters. We try to bring in metadata free
databases, where the classifying algorithm determines the
type of mango and its features. We have proposed a system
for mango Classification using CNN and implemented the
same with the highest accuracy.

7. REFERENCES

[1] C. S. Nandi, B. Tudu, and C. Koley, “A machine vision-


based maturity prediction system for sorting of harvested
mangoes,” IEEE Trans. Instrum. Meas., vol. 63, no. 7, pp.
Fig 3 : Shows the user interface where the test mango 1722–1730.
images are fed into the model.
[2] A. Rocha, D. C. Hauagge, J. Wainer, and S. Goldenstein,
“Automatic fruit and vegetable classification from images,”
Comput. Electron. Agric., vol. 70, no. 1, pp. 96–104, 2010.

[3] A. Gongal, S. Amatya, M. Karkee, Q. Zhang, and K. Lewis,


“Sensors and systems for fruit detection and localization: A
review,” Comput. Electron. Agric., vol. 116, pp. 8–19, 2015.

[4] T. Meruliya, “Image Processing for Fruit Shape and


Texture Feature Extraction - Review,” Int. J. Comput. Appl.
(0975, vol. 129, no. 8, pp. 30–33, 2015. [10]. S. Poorani and P.
G. Brindha, “Automatic detection of pomegranate fruits using
K-mean clustering,” Int. J. Adv. Res. Sci. Eng., vol. 3, no. 8, pp.
Fig 4: Output : Badami confirmed 198–202, 2014.

From Fig. 4 we can see that the test image is a class Badami [5] “Image database: Mango „Kent,‟” 2014. [Online].
with an accuracy of 99% as compared to the predictions of Available:http://www.cofilab.com/portfolio/man goesdb/.
the remaining classes.
[6] Szegedy, Christian, Wei Liu, Yangqing Jia, Pierre
Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan,
Vincent Vanhoucke, and Andrew
Rabinovich. "Going deeper with convolutions." In
Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition, pp. 1-9. 2015.

[7] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei.


ImageNet: A Large-Scale Hierarchical Image Database. In
CVPR09, 2009.

[8] Szegedy, Christian, Vincent Vanhoucke, Sergey Ioffe,


Jonathon Shlens, and Zbigniew Wojna. "Rethinking the
inception architecture for computer vision." arXiv preprint
Fig 5: Totapuri confirmed arXiv:1512.00567 (2015).
As seen from Fig.5 we can conclude that the test image is a
class of Totapuri with 99% accuracy as compared to the
predictions of the remaining classes.

© 2018, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1731

You might also like