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

A Machine Learning Approach For Predicti

Uploaded by

Rozlynn Briggs
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)
20 views5 pages

A Machine Learning Approach For Predicti

Uploaded by

Rozlynn Briggs
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

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

Volume: 08 Issue: 05 | May 2021 www.irjet.net p-ISSN: 2395-0072

A MACHINE LEARNING APPROACH FOR PREDICTING FRUIT FRESHNESS


CLASSIFICATION
Ganeshan Mudaliar1, Rashmi Priyadarshini B.K2
1Student, School of ECE, REVA UNIVERSITY, Bangalore.
2Assistant Professor, School of ECE, REVA UNIVERSITY, Bangalore.
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - Automation of fruit classification is an interesting classification using image processing techniques was
application of computer vision. Traditional fruit classification developed. This classification of fruits can be used to identify
methods have often relied on manual operations based on a fruit and generate its price automatically in a shop or
visual ability and such methods are tedious, time consuming supermarket. As an initial step in this proposed methodology
and inconsistent. External shape appearance is the main source classification of 7 fruits was done. Even agriculturist will be
for fruit classification. In recent years, computer machine vision benefited if an automation machine vision exits to classify
and image processing techniques have been found increasingly different variety of fruits and vegetables in the agriculture
useful in the fruit industry, especially for applications in quality industry.
inspection and color, size, shape sorting. Researches in this area
indicate the feasibility of using machine vision systems to Fruits provide an essential role as a food in our everyday
improve product quality while freeing people from the life. It provides nutrients vital for our health and
traditional hand sorting of fruits. This paper deals various maintenance of our body. Those who eat more fruits as a
image processing techniques used for fruit classification. part of a healthy diet are likely to have reduced risk of some
chronic diseases. However, not all fruits are treated equally
Key Words: Fruit, Feature Extraction, Neural Network, and it is a matter of concern that not every person knows
Convolution Neural Network (CNN), Fruit Classification about every fruit well. With the help of Artificial Intelligence
(AI) and Machine Learning (ML) this research can develop
1. INTRODUCTION an automatic fruit classification system with an information
dataset of each fruit. This system can help us to select fruit
In this paper, we are analyzing a safe and economic way that is suitable for us and teach us about the characteristics
to detect the fruit freshness based on size, shape and color. of that particular fruit. These types of systems can help us to
Testing of fruits should be done in a non-damaging method educate children and familiarize them with fruits.
because these are very fragile items. While fruit sizing, the Furthermore, these systems can be used to teach a robot to
key physical property is it’s color, which provides the visual find the correct fruit for its user and this becomes much
property. Hence, classification of fruit freshness is very important for those robots which are being used for fruit
important, for increasing the market share and establishing a harvesting related works. Another major application of fruit
better quality standards. If the classification and grading is detection and recognition is at smart refrigerator. Now a
done through manual methods, the process will be slow and days smart refrigerator can detect how fresh a fruit is, how
sometimes it will be full of errors. The humans classify fruits many of which kind of fruits are left, which fruits are less in
freshness based on color, size, etc. If these quality measures amount and need to be added in the shopping list.
are mapped into automated system by using suitable
programming language, then the work will be faster and As people have more access to health information, it is
without errors. This results in increasing speed and often found that recommendation of healthy food is very
decreasing cost in fruit sorting process. Recently Machine essential. While shopping, an automatic fruits classification
Learning techniques have been found progressively useful in system connected to information database can help the
the fruit industries, mainly for the applications in fruit consumer to select healthier fruit along with nutrition
freshness detection. Fruit characteristics such as shape and details. Also, in recent time super shops use these kinds of
color are pivotal for perceptible inspection. A systematically systems to provide information about each type of fruit to
independent structure for fruit grading based on freshness customer, to keep track of the sold and in stock product and
must be able to efficiently identify both the parameters. We also to identify the most demanding fruit item. Even on-line
can easily obtain the shape of the fruits from their image. shopping sites can use such automated system very easily.
This study aims to build a classification model for Tomato For all these functions a proper fruit detection and
fruit images. We propose Convolutional Neural Network recognition system is a must.
(CNN) as the method to classify Tomato fruit images into 2
classes, namely Ripen Tomato and Rotten Tomato. 2. LITERATURE SURVEY

Machine vision system for fruit classification is one among In this paper, a fruit recognition system using CNN is
the current topic that is under research in the agriculture proposed. The proposed method uses deep learning
industry. As a part of this current research area, this fruits

© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2979
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 05 | May 2021 www.irjet.net p-ISSN: 2395-0072

techniques for the classification This paper explores a fruits 4. CNN


recognition classifier based on CNN algorithm [1]
A convolutional neural network (CNN) is a specific type
This paper deals various image processing of artificial neural network that uses perceptrons, a machine
techniques used for fruit classification. This paper deals learning unit algorithm, for supervised learning, to analyze
various methods and algorithms used for fruit recognition data. CNNs apply to image processing, natural language
and classification based on The development of computer processing and other kinds of cognitive tasks.CNN is a
vision, making it possible to train the computer to classify multilayer, feed-forward neural networks (FFNN) which can
images based on specified characteristics. quickly identify, classify, and recognize any features in an
image. It is used mainly with visual data, such as image
This paper proposes the classification model to classification. A CNN can be prepared to do image analysis
classify orange images using Convolutional Neural Network tasks including object recognition, segmentation,
(CNN). Five classes of orange namely good-orange-grade-1, classification, and image processing. Large-scale image
good orange, immature-orange, rotten-orange, and recognition has been become possible because of large
damaged-orange are classified using deep learning CNN public image databases such as ImageNet. CNN are networks
approach. CNN better performance to attain better fruit made up of neurons similar to the human brain. Figure 3
classification[3] shows an example of a CNN. These neurons consists of
weights and biases that form layers and fire in a particular
In this paper, we used Tensorflow, one of the most order to end up with a final output. The networks can be
popular deep learning libraries to classify dataset, which is trained in order to recognize particular patterns by feeding
frequently used in data analysis studies. Using Tensorflow, them large amounts of data. This is very useful in the field of
which is an open-source artificial intelligence library computer vision since it means that a computer can be
compared the effects of multiple activation functions on trained to recognize different objects.
classification results.[4]

3. ALGORITHM

In this section we directly discuss about how is the


system is

 Select the fruit Images.

 Resize all fruit images to standard size.


Fig1: architecture of CNN
 Changing the dataset from having (n, breadth,
height) to (n, depth, width, height). 4.1. Convolutional Layer
 Split dataset into training, test & validation set using This layer is the first layer that is used to extract the
keras train_test_split command. various features from the input images. In this layer, the
mathematical operation of convolution is performed
 Transforming our data type to float32 and between the input image and a filter of a particular size MxM.
normalizing our data values from 0-255 to the
range [0, 1]. 4.2. Pooling Layer

 Preprocess class labels. In most cases, a Convolutional Layer is followed by a


Pooling Layer. The primary aim of this layer is to decrease
 Define our model architecture. the size of the convolved feature map to reduce the
computational costs
 Compile model with stochastic gradient descent
optimizer and categorical-cross entropy and also 4.3. Fully Connected Layer
the learning rate=0.0001.
The Fully Connected (FC) layer consists of the weights
 Fit and train data. and biases along with the neurons and is used to connect the
neurons between two different layers.
 Evaluate model on test dataset and calculate the
confusion matrix 4.4. Mobile Net

 Classification is done through python 3.6. In many real time mobile applications implemented with
recognition tasks to identify certain objects or surroundings,
light weight architectures are preferable to match the

© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2980
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 05 | May 2021 www.irjet.net p-ISSN: 2395-0072

resource restrictions on the platforms. MobileNet is an the networks for users who wants to apply them in different
architecture developed to function on mobile and embedded contexts.
vision applications. MobileNet is used in Inception models
and is built on depth wise separated convolutions to reduce 4.8. Keras
the computation and model size. The depth wise separated
convolutions splits the standard convolution method of Keras is an open-sourceneural-network library written in
combining and filtering in one sequence, into different Python, which is used for the preprocessing, modeling,
layers. One layer for combining and one layer for filtering. evaluating, and optimization. It is capable of running on top
This method reduces the computation size drastically. The of TensorFlow. It is used for high-level API as it handled by
architectures input layer takes an image of size 224 × 224 × backend. It is designed for making a model with loss and
3. Following the input layer is a stack of convolutional layers, optimizer function, and training process with fit function.
one average-pooling layer and a fully connected layer. The For backend, it designed for convolution and low-level
kernel sizes of the convolutional layers vary between 3 × 3 computation under tensors or TensorFlow. Importing the
and 1 × 1.The depth wise separated convolutions structure is python libraries are used for preprocessing, modelling,
clearly shown in the network. Almost 75% of the total optimization, testing and display emotion which having a
parameters in the network are located in convolutional maximum percentage.
layers using a kernel of 1 × 1. This is what reduces the
5. DATASET
computation size.
For training and testing, all the pictures were chosen
4.5. Inception v3
from the Tomato Fruit dataset 500 from Kaggle. The dataset
Inception-v3 is the 2015 repetition of Googl’s Inception contains 500 different Tomato fruits pictures .these is
structural design and a broadly used image identification classified into Ripen Tomato and Rotten Tomato. The pre-
network model that has been presented to obtain more than processing steps including cropping and resizing the object
78.1% accurateness on the ImageNet dataset. Inception is a into 32 × 32 pixel.
remarkable structural design and it is the outcome of
For this test, the training image for each fruit and test
numerous cycles of test and error. It is a module of
images were created from detection set of using this fruit
GoogleLeNet designed to function under strict constraints on
classification approach.
memory and on a computational budget. In the ImageNet
Challenge 2014, GoogleLeNet with the Inception v3 module, Dataset Properties
had the least error rate comparing to other architectures.
With an average error rate of 6.66%, the network defeated 1. Training set size: 500 images
all the other competitors. The Inception v3 module is 42
layers deep and uses BN in both the convolution layers and 2. Validation set size: 140 images
in the fully connected layers. At the start of Inception v3, is a
sequence of three convolutional layers which takes an input 3. Number of classes: 2
image of 299 × 299 × 3. The most unique part of the
Inception network constitutes of the Inception modules. 4. Image size: 100*100 Pixels

4.6. ImageNet 6. RESULT

ImageNet7 is a large scale image database. In 2009 In this paper, has been applied Mobile Net on Fruit Dataset
ImageNet had over 3.2 million of images of over 5000 to discover the better classification performance of the
categories and has only expanded since. ImageNet is a network. From Fruits dataset, here taken 1260 images from
popular database for collections of data sets to train neural 7 different categories: 85 % of the images from these are
networks and has since 2010 held the annual Large Scale used for training, and 15 % are used for testing the model.
Visual Recognition Challenge8 which has participants from
more than 50 institutions. The variety of images makes the The network is trained for 10 epochs with a batch size of 14.
database a great source to train a neural network. ImageNet The accuracy of the proposed model was 98.74 %. The
is a common data set to have as a foundation when applying comparison of the proposed model with the conventional
training techniques on a CNN because of variety of categories models shows that the results of this model are exceptionally
the database provides. good and promising to use in real-world applications. This
sort of higher accuracy and precision will work to boost the
4.7. TensorFlow machine’s general efficiency in fruit recognition more
appropriately. As a prototype, a program was developed in
Tensorflow is an open source software for numerical Python with PyQt library in a Visual Studio environment. The
computation. It was originally created to conduct machine appearance of the program is shown in Figure 4.
learning and deep neural networks research. Tensorflow
provides neural network architectures and scripts to retrain

© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2981
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 05 | May 2021 www.irjet.net p-ISSN: 2395-0072

The dataset is created by the author. It contains 7 class of 7. FUTURE ENHANCEMENT


fruits. The neural network model which have been used for
dataset. For the proposed recognition model evolution this Furthermore, this approach can be integrated with IOT using
paper organized this recognition model using its training sensors so that freshness of food can be detected by the
and test images. For this test, the training image for each external feature such as colour, shape, texture, size but also
fruit was 1260 and test images were created from detection by its internal factors by using different sensors to early
set of using this fruit classification approach. detect the chemical and biological changes in the food. The
identification and selection of a hydrogen sensor, Moisture
sensor, and Gas sensor to develop a sensible food freshness
detector ensures the freshness of food. A web application can
be developed to display the results of checking food items.
Hopefully, in the future, can be extended the work with a
larger dataset having more categories fruits & vegetables..
Have the plan to implement some other CNN based models
to compare the accuracy on the same dataset. Can be also
work on some more features for grading and classification,
which can identify types of disease and/or texture structure
of fruits. All these are future direction.

8. CONCLUSION

This paper focuses the use of convolutional neural network


Fig 2: Ripen tomato of 89% (CNN) in the field of food industry and agriculture. The most
important quality characteristics of agricultural products are
size, color and shape. To restore physical examination of
food, CNN is widely employed which gives us genuine,
unbiased and constructive classification. We also established
our own experimental database. The suggested technique
recognized fruits freshness Ripen and Rotten fruit. With
many real-world challenges in our dataset, in order to
enhance the functionality and versatility. Hence, the
suggested technique efficiently intensifies the rate of
identification of fruit and its freshness detection, so that the
real-world application demands can be achieved.

REFERENCES

[1] Xiaoyang Liu, Dean Zhao,Weikuan jia, Wei Ji, Yueping Sun,
“A Detection Method for Apple Fruits Based on Color and
Fig 3: Rotten tomato of 96% Shape Features” , IEEE Access, 22 May 2019 .

[2] Seng, Woo Chaw, and Seyed Hadi Mirisaee. "A new
method for fruits recognition system." Electrical Engineering
and Informatics 2009. ICEEI'09. International Conference on.
Vol. 1. IEEE, 2009.

[3] Nishat Tasnim, Md. Romyull Islam, and Shaon Bhatta


Shuvo “A Convolution Neural Network Based Classification
Approach for Recognizing Traditional Foods of Bangladesh
from Food Images”.

[4] Sahu, Dameshwari, and Chitesh Dewangan.


"Identification and Classification of Mango Fruits Using
Image Processing." Int. J. Sci. Res. Comput. Sci. Eng. Inf.
Fig 4: Rotten tomato of 73% Technol 2.2 (2017): 203-210.

[5] Shadman Sakib1, Zahidun Ashrafi2, Md. Abu Bakr


Sidique3. ''Implementation of Fruits Recognition Classifier
using Convolutional Neural Network Algorithm for
Observation of Accuracies for Various Hidden Layers''.
© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2982
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 08 Issue: 05 | May 2021 www.irjet.net p-ISSN: 2395-0072

[6] Dang Thi Phuong Chung1 and Dinh Van Tai “A fruits
recognition system based on a modern deep learning
technique”.

[7] Shiv Ram Dubey and Anand Singh Jalal "Application of


Image Processing in Fruit and Vegetable Analysis” A Review.

[8] Kavdır, I., Guyer, D.E.: Comparison of Artificial Neural


Networks and Statistical Classifiers in Apple Sorting using
Textural Feature,. Biosystems Engg. 89, 331-344 (2004).

[9] Hannan M.W., Burks T.F., Bulanon D.M., “A Machine


Vision Algorithm for Orange Fruit Detection”, Agricultural
Engineering International: the CIGR E journal, vol-
XI,Pages:1-7, December-2009.

[10] A. Vyas et al, “Colour Feature Extraction Techniques of


Fruits: A Survey”, International Journal of Computer
Applications (0975 – 8887) Volume 83 – No 15, December
2013.

[11] Ms. Snehal Mahajan , Prof. S. T. Patil “Optimization and


Classification of Fruit using Machine Learning Algorithm”.
IJIRST – International Journal for Innovative Research in
Science & Technology Vol.3- No 01 June 2016.

12] Dubey, Shiv Ram, and A. S. Jalal. "Robust approach for


fruit and vegetable classification." Procedia Engineering 38
(2012): 3449-3453.

[13] V. Leemans and M.-F. Destain, ``A real-time grading


method of apples based on features extracted from defects,''
J. Food Eng., vol. 61, no. 1, pp. 83_89, Jan. 2004.

[14] T.-N. Do and J.-D. Fekete, ``Large scale classification with


support vector machine algorithms,'' in Proc. 6th Int. Conf.
Mach. Learn. Appl., Cincinnati, OH, USA, Dec. 2007, pp. 7_12.

[15] Bargoti, S. and Underwood, J., 2017, May. Deep fruit


detection in orchards. In Robotics and Automation (ICRA),
2017 IEEE International Conference on(pp. 3626–3633).
IEEE.

© 2021, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2983

You might also like