You are on page 1of 37

Abstract

Nowadays, Computer vision and machine learning is most widely used domain throughout
the world. In this method the objects i.e. fruits represented on the image can be identified by
using the machine learning model by the training based on sufficient images that are
numbered. When we have large number of training images, the accurate image can be
recognized by using the deep learning model. This will helps to identify the fruits and
recognise its name. Due to complexity and overlapping of images, still image recognition
faces a problem for weighing the stacked fruits. In this project, Convolution Neural Network
(CNN) is used to predict the name of the fruit given in the image. In this model, the model is
well trained where fruits image is considered as the input for the model while label of the
fruit will be output of the model. If the training for the Convolution neural network model is
completed successfully, the model/system will able to identify the fruit and predict name of
the image. CNN faces the problems like network quality and the training, this can be shorted
by using another algorithm deep belief network. Kaggle is the website where the datasets are
obtained. Tensor flow and Keras are the two platforms that support python programming
language. This CNN architecture will be useful to identify fruits like apple, orange, banana
etc. by using 360 datasets and it also provides 95% accuracy. The fruits in this project can be
recognised using its shape, size of the fruits and also by different features. This project will
briefly describe about the deep learning model that is used to identify the fruits. If the model
is trained well, surely it will be remarkable in the market.

Keywords: Computer vision, machine learning, CNN, Kaggle, network, datasets, Tensorflow
and Keras.

1
Chapter 1
1.1 Introduction
This project will gives brief explanation about the fruit recognition based on recent
technology and also highlights the benefits and goals of this method using datasets. In
agricultural areas like food industry, packaging, marketing etc… recognising of the fruits
plays a major role. Classifying the fruits and sorting the fruits based on their amount is time
consuming. In order to rectify this, a new modern technology, deep neural network is
identified in order to classify the fruits. This will help to recognise and predict the fruits
based on their shape, size and other features with more accuracy and less rate of loss. In this
project Convolution Neural Network CNN is used for image identification.

Tensorflow and Keras are used as supporting language for Python. Each layer of the CNN is
followed by Rectified Linear Unit Layer (RLUL). Kaggle is the open source website used to
obtain the datasets. In this project, the dataset consist of 15 varieties of fruits along with 4000
images. This will helps to identify the image of the fruits and label the fruits based on their
shape and size using this modern technology. In this method, the networks are trained to
identify the fruits like apple, orange, banana etc based on the pixel datasets. However, it is
difficult to identify the images due to overlapping and complexity, the deep learning model is
well trained in order to identify the image and predict their name with high accuracy.

Deep learning model algorithm:

Artificial intelligence is the source for the Deep learning which is the sub field of Machine
learning. The data which contains high model abstraction can be collected by this Deep
learning technique. In this method the models can be read and understand from the picture,
sound or from the text in order to conduct the analysis. This deep learning model surely will
provide accuracy and will be better in their performance than humans. Labelled data and the
neural networks architecture will train the data learning model which contain many layers
that will provide in term of their accuracy. Deep learning model became popular due to two
main reason: one that needs huge amount of data which is to be labelled and secondly due to
computing power which is substantial. The applications in the deep learning had provided a
various growth towards the research which includes language processing, classification of
image, retrieval of information and learning. The term deep learning is further classified into
two parts namely deep and learning based on previous information and understanding. This
machine learning provides various functions and techniques for learning the model from
2
available information and this will be used for forecasting and reporting of the image in the
future work. Artificial Neural Network is type of the network which gets inspiration form the
humans which will perform multiple layers which are hidden for more number of complex
functions. In this Input layer takes image as an input then passes to the hidden layer and it
provides output[ CITATION Dan19 \l 16393 ].

Convolutional Neural Network (CNN):

In DNN class, the neural network called CNN Convolutional Neural Network is most widely
used for visual analysis. Most of the CNN is commonly used as Feed Forward Neural
Network because it helps to identify, classify and recognise the image quickly based on their
features. In this method the object is recognised using image or through video[ CITATION
Wen20 \l 16393 ]. LeNet is the first used CNN developed by the AI member group of
Facebook. In this network the inputs are obtained in the form of pixel that carries different
weighs based on the features of the image and the outputs are displayed based on the
instructions of the hidden layer. Despite of the nature of Pooling and Convolution layer, the
CNN is connected to different layers to recognise the different image completely. The
operation in this CNN is performed based on the pixel of the image. CNN is enclosed within
input layer, hidden layer and output layer. The Convolutional Neural Network consist of four
layers namely Convolution layer, which is used to convolute the pixel of the image with
kernel in order to extract or remove features. Second, the ReLU layer or Non-linearity layer,
which is used to define the activation of the function it may be sigmoid or non-linear type of
function. Mostly the images can be passed between the ReLU layer and Convolution layer in
which the negative pixel of the images are converted into zero and helps to attributes the
image. Third layer is pooling or sub sampling layer which is used to transform the image into
image with required dimension without any effect like blurring. Different kernels are used by
the pooling layer in order to identify the folding sides and contagious of the image. Then the
image is transformed into matrix term. Final layer is wholly or fully connected or
Classification. This will helps to identify the image based on their accuracy and this will
shows that the image recognition is achieved successfully[ CITATION Sha19 \l 16393 ].
Convolutional Neural network is popular because it can read 2D images while other networks
cannot. Advantage of convolutional neural network over other network is that it will notice
the structure of the image while processing of image is ongoing.

Deep Belief Algorithm:

3
In order to overcome the issues that are faced while using deep model, a new methodology
called Deep Belief algorithm is implemented. This network is made of multiple hidden
layers. This algorithm is used as same as the other networks but it can also be used to pertain
and improve the value which is to be initial of the weights. This algorithm is considered to be
important because it helps to improve the network quality and also helps to reduce the time
taken for training. This Deep belief network combines with the convolution network in order
to obtain both the advantage.

Datasets:

In this project, we come to know how the dataset is created and what the dataset contains.
Datasets play a vital role in this paper, it is quite expensive and harder to generate. The
datasets are obtained from the open source website called kaggle. In this paper 4000 fruits
dataset images are used to obtain 15 varieties of fruit. While collecting a dataset, the
following constraints to be followed:

 The lighting surroundings should be different.


 To take an image, high definition webcam should be used.
 Classification of Fruits image should be same, colour should be different.
 Colour should be same while Classification of fruits image should be
different[ CITATION Ani20 \l 16393 ].

Tensor flow:

In this project, the Tensor flow is used to implement, train and test the network as given this
paper. This tensor flow is considered as open source developed by the Google for machine
learning for solving numerous computations by using the graph. In this edge of the graph is
considered as the multidimensional data array which is called as tensors. Tensor flow consist
of Clients, master and worker. Client is considered as the main components of the tensor flow
which use section interface to make communication with the master along with the workers.
The workers in this process is responsible to access one or more computing devices like CPU.
Special features in the tensor flow is it consist of mathematical mapping that will be used in
various machines. In this paper, the tensor flow serves as a supporting platform for fruit
recognition. Thus fruit recognition with machine learning algorithm provides better output
with high accuracy.

4
In this project, Convolutional Neural Network helps to identify the fruits based on their size,
shape and other features. This paper gives brief introduction, aim of the paper, objectives,
benefits of fruit recognition using CNN method and research questions will be discussed in
first Section. In second section, background analysis of this network, survey given by various
researchers based on their research that is work that have done in past years is discussed. In
next section, the specification to perform this task along with research methods, tools,
techniques, analysis of this trained network and design is discussed. After this,
implementation of the paper that is fruit recognition by using the deep learning is done. That
will provide result and the result is discussed in next section. Finally, the evaluation of the
output, how the paper to be managed, it schedules all the activities including milestones,
deliverables etc of the paper and what all are the recommendation that to be performed in
future is discussed. Finally, conclusion gives the best methodology and use of that method to
be performed with a hope of obtaining high rate accuracy. Future gives the idea in which the
issues that found in the present method will be shorted and rectified.

1.2 Aim of the project


The main aim of this project is to recognise the fruit and predict its name by using
convolutional Neural Network i.e. deep neural learning model with supporting platforms like
tensor flow and keras based on their size, structure, shape and other features.

1.3 Objective of the project


The objective of the fruit recognition is as follows:

 To collect the datasets like fruit images for the image processing.
 Pre-processing of images before classifying the fruits image to be performed.
 To obtain the features of the image from the pooling method.
 To obtain the dataset that can be classified based on their features.
 To perform the convolutional neural network method for fruit recognition.
 To train and perform test by using deep neural model.
 To implement the methods based on the requirements of hidden layer.
 To analyse the accuracy of the fruit recognition once evaluation of the network is
completed.
 To develop an algorithm which reduces complexity.

5
1.4 Fruit Recognition Assistance
The benefits of Fruit recognition using Convolutional neural network model is that we
experience our own datasets. This method will helps to recognise the fruits easily along with
many challenges. This will also help to increase the stability, functionality, flexibility that we
have satisfied the requirements or need for the world. It will surely meet the requirements of
the world. This will provide accuracy over 95%. Hence this will play a major role in food
industry, marketing etc…for accuracy and less loss rate of the weighing scale. It will reduce
time consumption. This not only helps the people in the agricultural area to recognise the
fruits it also helps to improve the business by making the people tuned. This paper provides
accurate, fast and reliable method for fruit recognition and further be used for real time life
application[ CITATION Isr18 \l 16393 ].

1.5 Research Questions


 How the convolutional neural network is classified based on their features?
 Which layer is considered as main layer and why?
 What are the functions of the pooled layer?
 What are the benefits of using convolution model than other network?
 Why pre-processing stage is important?
 How the images in the papers are classified and identified?
 Is tensor flow is best supportive platform for fruit recognition?
 How the accuracy of the process is obtained or calculated?

1.6 Summary
In first section, we have discussed about the fruit identification using Convolutional neural
network technique along with the aim, objective, benefits and research questions of using this
model. It states clearly that convolutional neural network model is preferred by many
researchers because of its high resolution and accuracy.

Chapter 2
2.1 Introduction
In this section, background analysis, literature review which includes tools, techniques,
accuracy, issues obtained in previous research is discussed. In order to overcome the issue in
the previous research, new approach is proposed in this project.

6
2.2 Background analysis
The method of identifying the fruits should be fast and reliable. The method of finding fruits
fast and reliable is that should be addressed by the researchers. Identification of fruits face
many problem. Among that, identification using size, shape and texture of the fruit is major
issue. Secondly, there is variation in the fruit abstraction like changes in light and shadow, it
makes difficult to identify the fruit. In order to solve the issue, various neural network
techniques has implemented. The network used in this will helps to apply certain features
repeatedly without changing the weight of the fruit. Convolutional neural network is a slow
process, but it shows high resolution and size of the image get reduced. Convolutional neural
network consist of various layers like pooling layer, loss layer and interconnected layer. The
problem can be solved by using a deep belief network algorithm because it increases the
training speed and testing speed of the fruit image. The datasets for the image is obtained
from the fruit 360. This dataset helps to obtain high data that will be useful for obtaining high
accuracy.

2.3 Literature review


Recognition of Fruits using Image processing:

Nowadays, in food industry it is more important to identify the fruit based on their quality
because nowadays persons are more conscious in health. Variety of fruits are available in the
market, but to identify the good fruit is more risk able task. In order to short this, natural
lighting method is used. This method is based on texture, colour and shape detection.
Particular fruit is recognised by image segmentation methodology. In this article, fruit
recognition paper is implemented by using MATLAB image processing toolbox. This consist
of four process namely pre-processing, Extraction of feature, Segmentation and Recognition.
This paper can be used for both real and non-real time application. In case of non-real time
application, pre-processing is used to browse the image, then from the image, features are
extracted by using GLCM (Grey Level Co-occurrence Matrix), RGB and Color Histogram in
the second stage. Then for the further process the image from the RGB is converted into
Grayscale image by the system. In image, the distribution of colors like red, green and blue
can be represented in terms of color histogram. The extracted features is given as input SVM
classifier. Then the output “fruit name” is displayed[ CITATION MsA19 \l 16393 ].

Fruit image Recognition using K-NN and SVM Algorithm:

7
This article represents the recognition of fruits by identifying the fruit types. The work
involves image classification and identification of fruit based on the size, shape and texture.
In this article, pre-processing, classification and feature extraction are the three stages
involved. In order to reduce the index color, the size of the image is resized into 90*90 pixel,
which takes place in the first stage. Next in second stage, the feature extraction, SIFT (Scale
Invariant Feature Transform), shape and color is used to extract the image of each dataset.
Finally, in Classification phase, K-NN K-Nearest Neighbourhood algorithm and SVM
Support Vector Machine algorithm is used to identify different type of fruits. These process
carries the above model and demonstrated on the dataset containing 178 images of fruit. Thus
this will provide fruit name with high rate of accuracy. This will helps the people to identify
the fruits in easy manner[ CITATION Hos14 \l 16393 ].

Color and Texture feature Fruit recognition:

Computer vision and machine learning is playing a vital role in food industries nowadays.
This article will helps to monitor, sort and pick the fruits that will ensure production in faster
manner. The main aim of this paper is to investigate the methods like auto-harvesting, and
categorise the fruits based on their color and texture. This article will propose new approach
that will overcome the issues in the previous method. The proposed method will account
different fruits according to their types. The main motivation of this paper is to provide the
result with high accuracy and efficiency. In every paper, first stage of classification of fruits
are pre-processing which is done in order to make a separation of the fruit from foreground to
background. From the segmented image, the feature of texture from the Grey Level Co-
occurrence Matrix and the color feature from the statistical layer is extracted. This two
combines in single feature. A support Vector Machine is trained by feature combination of
GLCM and statistical descriptor. Once the training is completed, the model is ready to find
the unlabelled image of the fruit. This method is also suitable for the embedded based paper
and single board computers[ CITATION Sus17 \l 16393 ].

CNN Based Fruit recognition:

We know that computer vision is most widely welcomed technique nowadays. Among that
recognition of fruits in the agricultural industry play a major role. In this article, the fruit is
recognised using Convolutional Neural Network CNN model. For every process, the image
should be extracted, in this paper the image is extracted from the selective algorithm and the
region of the image is obtained from the fruit image entropy. This is considered as the input

8
of the Convolutional Neural Network. The process will be started after proper training of the
network. The final decision is made only after the fusion of the region by using voting
mechanism. The achievement is done after doing the work in a better manner. The
application of this method in the super market, helps to find variety of fruits, fruit stacks etc
and also made multiple training to identify the fruit types. After successful training, this
network will be a remarkable over the fruit recognition stacked based on weighing
scale[ CITATION Lei16 \l 16393 ].

DNN and Efficient Net Architecture:

Many techniques have been proposed in the past years for recognition of fruits by using
computer vision technology. While comparing with other algorithms Deep Neural Network
DNN will provide promising result in identifying fruits. Many types of DNN classification is
proposed to identify the fruits. Issues in recognizing fruits may depends on size, shape,
texture. In this paper the network is designed to find a single fruit. This article gives a brief
explanation about the Deep layer in identifying the image of the fruits. This paper will
explain the application of this method. In this article, the brief explanation of the
Convolutional Neural Network CNN and also EfficientNet is discussed. This provide the
accurate output for Fruits classification of about 360 dataset. EfficientNet architecture is
highlighted briefly in this section. Best accuracy is found throughout the model work. In
future the model will be utilised to find image of different varieties of fruits[ CITATION
Dan191 \l 16393 ].

Fruit detection within the tree:

Hard coded feature Extraction algorithm is used to detect the fruit within the tree by video or
image processing. This algorithm have shown high accuracy. Even though it shows high
accuracy, the hardware is still intensive and not applicable for real time application. This
article gives the explanation of deep convolutional neural network which is based on detector
of single stage. This technique will eliminates the hard feature based on shape, size and
texture. Then this architecture take the image as input and then divide into grid, represented
as AXA where A is used to define the fineness of the grid. Image recognition and localisation
algorithm is fixed on each cell of the grid. This will helps to identify the image based on their
feature. This architecture gives 90% accuracy. This model is also designed with a feature to
accommodate the error rate. The speed taken for the processing is also high that will be apt
for real time application. In this paper we have discussed about the fruit recognition using

9
deep neural network technique by using single shot detector YOLO[ CITATION Kus19 \l
16393 ].

Retail application using machine learning:

This paper gives brief explanation of identifying the fruits and also vegetables in the retail
shop with the help of the image attached with the system. The system that attached with the
image will helps the customer to label or identify the fruits and vegetables along with the
price rate according to the weight of the fruits and vegetables. This new approach is proposed
in order to reduce the interaction between the system and the human, to speed up the time for
identification and to improve the usability of graphical interface comparing with manual
feature. The hardware designed for this paper is Raspberry pi, camera to capture the image,
display to view the result. In order to classify the object, various convolutional Neural
Network has been trained and tested to provide high accuracy. Heuristic evaluation is used to
test the usability of this network and this shows accuracy and user friendly comparing with
other technology. This system evaluated two CNN architecture namely Inception and
MobileNet. This classifies 15 types of fruits and vegetables[ CITATION Fri18 \l 16393 ].

Multiple Fruits Grading:

Due to massive fruit product challenge, there is an approach for classification and grading of
fruits. Among this, identifying a fruit based on quality is one of the major challenge. This
article represents the system to analyse four variety of fruits and also ranks the fruit based on
their quality. First algorithm shows the color of the image like red, blue and green. Second
algorithm shows the background of the image which is detached by the split and merge
algorithm. After this, color, gesture, geometrical features are extracted. In order to evaluate
the fruit type and quality, geometrical features are most widely used. Then in order to
evaluate the quality algorithms like K- Nearest neighbour K-NN, SVM Support Vector
Machine, SRC Sparse Representative classifier algorithm and Artificial Neural Network
ANN algorithm is used. Accuracy of the quality evaluation is detected for four algorithms.
Finally SVM is considered as more effective and the output is considered as more
comparable with other techniques[ CITATION Anu19 \l 16393 ].

Faster RCNN based fruit detection:

This article presents detection of fruit using deep convolutional neural network. The main
aim of the paper is to provide high, accurate, fast and reliable output in detection of fruits,

10
because fruit detection acts as a vital element in the platform of agricultural robotics, in
estimation of fruit yield, and also in harvesting. Recent research over the deep neural network
states that it led to development of new approach called Faster Region based CNN (Faster R
CNN). Most of them adopted this model because the task can be performed with the images
obtained from the Color that is RCB and Near-Infrared (NIR). In previous research, RCB and
NIR are the fusion methods used to detect. This leads to propose a Faster CNN model which
is more effective than prior work and scores F1 Grade. Bounded Box annexation is used for
additional accuracy. This model concludes by showing the result of detecting seven fruits
which takes four hours for both annoying and training. Thus future results shows the
annotation of fruits can be done by utilising Amazon mechanical Truck which is an algorithm
and other outsources to achieve high accuracy[ CITATION Ink16 \l 16393 ].

Fruit detection and sorting:

Nowadays, humans are so busy with their personal works, all wants to do work with
accuracy, less time along with low cost. This method is proposed to satisfy their needs.
Related to this, counting the fruits takes more time and it requires man power. In order to
reduce the effort of the user, algorithm is developed in computer vision to reduce the man
power. In order to avoid this problem, the algorithm like automatic fruit detection and
counting of fruit is essential. This provides high accuracy. In order to achieve good object
detection, counting of fruits, classification of fruits various algorithm and extraction features
are introduced. Proper training should be given for algorithm to provide accurate output. In
this paper, Raspberry pi is the hardware used for fruit detection along with camera. This
paper provides deep explanation for detection of fruits in trees, sorting of image is based on
the color and shape of the fruit. Image taken from the online or videos can be considered as
input, pre-processing of image is done with the help of computer vision designed with
python. The result not only helps for sorting, identifying and classification of fruits it also
helps in fruits overlapping and recognition of fruits. There are many areas available for the
researchers to explore new innovation in terms of fruit detection[ CITATION Gay19 \l 16393
].

Accuracy observation using CNN:

In computer vision, detection of fruit using Deep Convolutional neural network CNN is most
promising feature. By using recent technology, identification of fruits is done through
images. Due to complexity and standard similarity, the fruit identification and classification is

11
more difficult. In this article, the fruit detection using CNN model is discussed. This
proposed technique uses deep learning for identification. In this method four layers are used
for observation. The network is well trained and tested. Fruit recognition faces various
challenges based on the size, shape and texture. The main problem faced by this fruit
recognition is image segmentation. The features of this method is read using sparse auto
encoder (SAE). Thus this paper states the identification of fruits using CNN algorithm. The
accuracy is generated by passing through the hidden layer. Convolutional Neural Network
CNN is similar as Artificial Neural Network ANN. The input for this algorithm is image
represented in pixel it passes through the hidden layer and output is obtained. Thus this
experiment gives the name of the fruit image with accuracy[ CITATION Sha191 \l 16393 ].

Recognition of fake food image:

This article gives a detailed study about mixture of both validation and establishment of fake
food test with new technology. The new technology will automate the collection of date and
also the analyses. In this method, to find the fake food, technology like matching food, deep
learning and standardization of food is used based on the natural language processing. The
previous method is similar for all the process because both segmentation and classification of
food takes place at the pixel image level. To know its performance, the accuracy and
interaction that had mean during union of the pixel is measured. Firstly, in food matching,
food items in the image is described and then compares the recognised image with the
compositional data regarding both name and their descriptors name. Thus the final report of
the food matching provides result with accuracy of 93%. Further research is doing over
automated dietary assessment and also research on food choice. This method overcomes the
former research by its pixel accuracy. Nasco food model which is also known as Replica –
food model is most commonly used for Dietary assessment and also for educational purpose.
Because of its complexity, result of this method have not performed well. In order to
overcome the issues, the new method deep learning is implemented. This method is more
effective for image recognition. It also helps to validate the food image many number of
times. The method that are contributed in this papers are fake food buffet, image recognition
of fake food, pre-processing of image, training of deep learning finally food matching. Thus
advanced method for food recognition is developed and food images are collected using FFB
method[ CITATION Sim19 \l 16393 ].

Pure CNN – Fruit recognition Framework:

12
In article describes about the automation that have emerged in various fields like Agriculture,
education, harvesting of robots by using the methods like machine learning and also the
computer vision. Among, these machine learning also plays a vital role in fruit classification.
This is quiet complex because they found similar in shape, color of the fruit, size and texture
of the fruit. In order to identify the fruits with more accuracy, the method called Pure
Convolutional Neural Network CNN is developed. This technology is developed with less
number of parameters. CNN is composed with seven convolutional layers. Each
convolutional layer is followed by strides. Global Average Pooling GAP layer is developed in
order to reduce the over fitting, and also to give average for whole map features. This layer is
verified to be more effective. This method is demonstrated over fruits with 365 datasets. This
paper also gives brief explanation of the fruits recognition with 98% accuracy. The methods
take place in this papers are Pre-processing, P-CNN, training, matching. Pre-processing have
to be done before every starting because it provides accuracy. The result fruit name along
with the predictor is obtained by using P-CNN method which is more accurate in the
market[ CITATION Asi18 \l 16393 ].

Food image Classification:

Classification of food image is one of the features of Computer vision, which is most
commonly used for image detection and content retrieval. Nowadays, more researches are
conducted in this area in order to classify different types of the food image. This paper
investigates about one of the main domain called food image classification. This method is
helpful for Restaurants and in intake calculators of dietary. For this accomplishment, Deep
Convolutional Neural Network is introduced in two ways. Transfer learning and re training of
Deep Convolutional Neural Network is done. Next, the image is extracted from the DCNN’s
pre training in order to train the convolutional classifiers. In this paper, a new database is
introduced based on the guidelines of Australian dietary. By comparing the other methods,
most accurate method is introduced in this paper. This gives accurate results when compared
to existing method, but training time taken is comparatively low than the
existing[ CITATION Ste18 \l 16393 ].

Image Classification with frequency Domain Layers:

We know that machine learning plays a major role in automated field. Great improvements
were shown in both performance and accuracy of computer vision and also in signal
processing systems and application. Variety of techniques have been emerged this in this

13
field lie deep neural network but frequency domain has not shown thoroughly. In this paper, a
detailed study is made on the new technology of extracting the features by using Fourier
analysis. This proposed Fourier analysis technique combines with the deep architecture in
order to provide better image classification with high accuracy. Experiments are performed
well with the computational field that were performed with the liveliness of the face detection
problem, this have provided better result comparing with the existing Replay- attack database
protocol. This paper discuss about how the frequency domain helps the deep neural network
to improve the performance in the network area. This results the image classification can be
done through frequency domain layer[ CITATION Jos17 \l 16393 ].

Hyper spectral image classification:

In remote sensing, deep learning has gained more attention in research years. In deep
learning, convolutional neural network is best approach in the application of visual
recognition. Google Net and VGGNet is pre-trained model for image classification. This
model is considered as pre-trained model because of its dimensionality and it requires less
sample to be trained. This new technology shows CNN architecture that can be used for two
real hyper spectral that is real time application data sets. By calculating the orthonormal basis
that relates the correlation matrix, the issues over dimension can be overcomes. This will
reduce the dimensionality of the image and it also increase the signal to noise ration. This
overall method is performed by subspace feature extension. This paper describes the
combination of both the framework like Convolutional Neural network CNN architecture and
the subspace feature to provide more information and design CNN, this will limit sample for
the training. The feature which is generated by the subspace and CNN framework will
provide regression of this method. This feature provides better performance by using original
and conventional data based on recent approach. The result shows 98% accuracy by the
performance shown in Indian university[ CITATION Som18 \l 16393 ].

Feature extraction using CNN and Deep learning technique:

This article details about the extraction feature of image by using Convolutional Neural
network CNN and deep learning technique. Moreover, image classification is basically done
by identifying the shape and geometry of the object which is surrounded over the human.
These image classification is done with four process like pre-processing of the image,
segmentation of the image, features extraction and finally classification. The proposed
method is faster and provides better accuracy while comparing with past method. This new

14
technology will be used for many applications like Features of security, authentication, face
recognition, medical areas, identification of traffic etc. The identification of image can be
done with various techniques. Among that machine learning is most used method for image
identification. This algorithm has been developed years ago, but it has not implemented in
better way due to computational power. With the help of deep learning algorithm, the image
is represented in better way by proper training of the network. In first layer, the CNN gets
revolution by the shapes and then in deep layer it will makes to learn the extracted features
and finally provides accurate result. This technology has emerged as the fundamental keys for
understanding the cortex visual in the terms of human and animals in the computer vision
field. Thus this paper features the image that have been extracted using convolutional neural
network. This performs better in deep learning. Deep learning algorithm is used for various
applications and results shows accuracy and this method is almost accepted by many
researchers. This network has certain drawbacks like training is less, computational power is
lagging emerged during network scale. This issues can be overcome by the research done in
the future with better result[ CITATION Man18 \l 16393 ].

Convolutional neural network review:

In previous research, based on the application of the CNN technique for fruit identification is
not considered as a best approach. In this paper the advantage of using CNN over previous
method is discussed. In this study, we are able to study details that are applied in three
applications. In first application, CNN is applied directly to identify the fruits based on their
names. This first approach is applied in markets, supermarkets, retail shops and also for
wholesalers. The second one is identifying the quality of fruit which is used to identify the
damage on the internal and external damages that occurs in the fruit, to know its maturity
degree, and also used to identify the disease or to know the nutrition in the fruits are in
normal level. Final application is known as fruit detection that are used in orchards for fruit
harvesting, it estimates the location for harvesting of fruits. The approach of CNN may vary
for different applications. New CNN approach is developed by pre-training the CNN by
modifying various layers and parameters. This provides accuracy of about 100%. It also
found to be better in area of robotic harvesting[ CITATION Jos20 \l 16393 ].

High quality fruit recognition:

The main aim of this paper is to identify the fruit images using different datasets. The name
of the fruit is mentioned as Fruit 360 and it can be obtained from the resource Github and

15
Kaggle. To obtain a good and best classifier, dataset should be in high quality. The image
dataset contains object and also noisy background. If we change the background, the
classification of the image will be identified incorrectly. Next deep neural network should be
trained properly to identify the image. This part is considered as most complex because the
main target of this paper is to obtain the classifier and identify the object from the image.
This will suit the current trend that are working in the required field. In this, counting of fruits
and recognising of fruits form the image is represented by using Auto counting method. In
this article, the target are fruits that are identified based on their shape and color according to
the plant canopy. The main motive of this paper is to identify the pepper fruits in the
greenhouse. Deep learning algorithm is used in this field to identify the fruits. Convolutional
Neural network comes under Deep learning algorithm. These network consist of
convolutional layer, pooling layer and fully connected layer. Deep belief network is a model
that is composed of hidden layers. This model is very important because it reduces the
training time and improve the quality. Successful output of image classification and
recognition is obtained by using artificial neural network ANN[ CITATION Hor17 \l
16393 ].

Fruit recognition in retail stores:

In retail stores, the vegetables and fruits payment is to be identified manually. In this paper,
convolutional neural network CNN method is used in order to classify the fruits that will
speed up the checking process. The process is designed with three classes that will identify
the fruits with or without the plastic bags. In order to increase the accuracy of classification, a
new approach is added to the Convolutional neural network architecture. Single RGB color,
histogram, RGB centroids are the input. These are obtained from the K means clustering.
This paper shows accuracy for both fruits with or without bags. Customers purchase are most
important rely for Retail stores. In this paper, minimum number of trainings are performed to
classify the fruits with better accuracy. Data augmentation is also not exposed to the dataset.
This is also likes to measure the light sensitive illumination. Future research can be done to
compare the accuracy of CNN architecture against the CNN along with GPU hardware and
datasets. In this paper, the data accuracy for different methods are discussed. MobileNetV2
architecture is the model used for this method and trained with two dataset version. First
image that having fruits without bag and secondly image having fruits inside the bag. The
accuracy of the fruit image is higher in the image without plastic bag. The colors are based on

16
the background that should be taken in account. In future, the elimination of the background
will be processed[ CITATION Jos201 \l 16393 ].

Instance segmentation for fruit and vegetable feature extraction:

The main aim of this project is to develop a system which is used to identify the fruits and
vegetables. Particular category feature is also obtained along with the fruits and vegetables
identification. Conveyor belt is updated over the fruits and vegetables by assumption. The
input may be obtained through images, text or by videos. In this project input is obtained
through images. In first part, dataset and models have selected. Next, model is re-trained
according to the dataset collected. Thermography, tomography is some of the specific image
capturing techniques used in this task to classify the fruits and also to count the number of the
fruits present in the dataset. In this process kaggle 360 dataset is used to extract the data
contains 96 fruit classes and contains 103 images in each 96 fruit classes. But later it is clear
that dataset is used only for classifying the fruit image not for counting the objects. In order
to count the object MS COCO dataset is preferred. Models chosen for this project is YOLO.
This technique first split into grids and then classes are assigned when the objects are
detected. At result overlapping occurs. The accuracy also found to be lower comparing with
others. Another issue is that YOLO is best in videos than in images. Image segmentation is
another technique used here, this also fails because it is low color contrast. Tried with edge
detection, it too fails. After several attempts Mask C – RNN is used. It is single with best
performance for MS COCO Dataset. Detection of the object, segmentation semantic is the
two functions performed by this model. Thus Mask C- RNN shows less loss, less time for
every layer[ CITATION Pra19 \l 16393 ].

2.4 Summary
Thus in above section image classification over various research papers were discussed.
Various techniques were used in order to classify the images based on the shapes, size and
texture. Training and testing have done with proper guidelines. It is clear that among various
research, convolutional neural network belonging to deep learning is considered as best
method suitable for classifying and recognising fruits with high accuracy.

17
Chapter 3
3.1 Introduction
In this section, materials and methodologies based on quantitative and qualitative method,
used to implement this project is discussed. Design and analysis of this design is discussed in
order to obtain desired image with accuracy.

3.2 Methodologies
Collection of data’s from the source is the major thing in the fruit recognition project. In
order to collect the data’s, two methods are used quantitative and qualitative method.
Quantitative method is used for testing the fruit images while qualitative method is used for
reading and understanding the entire process and acts upon the commands. In this project,
quantitative method is used for collecting the data’s from the source the data is obtained in
the pixel form and training is given based on the data’s obtained. Next qualitative method
helps to understand the entire project and process to give desired output. Hybrid research
methodology is used to avoid the problem while collecting the data. The output depends on
the collected data quality. The fruits represented in the dataset should be taken because the
images from other source provides less quality. Then the collected dataset should be trained
properly, because the output may also depend on the training provided in the network.

3.3 Requirements
In this project, Datasets are collected form the website named Kaggle. Python is the
programming language used for development of this project. Tensor flow and Keras is the
open source library that is used to support python programming language. Jupyter notebook
is used for importing Keras library. For training and testing purpose, tensor flow library is
used. Tensors are used to represent the nodes in the graph.

Kaggle datasets:

Kaggle is the online source that is used by the practioners of the data scientist and machine
learning algorithm. Kaggle is used for extracting the datasets. In this project, the kaggle is
taken as a repository source for identification of fruits. In recent days, Kaggle is considered
as the public data platform.

Python programming language:

Python is considered as a high level programming language. It supports both object oriented
and structured programming. This language is used often, because it is designed as highly

18
extensible. Python have simple syntax that is similar to spoken language. In this project,
python is chosen because of its code readability. This will make the user to interface without
any struggle with the syntax. Python programming language is commonly used within the
machine learning software’s like Tensor flow, keras etc. For manipulation of image, python
imaging library is used.

Tensor flow:

Tensor flow software package is employed for numerical computation. It is known as an open
supply and it will be employed by anyone at any time. Tensor flow package is employed in
the terms of deep neural network and machine learning. Specification for the neural and
scripts for the employer formula is given in order to restrain the network user given by tensor
flow. The given formulas and specification will help the user of the network to design
numerous in their contexts. Google brain the name of the team who developed the software
tensor flow. Tensor flow is operated by the python, C++ and artificial language.

Tensor flow program elements:

 Building process graph.


 Execution of process graph.

Tensor is used to represent the nodes in the graphical form. Spit folders is used to store the
images of different forms.

Keras:

Keras is additional type that is found in artificial intelligence that provides interface for the
python that is provided within the deep neural network. Tis also acts as an AN interface for
the tensor flow. Keras is considered as building block for neural network. For keras version
pair 4 soley in which the tensor flow is supported. Keras is responsible for intake of testing
and also for coaching of the datasets. The progress of the keras is as follows:

 Training and testing data information may be done.


 Layers are outlined that may support the feature.
 Model are compiled.
 Train the model.
 Next value or evaluate the trained model.
 Finally gets the prediction.

19
Keras acts a supporting layer for the Python. In this keras layer, the layers like dense,
dropout, two dimensional layer, activation layer and max pooling layer is extracted.

 Dropout layer use 0 as input and it is set with the frequency of the rate during the
training time. This will prevent the over fitting. Dropout layer is applied only when
training is said to be true.
 Dense layer is implemented only when output operation is obtained to be activation.
I.e. Output = activation.
 Two dimensional layer creates a kernel that is evolved within the convolutional layer
in which input layer is convolved to provide outputs of the tensor.
 Activation layer in keras applies activation to the output.
 Max pooling operation is performed for 2 dimensional spatial data.

Jupyter notebook:

Jupyter notebook is considered as the open source web application. It is used to create and
share the documents. Jupyter notebook is used to create the data along with the data
visualization, data equation, contain live code. It supports HTML and text files. Uses of
jupyter notebook is as follows:

 Cleaning and transformation of the data.


 Numerical simulation.
 Modelling the stimulation.
 Machine learning.

3.4 Tools
Graphics processing unit (GPU):

GPU is most important technology of computing, that have been used for both personal and
also for business purpose. GPU is widely used for video and graphics application. GPU is
originally designed to integrate the 3 dimensional graphics, because GPU is more flexible and
easily programmable. This will help the users to create and visualise the graphics along with
shadow and lightening. GPU has high power to accelerate deep learning mechanism. GPU is
used for gaming, content writing, machine learning process etc. GPU designed with 8GB,
1080 PI, and compute capability 6.1. After the training the result are undertaken in I7, 8 th
generation PC.

20
Personal computer:

Personal computer is a device which helps to reduce the human effort. PC is used for
multipurpose. Personal computer helps to run many commercial software for free of cost,
open source software. In this project, the output is obtained by using personal computer with
specification intel7, 8th generation PC. Design, implementation and result analysis taken in
this hardware part. Graphics are viewed through PC.

Jupyter notebook:

Jupyter notebook is used as open source web application software which is used to create or
edit the document, the input or output is displayed form the python or by language script.
Once the documents is saved, that files will be shared with others. In this application, python
is set as default. But based on the customization, jupyter will run several environments on
kernel. This application is used by many resource because rise in popularity of software
industry and rapid growth of the developing deep science and machine learning. Jupyter
ranks high because interactive editor will able to display the complex equations of the fruit,
chart for the quality of the fruit and graph of the identified fruit. Python is used in this
because the code is written and can be edited when there is a change. Jupyter is not only used
as learning language but also used as teaching language. Moreover, it is well known for
sharing the files. Jupyterlab is the latest product launched by the Jupyter, it will help to edit
the text and consoles the code in the browser other than jupyter.

Python:

Python is the language of high level programming used in various fields like deep learning
and machine learning algorithm. Python has an ability to create and visualize the data. This
language is used for various purpose because it is easy to design. It is flexible for training and
provides desired output. It is less consumption, hence in deep learning of fruit recognition
prefers this language. Each phase in this module uses python to get desired output. Python
uses jupyter because it can be easily created and edited. Certain libraries are extracted from
source to obtain output. Tensor flow and keras is used in this project because it supports
python as programming language. Python contains less code while comparing with other
languages. Helper function in python is used in many functions because it makes the code
more readable.

21
3.5 Techniques
Deep learning:

Deep learning is considered as the class in the machine learning algorithm. It consist of
various layers that combines to form non-linear processing units. The input for each layer is
obtained from the output of the previous layer. Comparing with the shallow learning
algorithm, the deep learning use more layers. Among this convolutional neural network is
obtained under deep learning. Deep algorithm is composed of both convolutional and fully
connected layers. Pooling layer helps this model. Configuration of both convolution and fully
connected layer helps to take an advantage of representing the bi-dimensional data. Another
method called recursive neural network is used that will helps to apply the algorithm to repeat
the same weight. This layer provides good result in natural way of image processing. Deep
belief network is another model found in the deep learning algorithm. This network is
composed of various layers of hidden unit. The usage is same as the present networks but it
will pre-train the network to improve the initial weights. Deep belief network improve the
quality of the network and also reduces the time taken for training. The combination of deep
belief network with the convolutional layer provides advantage of both the architecture. Deep
neural network is also programmed to perform other machine learning algorithms.

Convolutional neural network:

Convolutional neural network is also known as CNN or convnets, uses the technique to solve
the problem while training the dataset. Really CNN is considered as the super power in deep
learning of neural network. In this networks, the operations are performed by using sound,
text, videos and images etc. Multilayer perceptron MLP is used to provide good result that is
accuracy. The training time taken by the CNN is also considered to be reasonable. Moreover,
larger datasets with larger image will make the parameters to increase in their number
reduces their potential resulting in poor performance. In this method, CNN is used to identify
the fruits based on their features. The layers used for this model are pooling layer,
convolutional layer, fully connected layer and loss layer. Each layer performs specific
function and provides desired output.

Convolutional layer:

The name convolutional layer is implemented after the convolutional operation. The logic of
this convolutional layer is the operations based on two functions, in which third function is

22
the modified version of any one of the original function. A group of neurons in the
convolutional layer combines to form kernel. The size of the kernel is small but the depth
taken by this kernel is as same as the input depth. Each input is connected by the small part of
the neuron region called receptive field, because it is inefficient to link the neuron with the
previous output in terms of high dimension such as images. By stacking the result activation
maps, the output of the convolutional layer is obtained. In terms of padding, valid padding
equals to empty padding. Rectified linear unit layer is used for the maximum activation layer.
The result does not reduce the size but increase the properties of non-linearity.

Pooling layer:

Pooling layer is another layer in the convolutional neural network which is used to reduce the
dimension which is considered as the spatial representation. In the other way, it is used to
reduce the computational amount done in the network. Over-fitting of the network is also
controlled by using the pooling layer. All the layer consists of filters which is used to remove
the unwanted images. Among that, most commonly used pooling layer consist of 2X2 filter
size that is removal size with stride length of about 2. This stride will give output of about
quarter the size of the original size in which the input is reduced for the task.

Fully connected layer:

Fully connected layer is another layer found in the convolutional neural network technique.
This layer is obtained from the source named regular neural network. Each layer or neuron
obtained from the fully connected layer is linked to each layer by its input of the network as
output linked with the previous layer. Moreover, the operations of the fully connected layer
and the convolutional layer is same, hence it is possible to convert the network into two
divisions. Fully connected network layer connects the whole operation by giving the input as
the output of previous layer. In this layer, all the information’s are obtained from the source
of convolutional and pooling layer.

Loss layer:

Loss layer is another layer found in the convolution neural network CNN. Loss layer is
another important layer. It is used to avoid the penetration of the network by deviating from
the expected result or output. Loss layer is considered as the last layer of the network.
Various types of loss functions available. Among that softmax is used for predicting the class

23
from various classes which are distinct. Sigmoid cross entropy is another method used for
predicting multiple type of probabilities which are independent. For example: 0’s and 1’s.

Recurrent neural network:

Deep learning has another algorithm for classification of images is recurrent neural network.
Convolutional neural network can be improved by using recurrent neural network. By using
this architecture, we can repeat same set of weight over some data. The main work of
recurrent neural network is to process the data which is sequential, handwriting and also
recognition of speech. By using recurrent neural network along with the max and global pool
layer at front and at the back will be more beneficial. By using this network, every single unit
is taken into account. Without adding any parameters, depth of the network has been
increased. In natural language processing, recurrent neural network shows a good and best
result.

3.6 Summary
In this section, we have discussed about the specifications, tools and techniques that have
been integrated in order to perform the task. And finally we came to know that deep neural
network algorithm is best method for fruit recognition.

Chapter 4
4.1 Introduction
In this section, the design, implementation, result is briefly discussed. Next project
management gives the time and schedule in which manner the tasks are performed. Finally,
conclusion gives the summary along with the challenges.

4.2 Design and Analysis


Phases in fruit recognition:

The steps involved in fruit recognition are collection of data, pre-processing the obtained
data, extraction of image, classification of image finally evaluation or validation of image.
Each stages in this project gives output based on their requirements. The flowchart for the
fruit recognition is given.

Collection of data:

24
For this project, the data are collected from the open source website “kaggle”. Kaggle helps
the users to find the data and publish in better way. In this project, 15 fruits images are
extracted from the kaggle dataset. The data’s obtained from other source cannot give a clear
image. After collecting the data’s, the images are passed through the deep neural network. It
helps to train the system and provide the result with high accuracy. After downloading the
datasets, proper library should be loaded in order to compose a data frame. Data frame is
formed by using add loop function. From the data framework, the fruit is classified as fruit
name, path and label is formed for each 15 fruits. This project is formed by using python
libraries namely tensor flow and keras.

Fig 1: Flowchart for fruit recognition

Above chart describes the flow chart of fruit recognition. Designs based on requirements.
Each stage gives desired output based on their constraints.

Pre-processing of image:

After collecting the datasets, next process to be performed is image pre-processing. In this
phase unwanted images that is image with poor quality is eliminated before passing the image
through neural network. With the help of pre-processing, the bad quality image is deleted,
distortion is eliminated and image is degraded to high quality. Pre-processing is important
process that should be used before starting image classification. It is essential to delete the
unwanted images from the datasets. In this phase, the image is first converted into grayscale
and then to gray threshold and finally to black and white image by removing all the

25
impurities. Now the collected data is ready to process. The collected data is encoded then
decoded in order to obtain image with high accuracy. Decoded image is passed to the image
resizing, in this the original image is re-sized into quarter of its original image, then it is
passed through image array convertor in order to convert the image into black and white
image, that black and white image is passed to the dimension expander then it starts
predicting.

Feature extraction of image:

Feature extraction of the image is important for every terms of machine learning, in
recognition of pattern and also in image recognition. After pre-processing of the image, next
stage to be performed is feature extraction. Feature extraction includes extraction of image
based on shape, size and texture. Two important features of fruit recognition is feature
extraction and identification of feature. Feature extraction is one of the process in image
classification. The methods like Histogram of oriented Gradients HOG for extraction of
shape, HSV, Color histogram and color histogram for extraction for color and finally GLCM
for extraction of texture. In this project, tensor flow has a special feature to map the images.
In terms of convolutional network, pooling layer is used to reduce the spatial size of the fruit
image. Each image mapped feature is converted into single dimensional array. Extracted
fruit image is used for further process and to get desired output.

Classification of image:

Next phase in image recognition is classification of fruits, which is important process in the
image identification. By using the deep neural network, the classification of fruits takes place.
In this project, 15 types of fruit images are classified along with path and label. Proper
training is given in order to obtain image accuracy. Here the images are obtained in cluster
format. It categorise the fruits in different format. The cluster 1 may indicate the fruit apple,
cluster two indicates orange fruit, cluster 3 indicates fruit banana and so on. In this phase 15
varieties of fruits are classified. Thus this phase helps to train the system and get the output
which is desired. The challenge towards image classification are it have to identify different
types of fruits and next it has to identify different varieties of fruits among the types.
Classification of fruits is quite difficult because fruit 360 dataset consist many types and
varieties of fruits.

Image evaluation:

26
Final stage of the fruit recognition is image evaluation. In Deep neural algorithm, convolution
network helps to identify the images by using different layers. Thus final image is obtained
by comparing the extracted and tested data with the original fruit image. Finally, the desired
image is obtained in this phase with high accuracy. Evaluation of the images is done after the
classification technique. Evaluation gives the final output based on their constraints.

4.5 Project management


Project management is the process in which the members of the team unite together to
perform a project to achieve their goal at given amount of time. Main aim of this project
management is to chive their goal within given constrains. Basic phases of project
management are initial stage is initiation, next planning, then construction, monitoring the
project and control their issue and finally execution. Project management is major stage for
every project because the time and schedule is more important for a successful project.
Project management for this fruit recognition using Deep neural network is as follows:
Initiation:
 Proposal of the project.
 Project scope.
 Current operation review.
 Financial analysis.
 Resource allocation.
Resource gathering:
 Collecting previous articles.
 Examine previous articles.
 Short out issues.
 Research gap.
Planning:
 Specifications.
 Determine the methods.
 Design.
 Apply methodology.
 Attain output.
Execution:
 Analyse the output.
 Efficiency and performance
analysis.
 Obtain result.
Project closure:
27
 Documentation.
 Resolution.
 Post implementation review.
At initial stage, the aim of the project is proposed by undertaking previous research in terms
of methods, tools and issues. Detailed plan is obtained only after the research. At first, project
scope, financial analysis, allocation for resource, methodology have been planned. To
overcome the issue occurred in the previous research, this CNN based fruit recognition is
evidenced. In this project, within 2 days I have collected required fruit dataset from the
website. After clear study about deep learning algorithm, the dataset have been applied to
deep learning, time duration for this process takes about 12 days. For implementation of the
project by using tensor flow latest version takes 15 days. To get a clear result without any
issues it takes 4 days. After many attempt the result with high accuracy have been obtained
with the help of deep neural network algorithm using the tensor flow library. Finally,
documentation is done. Thus the project ends with good hope.

4.3 Implementation and Evaluation


In this section, detailed study about implementation of the project is discussed. This will help
the user to understand the project clearly. Many tools are used to support image recognition.
In this project, data are obtained from the open source website kaggle. Data’s are collected by
unzipping the downloaded data’s. After collecting various types of fruits and vegetables.
Further process is as follows:

Loading libraries:

Fig 2: loading the libraries

In this, required libraries are loaded from the open source. Tensor flow is used to import all
the libraries used in this project. Firstly, keras software for supporting python is imported
which is used to develop a system to recognise the fruits. In keras, the sequential layer is
imported. The layers to be extracted in keras are activation layer, dropout layer, flatten layer,

28
dense layer, conv2D layer and finally maxpooling 2D layer. Keras are mainly used to train
the images from GPU Graphics processing unit.

Loading image into the folder path:

Fig 3: image loaded to the path

After loading the required libraries, path is required to store the images. In order to load the
images in the path, function for loading images in the path folder is used. Next the collected
images are loaded into the path, data frame is created for each fruit with the path and label is
given for each fruit. This may happen in loop. After labelling the first fruit, then function
returns to the next path. This continuous until the final image occurs.

Dataset shuffling:

Fig 4: dataset shuffling

After labelling the fruits, the collected data are shuffled. This gives true or false statement.
The function says true when the drop is same as given image. Then each fruits and vegetables

29
are assigned with specific numbers. That number will help to identify the fruits as soon as
possible. For example: apple is numbered as 0, banana as number 1, carambola as number 2
and so on.

Data frame visualising:

Fig 5: visualising the data frame

After giving their specific number, resulting data frame is visualised for first 10 rows. The
above figure represents the visualisation. The visualisation is represented in terms of
fruit/vegetable name, path and label. After visualisation, fruit types that are distributed in the
datasets are plotted.

Dataset display:

Fig 6: display the dataset

After visualisation, 10 pictures from the datasets are displayed along with their labels. The
images obtained is used for recognition of the fruit with high accuracy. This image is
obtained during the pre-processing stage. Once data is collected from the source kaggle,
image is uploaded to the AI that will helps to encode the image, obtained image is decoded to
open the image in required format. Decoded image is resized in terms of height and weight.

30
Image array converter is used to convert the resized image into black and white image, then
dimension of that black and white is expanded. After the following steps, the process starts to
predict the images. These steps take place in the pre-processing stage. It also helps to delete
the corrupted images obtained during the dataset collection.

Fig 7: comparison of original and re-sized image

During this, the original image is compared with the resizing image, the process starts to
predict the accuracy. The original picture is resized in order to have the same size of the deep
neural network. Resizing of the image is done with 150X150 format. This resizing makes the
image to half of its original image.

31
Fig 8: layer uploading

After resizing, model supports sequential manner. Layers abstracted from the keras sequential
models are activation, flatten, dense, dropout, conv2D and maxpooling. Dense layer is used
to interconnect all the layers that return the output as the input for the next layer. Dropout
layer is used to remove the unwanted neurons present in the neural network. It will reduce the
overloading the images during the training period. Flatten is used to collapse or merge the
image into one dimensional array or D array. It automatically extracts the features of the
image. Maxpooling is 2D spatial layer which is used to extract exact image feature by
reducing the dimension. Pooling is used to avoid over fitting. By using this original image is
converted into quarter the size of original image. Activation is used to increase the non-linear
property of the image. After this, activation is connected to the pooling layer.

Fig 9: prediction statistics display

32
After applying the images to the layer, testing process takes place. Result is obtained by using
the prediction taken place in the test. Accuracy of the data frame is obtained. Based on that
accuracy, training result is gathered.

Training the model:

Fig 10: model training

Training is given to the model for accuracy. In order to improve the initial statement of the
project, pre-training is given to the deep belief algorithm. Proper training should be given to
each network for obtaining results with accuracy. Improper training results in unsuccessful
result. In this X train and y train have to be deleted often in order to free up the RAM.

Fig 11: time taken to display the model

Images are passed to the deep layer in order to provide training. The time taken to load the
image and to provide training in the deep learning algorithm takes up to 1312 seconds. The
input of the sigmoid is represented in binary format either as 0 or 1. After successful training,
the accuracy of the uploaded image is obtained. Compare accuracy of the obtained image
with the validated image accuracy. Thus result shows the distribution of various type of fruits
and vegetable images. The outputs are represented in the graphical manner. Network consist
of various loss function, the loss in the network can be reduced by using the software softmax
and sigmoid cross entropy. Information loss of the images can be reduced by using padding

33
function. Each steps implemented gives a desired output based on their constraints. The
output shows 94.75% accuracy.

4.5 Result and discussion


This section give brief discussion about the result obtained in fruit recognition by using
Convolutional neural network. To perform a task, datasets containing different fruits and
vegetables images are extracted from the source. Required libraries are exported in order to
perform the process. The extracted data’s which are said to bad is corrupted in pre-processing
stage. Proper training is given for the model to give high accuracy. Then the data are tested,
by showing comparison between original image and resized image. Finally, the result is
obtained by testing. In neural network, trained model is uploaded and the images are
classified by using the tensor flow libraries.

Fig 12: classification of fruits

Above image represent the classification of fruits and vegetables. The listed images are
tomato, persimmon, banana, mango, peach, petya and orange. Each fruit is classified based
on their path and label. The numbers given to each fruit will helps to identify the fruit easily.

34
Fig 13: fruit types distribution

The above image represents the distribution of different types of fruits. The distributed fruit
varieties are apple, kiwi, mango, guava, banana, orange, pear, peach, pitaya, plum, tomatoes,
pomegranate, carambola, muskmelon, and persimmon. From the result, it is clearly noticed
that apple reached highest distribution while persimmon, muskmelon and carambola found to
be lowest which is in same level.

Fig 14: accuracy vs


validation accuracy graph

The above images show the graph between accuracy of the original image and accuracy of
the validated image. The graph shows range of the image in the form of epoch and accuracy.
Blue line indicates the accuracy of the image while orange line indicates the accuracy of the
validated image. It represents both loss and accuracy of the image. This results the image
recognition with high accuracy and efficiency.

4.6 Challenges
The major issue faced by fruit recognition using deep neural network is MNIST benchmark.
In this project the fruit 360 dataset consist of large number of datasets with different classes
of image. Hence the dataset in this project is to be specific. The task is based on fruit
recognition. The computer will face a challenge because there are large number of fruits
classification in the dataset. Another issue is different types of fruits to be identified, then
fruits with different varieties to be identified. Padding is used to neglect the loss. Pooling
layer is used to avoid over fitting.

35
4.7 Conclusion
In this project, recognition of fruits is done by using deep learning neural network. Numerous
experiments had done in order to classify the fruits based on their content. Aspect of this
project is to recognize the fruits with high accuracy and with less loss rate. While deep
learning is major step in image processing. Convolutional neural network is analysed by
using various layers like convolutional layer, pooling layer, fully connected layer and loss
layer, where convolutional layer is followed by Rectified neural layer. A dataset is collected
from the source kaggle, because the data from other website does not gives clear image. By
using the pre-processing technique, bad files file can be removed. By using the open source
software jupyter, the data are collected. Tensor flow library is used for testing and training
the data’s. By using the neural network, the images are classified as apple, orange, banana
etc. Recurrent neural network algorithm is used to apply the same data repeatedly. Materials
and methodology discussed in above section helps to know the brief explanation about the
convolutional neural network. Design and analysis is done in order to recognise the fruits
with high accuracy. The feature of using RUL will makes an advantage over other networks
because it will notice the image structure during the pre-processing stage. Google colab is
used to overcome the issues found in the fruit recognition project.

Implementation section describes the steps taken to implement the project. Outcomes have
been obtained from the implementation process and results are discussed in better manner.
Many research has done in order to classify the fruits and researchers have stated their
opinion based on their view. But fruit recognition by using deep learning provides better
result. The accuracy of this fruit recognition by using deep neural network algorithm is found
to be 94.75%. This project will reduce the manpower, less time consuming and will helps to
access the fruits in the supermarket, in agricultural area easily. The results are found with
high accuracy. The future research undertakes the issues facing in this project and will be
overcome.

4.8 Summary
In this section clear view about the project is discussed. At first the design for making the
project is done. Implementation by using tensor flow libraries is clearly explained in step by
step manner. Next the result is analysed and evaluated according to their constraints. The
outcome is found to be good with accuracy of about 94.75%. Next, the challenges that occurs

36
by using the Deep neural is discussed along with solutions. Finally, conclusion gives the
detailed summary about the project with desired output.

37

You might also like