Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Paper Final PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/330154837

Ripeness Classification of Bananas Using an Artificial Neural Network

Article · January 2019


DOI: 10.1007/s13369-018-03695-5

CITATIONS READS

88 9,117

2 authors:

Fatma Mazen Ahmed Nashat


Faculty of Engineering Fayoum University
3 PUBLICATIONS   107 CITATIONS    14 PUBLICATIONS   236 CITATIONS   

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Fatma Mazen on 05 January 2019.

The user has requested enhancement of the downloaded file.


Arabian Journal for Science and Engineering
https://doi.org/10.1007/s13369-018-03695-5

RESEARCH ARTICLE - ELECTRICAL ENGINEERING

Ripeness Classification of Bananas Using an Artificial Neural Network


Fatma M. A. Mazen1 · Ahmed A. Nashat1

Received: 18 August 2018 / Accepted: 19 December 2018


© King Fahd University of Petroleum & Minerals 2019

Abstract
The quality of fresh banana fruit is a main concern for consumers and fruit industrial companies. The effectiveness and fast
classification of banana’s maturity stage are the most decisive factors in determining its quality. It is necessary to design and
implement image processing tools for correct ripening stage classification of the different fresh incoming banana bunches.
Ripeness in banana fruit generally affects the eating quality and the market price of the fruit. In this paper, an automatic
computer vision system is proposed to identify the ripening stages of bananas. First, a four-class homemade database is
prepared. Second, an artificial neural network-based framework which uses color, development of brown spots, and Tamura
statistical texture features is employed to classify and grade banana fruit ripening stage. Results and the performance of the
proposed system are compared with various techniques such as the SVM, the naive Bayes, the KNN, the decision tree, and
discriminant analysis classifiers. Results reveal that the proposed system has the highest overall recognition rate, which is
97.75%, among other techniques.

Keywords Image segmentation · Features extraction · Ripening of bananas · Fruit maturity detection · Computer vision ·
Artificial neural network

1 Introduction develop as the acid and protein composition changes, and


the fruit’s texture softens as the substances that hold up its
Banana is one of the most consumed fruits globally. It con- cell walls begin to break down. All these changes make the
tributes about 16% of the world’s fruit production according banana fruit ripe and ready to eat. Ripening treatment of
to FAO. Maturity stage of fresh banana fruit is a principal banana is accomplished globally with controlled humidity,
factor that affects the fruit quality during ripening and mar- suitable temperature, time, air flow, and using ethylene gas.
ketability after ripening. The ability to identify maturity of To ensure the productivity, competitivity, quality stan-
fresh banana fruit will boost farmers to optimize harvesting dards, and reliability of banana fruit products, automatic
phase which helps to avoid harvesting either over-matured image processing tools based upon intelligent techniques
or under-matured banana. Early in the ripening process, are paramount over visual features methods. Such machine
the banana fruit synthesizes compounds such as alkaloids vision system has the advantage in making decisions at a very
and tannins. These fight infections and cause the under-ripe fast rate. This paper is intended first to generate a database
banana fruit to taste bitter and astringent. As banana fruit for the Egyptian banana species with different ripening lev-
continues to grow, its storage cells expand, engorging it with els such as unripe, ripe, and overripe. Then, new efficient
water, sugars, starches, organic acids, vitamins, and min- ripening level determination algorithms are presented. The
erals, and its skin turns from green to yellow with brown proposed techniques are based on HSV color, development
spots. Starch and acid contents decrease, while sugar con- of brown spots, and texture analysis of the banana fruit.
tent increases, and alkaloids and tannins disappear. Aromas

B Ahmed A. Nashat 2 Related Research


aan01@fayoum.edu.eg
Fatma M. A. Mazen In the literature, a lot of methods, which depend on shape,
fma04@fayoum.edu.eg
size, color, and texture features, have been developed for
1 Electronics and Communication Engineering Department, banana fruit ripening classification. First of these are the
Fayoum University, Fayoum 63514, Egypt color moments and the color histogram [1,2]. The mean and

123
Arabian Journal for Science and Engineering

the variance of the RGB, the HSV, and the CIELAB color 3D volumes reveals that the algorithm detects accurately the
spaces of the banana fruit intensity histograms are extracted ROI [13].
and analyzed. The system was able to correctly predict with Besides DWT, independent component analysis (ICA) is
more than 94% the seven ripening stages of the banana another feature extraction technique for detection and clas-
bunch. The seven ripening stages are the green, the green sification [14]. ICA maximizes the absolute value of the
with traces of yellow, more green than yellow, more yel- normalized kurtosis. It aims at capturing the statistical struc-
low than green, green tip and yellow, all yellow, and yellow ture in images that is beyond second-order information, by
flecked with brown. Secondly, the third and the fourth statis- exploiting higher-order statistical structure in data. It has
tical moments [3] can be used to classify the under-mature, proven a useful tool for finding structure and changes in
mature, and over-mature banana fruit classes. The classifica- fruit’s images. ICA seeks basis vectors that best fit the vari-
tion accuracy of this technique for the three classes reaches ance of the fruit’s images. In contrast, local binary pattern
99.1%. (LBP) is considered as a high-performance texture features
The accuracy of the banana fruit ripening classification technique [15]. It transforms an image into an array or image
class depends upon the used preprocessing segmentation of integer labels describing small-scale textures of the image.
algorithm. Segmentation is a vital step for many computer LBP and its variants produce long histograms, which slow
vision tasks. The technology of image segmentation is widely down the recognition speed. Local gradient code (LGC),
used in medical image processing, fruit industry, face recog- which is based on the relationship of neighboring pixels,
nition, pedestrian detection, etc. Discrete wavelet transform is proved to be more stable to local intensity variation, less
(DWT) and wavelet packet transform (WPT) have proven influenced by local color variation, and more distinctive than
to be effective in image compression, de-noising, segmenta- LBP [16]. The LGC is able to capture the locally changing
tion, and classification [4–6]. They span many disciplines. It gradient information, while LBP is globally invariant, since
is demonstrated that DWT and WPT could be used for 2D it only compares the central pixel value with the neighboring
images surface segmentation and 3D images volume seg- pixel value.
mentation [7–11]. On the other hand, learning-/trained-based classifiers
Two-dimensional DWT is used as a multi-resolution anal- require an intensive training phase of the classifier param-
ysis tool for segmenting and classifying healthy and damaged eters, and hence a higher recognition rate is obtained.
fruits while they are moving in a conveyor belt [9,11]. It has Examples are the support vector machine [17] (SVM), the
demonstrated that DWT distinguishes the healthy green olive hidden Markov model [16] (HMM), and the artificial neural
fruits from the damaged fruits with accuracy of 90% [9], network [18–22] (ANN).
while the recognizer can identify the healthy brown, light or As an application of the supervised classification tech-
deep, or the healthy black olive fruits with accuracy of about niques, it was demonstrated that laser light backscattering
78% [9]. Texture homogeneity measuring technique, which imaging (LLBI) with five laser diodes emitting at wave-
is based on measuring the degree of homogeneity of adjacent lengths 532, 660, 785, 830, and 1060 nm could be employed
pixels, and the special image convolution algorithm, which for predicting quality attributes of banana fruit [23,24]. The
uses special kernels or masks to perform image convolution, predicted attributes were chlorophyll, elasticity, and soluble
are another 2D texture feature algorithms for detecting, clas- solids content (SSC). A correct classification accuracy of
sifying, and calculating automatically the external defects of 92.5% and 95.5% was claimed using the ANN model and
fruits and its area [12]. It is shown that [12] the classification the SVM model, respectively. In [19,20], a computer vision
accuracy of these algorithms is higher than the 2D fuzzy C- system that uses gray-level co-occurrence matrix (GLCM)
means algorithm by 7%, for the healthy olives, whereas it is texture features is proposed to train an artificial neural net-
higher by 9% for defected olives. work. The system can be used to sort banana at an accuracy
Additionally, it is illustrated that 3D DWT and WPT of 98.8%.
could be used for medical 3D images volume segmenta- SVMs, HMMs, and ANNs are used for supervised learn-
tion and for tumor quantification and measurement and thus ing tasks and classification. However, deep learning models
radio therapy planning and cancer diagnosis [7,8]. Three- can be trained in an unsupervised manner for unsupervised
dimensional volume segmentation aims at partitioning the learning tasks. Convolutional neural network [18] (CNN) is
voxels into 3D objects (sub-volumes) which represent mean- a class of deep learning neural networks and has acquired
ingful physical entities. The 3D wavelet domain detected a broad application in image classification. It is a powerful
the objects with better accuracy and reduces the percent- visual model that yields hierarchies of features. It is demon-
age error by several percent more than the traditional 2D strated that CNN architecture of 17,312 images of bananas
segmentation techniques [8]. Besides the 3D DWT volume produces a classification accuracy of 94.4% [18].
segmentation, unsupervised 3D fuzzy C-means clustering In this paper, we propose a novel ANN adapted to fine-
algorithm to extract region of interest, ROI, for objects in grained feature-based representation for classifying ripening

123
Arabian Journal for Science and Engineering

stages of the Egyptian banana’s species. To show the power Image Acquisition
of the proposed classification system, we create a database,1
comprising of 300 Egyptian banana images, with different Image Pre-processing
ripening levels such as unripe (green banana), yellowish
green, mid-ripe, and overripe. The proposed scheme makes
Extracting Banana Fruit from
use of the Tamura’s contrast, coarseness, and the direction Background & Brown Spots
visual perceptual texture features to correct labeling the
data [25,26]. The rest of the paper is organized as follows:
Extracting Texture Features
Sect. 3 illustrates the basic principles of the proposed sys-
tem for classifying the different banana’s ripening stages. In
Banana Ripening
Sect. 4, the proposed classification system is tested and com- Classification
pared against other supervised classification algorithms, such
as SVM, naive Bayes, KNN, decision tree, and discriminant Fig. 1 Steps of the proposed algorithm
analysis classifiers. Finally, Sect. 5 offers the conclusion.

3 The Proposed Banana’s Ripening


Classification System

The determination of the ripeness state of banana fruits is


an essential element in the agriculture research field. This
is because ripeness is related to quality and it can affect the
commercialization of the product. Manual approach is often
Fig. 2 Samples of different banana fruits. a, b Are for the green bananas,
used in product grading and quality control, but this leads
c, d are for the yellowish green bananas, e, f are for the mid-ripe bananas,
to uneven products, higher time expense, and fatigue by the g, h are for the overripe bananas
human operators. Therefore, we propose in this article, a
ripening identification system that performs the visual per-
ception of the human operator in making decisions at a very yellowish bananas, 97 mid-ripen bananas, and 42 over-
fast rate. A computer vision system for ripening classifica- ripen bananas.
tion of banana fruits is realized generally based on several 2. Image Preprocessing The database goes through some
processes. Figure 1 underlines the major signal processing preprocessing steps before training and testing the arti-
steps. The algorithm begins with image acquisition. Then, ficial neural network. First, a guided filter is applied to
these images go through preprocessing operations to be ready perform edge preserving and smoothing on the banana
for analysis. The main module for computer vision machines image. Second, the RGB banana image is then converted
is the image segmentation followed by image classification. to HSV color space. The HSV model describes colors
An artificial neural network is then used for ripening clas- similarly to how the human eye tends to perceive color.
sification decision, which depends upon color and Tamura The HSV, also, is used to separate image luminance from
statistical texture features. Details of the proposed algorithm color information. In RGB, color information cannot be
stages are presented in Fig. 1. separated from luminance. Third, morphological filtering
is used to enhance the image. These operations include
1. Samples Collections and Images Acquisition A database dilation, which fills gaps between pixels of edges and
of Egyptian banana species with different ripening lev- erosion, which suppresses structures in the background.
els is created. The database is comprised of 300 banana 3. Banana Fruit Segmentation This module has two phases.
images, with different ripening levels such as unripe It, first, extracts banana fruit from the background. This
(green banana), yellowish green, mid-ripe, and overripe. is done by assigning a global threshold using Otsu’s
All these samples are collected by a digital Samsung Note method. Pixels in the input image with luminance greater
3 color camera. The camera is a HD format with 4128 than the threshold are replaced with the value 0 (black),
(h) × 3096 (v) pixels and a 30 frames/s with full resolu- and all other pixels are replaced with the value 1 (white).
tion. Figure 2 shows samples of banana fruits of different Figure 3 shows the mask that is used for segmentation.
ripening levels. The dataset has 104 green bananas, 57 A function is, then, implemented to restore the original
input banana fruit image. This is done by reading the
1 https://drive.google.com/drive/folders/1nRWBYAHNRqmL4R0SLr constructed binary mask image pixel by pixel. A pixel
s6dbGQFSWGVY8V?usp=sharing. is recognized as a background, if its level value is zero.

123
Arabian Journal for Science and Engineering

σ μ4
Contrast = , and α4 = 4 , (2)
(α4 )0.25 σ

where μ4 is the fourth moment about the mean and σ 2


is the variance. On the other hand, coarseness, defined
in [25], basically relates to distances of notable spatial
variations of gray levels, which is implicitly related to
the number and the size of primitive elements form-
ing the texture. It has the direct relationship to scale
and repetition rates. It is expected that coarseness of the
four banana fruit classes to be within the same range,
since the peel of banana fruits of the four classes is
characterized by having many small primitives, with a
Fig. 3 Segmentation of the four classes of banana fruits and extraction high degree of local variations of gray levels. In con-
of brown spots. The first column is the input image, the second column is
the segmentation mask, the third column is the segmented banana fruit,
sequence, the coarseness feature is excluded from the
and the fourth column is the segmented banana fruit without brown input of the proposed artificial neural network. Another
spots very important characteristic of the texture image is
the distributing trait of texture directions. This fea-
ture refers the shape of texture primitives and their
Otherwise, equate the level value of that pixel with the placement rule. The directionality [25] is obtained by
original one. The segmented banana fruit images for the examining the sharp degree of a histogram which is con-
four classes are shown in the third column of Fig. 3. structed from the gradient vectors of all the image pixels.
The second phase of this module is to calculate the The banana ripeness classification algorithm is as fol-
ripeness factor of the banana fruit. The ripeness factor lows:
(RF) of the banana fruit is defined as:
• Compute the texture feature vector, F, for each train-
ing banana image.
Banana’s Ripeness Factor (RF)
Total Area of the Brown Spots
= , (1) F = [Contrast Directivity HSV RF]. (3)
Total Area of the Banana

where the total area of the banana is given by the total The thresholds of the HSV color space for the four
number of white pixels of the banana fruit segmentation classes of banana fruits are obtained based upon analogy
mask. To calculate the total area of the brown spots, a new between HTML color codes and various natural colors
color mask is performed on the segmented image to detect of banana peels of different classes under an outstand-
the brown spots on the banana peel. The brown color is ing illumination. The green banana fruits are featured
characterized by having H = 30◦ or 8.33%, 66.7% ≤ as having 72◦ ≤ H ≤ 78◦ , 85% ≤ S ≤ 100%, and
S ≤ 67.6%, and 4.7% ≤ V ≤ 60%. The white segments 27% ≤ V ≤ 50%. Light green bananas are picked
in the fourth column of Fig. 3 represent the brown regions and cured before they have ripened. At the beginning
of the banana peel. The total area of the brown spots in of the ripening cycle, the chlorophyll in the peel breaks
the banana fruit is given by the total number of white down and the starch within the fruit is converted into
pixels within the segmented banana peel. simple sugars. As a result, the peel turns yellow hue
4. Extracting Texture Features Besides the color-based anal- with brown spots and the fruit softens up and becomes
ysis method for ripeness index calculation, texture-based sweet. The yellow banana fruits are featured as having
techniques help in surface, shape, and banana class deter- 50◦ ≤ H ≤ 72◦ , 70% ≤ S ≤ 100%, and 79% ≤ V ≤
mination. Statistical texture analysis is the most popular 100%. The ethylene gas emitted by the fruit causes the
method used for image recognition. Tamura contrast, yellow pigments in bananas to decay into golden yellow
coarseness, and direction features are three quantitative with more brown spots in a process called enzymatic
second-order statistical texture measures for image clas- browning. The golden yellow or mid-ripen banana is
sification. They are based on psychological studies of characterized by 39◦ ≤ H ≤ 50◦ , 69% ≤ S ≤ 96%,
human perception. Contrast, defined by Eq. 2, measures and 75% ≤ V ≤ 100%. The last phase of the ripening
the way in which gray levels vary in the image and cycle of the banana is the yellowish brown or overripen
between neighboring pixels and to what extent their dis- banana. The banana peel looks deep brown with dark
tribution is biased to black or white. streaks.

123
Arabian Journal for Science and Engineering

Hidden Layer Output Layer


Read the training dataset
Input Output
Pre-processing Operations:
guided filter - HSV color space
4 4
- morphological filtering

10 4
Banana fruit segmentation
Fig. 4 Architecture of the proposed artificial neural network
Extracting color and
Tamura texture features
• A different measure value of the vector F is obtained
for each banana ripening class.
Calculation of the ripeness coefficient
5. Banana Ripening Classification Figure 4 shows a block
diagram for the proposed classifier.
The Levenberg–Marquardt backpropagation optimiza- 72≤H≤78
Banana is
tion algorithm is used for training the suggested artificial Yes 40.8≤Cn≤50.32
green and
neural network. The input layer of the model is made classified as
1.95≤D≤2.53
up of four neurons. These are the quality indices of the class 1 0.02≤RF≤0.06
vector F, defined by Eq. 3. The model has ten hidden
layers. The sigmoid function is used as the activation
No
function because of its simplicity in derivative and its
soft switching capability. The number of neurons of the Banana is 50≤H<72
output layer is four, which represents the four ripening yellowish Yes 28.74≤Cn≤39.1
levels. The output layer produces the actual output of green and 1.8≤D≤2.37
the neural network which is then subtracted from the classified as 0.05≤RF≤0.2
desired output (target) to produce the error. The mean class 2
squared error is used as a performance function and
No
is sent back into the network hidden layers to update
the weighted sum of the input and bias of each neu- 39≤H<50
Banana is
ron. mid-ripen Yes 27.1≤Cn≤38.85
In this work, the training dataset is 70% of the total and classified 1.1≤D≤1.7
dataset, while the testing dataset carried the remaining as class 3 0.25≤RF≤0.45
percentage. Therefore, out of 300 images as the actual
dataset, 74 (green bananas), 40 (yellowish bananas), No
67 (mid-ripen bananas), and 30 (overripen bananas)
Banana is overripen
are used as the training set, while the remaining 30 and classified as class 4
(green bananas), 17 (yellowish bananas), 30 (mid-ripen
bananas), and 12 (overripen bananas) are used as the test-
ing set. Figure 5 shows the flowchart of our proposed Build and train a
neural network
neural network system for training and testing banana
fruits.
Load the test dataset

Classification of the test dataset


based on the trained neural network
4 Experiment Results and Discussion
Fig. 5 Flowchart of the proposed classification neural network model
To test the performance of the banana’s ripening classifica-
tion system, 89 banana fruits of assorted colors and shapes fruit classes is about the same. In consequence, it will be
are selected for testing. Table 1 shows results of the texture excluded from the feature vector (F) and from the input of
feature vector (F), described by Eq. 3, for the 211 trained the proposed artificial neural network. Table 1, also, distin-
banana fruits. As expected, the coarseness of the four banana guishes between the four classes of banana fruits in terms of

123
Arabian Journal for Science and Engineering

Table 1 Texture features of the 211 training banana fruits for different classes
Texture features Class 1 Class 2 Class 3 Class 4
Green Yellowish green Mid-ripen Overripen

Coarseness (Cr) 57.84 ≤ Cr ≤ 58.44 57.56 ≤ Cr ≤ 58.85 57.51 ≤ Cr ≤ 58.87 57.48 ≤ Cr ≤ 58.52
Contrast (Cn) 40.8 ≤ Cn ≤ 50.32 28.74 ≤ Cn ≤ 39.1 27.1 ≤ Cn ≤ 38.85 41.7 ≤ Cn ≤ 50.42
Directivity (D) 1.95 ≤ D ≤ 2.53 1.8 ≤ D ≤ 2.37 1.1 ≤ D ≤ 1.7 1.29 ≤ D ≤ 1.9
Hue color space (H ) 72 ≤ H ≤ 78 50 ≤ H < 72 39 ≤ H < 50 39 ≤ H < 50
RF 0.02 ≤ RF ≤ 0.06 0.05 ≤ RF ≤ 0.2 0.25 ≤ RF ≤ 0.45 RF ≥ 0.7

Table 2 Texture features that differentiate banana fruits classes


Class 1 Class 2 Class 3 Class 4
Green Yellowish green Mid-ripen Overripen

Class 1 – Hue color space & Hue color space & Hue color space &
RF & contrast RF & contrast RF & directivity
Class 2 Hue color space & – Hue color space & Hue color space &
RF & contrast RF & directivity RF & contrast
Class 3 Hue color space & Hue color space & – Contrast & RF
RF & contrast RF & directivity
Class 4 Hue color space & Hue color space & Contrast & RF –
RF & directivity RF & contrast

the contrast, the directivity, the hue color space values, and Sensitivity and precision are two statistical performance
the RF values. Each class is discriminated from the other one measures for classification tests. Sensitivity is defined as the
utilizing only three features out of the four, while each class ability of the prediction model to select the instance of a
is distinguished from the others using all features. certain class from the dataset. It is the proportion of the actual
Table 2 shows the used texture features that discriminate positive classes which are correctly identified. On the other
the four banana classes. It is seen that values of the hue color hand, precision is defined as the proportion of the predicted
space, the RF, and Tamura’s contrast features are used to positive classes which are correctly identified. They are given
discriminate class 1 and class 2 bananas, and similarly class by:
1 and class 3 bananas as well as class 2 and class 4 bananas.
However, class 1 and class 4 are differentiated according TP
Sensitivity = , and (4)
to the values of the hue color space, the RF, and Tamura’s (TP + FN)
directivity, and likewise class 2 and class 3 bananas, whereas TP
Precision = , where (5)
class 3 and class 4 bananas are separated according to values (TP + FP)
of the contrast and the RF only.
Table 3 shows the confusion matrix for the proposed TP, FP, and FN are the numbers of the true positive, the false
banana fruits classification model using the artificial neural positive, and the false negative predictions for the considered
network. The model achieves a 97.75% overall correctness or class, respectively. Both the neural network and the decision
recognition rate. Tables 4, 5, 6, 7, and 8 show the confusion tree classifiers have a sensitivity of 100% for classes 1, 2,
matrices for some other supervised classification algorithms. and 4. However, the sensitivity of the third class dropped
In this work, the performance of the SVM, the naive Bayes, to 93.3% for both classifiers. This is because two mid-ripen
the k-nearest-neighbors, the decision tree, and the discrimi- banana fruits are misclassified as yellow banana fruits for
nant analysis classifiers is compared with the ANN classifier. the ANN and misclassified as overripen banana fruits for the
Simulation results show that the overall correctness or the decision tree classifier. Additionally, simulation results show
model classification accuracy and the class sensitivity of the that the ANN-predicted classes are more precise than that of
SVM, the naive Bayes, the KNN, and the discriminant anal- the decision tree classifier.
ysis classifiers are less than the proposed artificial neural Specificity and overall class prediction accuracy are other
classification system and the decision tree classifier. Accord- useful statistical measures that describe the performance of
ingly, these classifiers are excluded from analogy and not a classifier. They are used for binary classifiers. Specificity
discussed further in this work. is defined as the proportion of actual negative classes (all
except the positive class) which are correctly identified, while

123
Arabian Journal for Science and Engineering

Table 3 Confusion matrix for


Actual class Predicted class Class sensitivity %
the proposed artificial neural
network Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 17 0 0 100
Class 3 0 2 28 0 93.3
Class 4 0 0 0 12 100
Class precision % 100 89.5 100 100 Overall correctness = 97.75%

Table 4 Confusion matrix for


Actual class Predicted class Class sensitivity %
the SVM classifier
Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 14 3 0 82.4
Class 3 0 0 30 0 100
Class 4 0 0 0 12 100
Class precision % 100 100 90.9 100 Overall correctness = 96.6%

Table 5 Confusion matrix for


Actual class Predicted class Class sensitivity %
the naive Bayes classifier
Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 17 0 0 100
Class 3 0 4 26 0 86.6
Class 4 0 0 0 12 100
Class precision % 100 81 100 100 Overall correctness = 95.5%

Table 6 Confusion matrix for


Actual class Predicted class Class sensitivity %
the KNN classifier
Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 17 0 0 100
Class 3 0 4 26 0 86.6
Class 4 0 0 0 12 100
Class precision % 100 81 100 100 Overall correctness = 95.5%

Table 7 Confusion matrix for


Actual class Predicted class Class sensitivity %
the decision tree classifier
Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 17 0 0 100
Class 3 0 0 28 2 93.3
Class 4 0 0 0 12 100
Class precision % 100 100 100 85.7 Overall correctness = 97.75%

123
Arabian Journal for Science and Engineering

Table 8 Confusion matrix for


Actual class Predicted class Class sensitivity %
the discriminant analysis
classifier Class 1 Class 2 Class 3 Class 4

Class 1 30 0 0 0 100
Class 2 0 15 2 0 88.2
Class 3 0 0 30 0 100
Class 4 0 0 0 12 100
Class precision % 100 100 93.75 100 Overall correctness = 97.75%

Table 9 Binary confusion matrix for the proposed artificial neural network
Actual class Predicted class
Class 1 Not class 1

Class 1 TP = 30 FN = 0 Sensitivity = 100%


Not class 1 FP = 0 TN = 59 Specificity = 100%
Precision = 100% Negative predictive value = 100% Overall prediction accuracy = 100%

Class 2 Not class 2

Class 2 TP = 17 FN = 0 Sensitivity = 100%


Not class 2 FP = 2 TN = 70 Specificity = 97.2%
Precision = 89.5% Negative predictive value = 100% Overall prediction accuracy = 97.75%

Class 3 Not class 3

Class 3 TP = 28 FN = 2 Sensitivity = 93.3%


Not class 3 FP = 0 TN = 59 Specificity = 100%
Precision = 100% Negative predictive value = 96.7% Overall prediction accuracy = 97.75%

Class 4 Not class 4

Class 4 TP = 12 FN = 0 Sensitivity = 100%


Not class 4 FP = 0 TN = 77 Specificity = 100%
Precision = 100% Negative predictive value = 100% Overall prediction accuracy = 100%
TP, TN, FN, and FP stand for true positive events, true negative events, false negative events, and false positive events

overall class prediction accuracy is defined as the proportion the two models is about the same. Three classes out of four
of the total number of predictions that were correct. They are have 100% specificity. The remaining class has 97.2% speci-
given by: ficity for the ANN classifier, while it is 97.4% for the decision
tree classifier. Hence, the two classifiers have the ability to
correctly distinguish a banana fruit not from the right class.
TN Tables 9 and 10, also, show that the overall class prediction
Specificity = . (6)
(TN + FP) accuracy for the proposed ANN and decision tree classifica-
TP + TN tion models is the same. Accordingly, the classification of the
Overall Prediction Accuracy = .
(TP + TN + FP + FN) banana fruits is highly correct and true and the misclassifica-
(7) tion rate, which is the complement of the prediction accuracy,
is minimum.
To demonstrate the performance of the proposed ANN Figures 6 and 7 show the receiver operating characteristic
classification model and the supervised decision tree classi- (ROC) curves for the proposed ANN and the decision tree
fier, the (4 × 4) confusion matrices, shown in Tables 3 and 7, classifiers. ROC is a metric used to check the quality of the
are transformed to four (2 × 2) confusion matrices. Tables 9 classifier. It is the TP rate or the sensitivity against the FP rate
and 10 show the four binary confusion matrices, each for a or (1-specificity), which is the probability of false alarm, for
different banana fruits class, for the ANN and the decision the different possible cut-points of the test dataset. The pro-
tree classifiers, respectively. Results show that specificity for posed ANN classifier is perfectly accurate for classes 1, 2,

123
Arabian Journal for Science and Engineering

Table 10 Binary confusion matrix for the decision tree classifier


Actual class Predicted class
Class 1 Not class 1

Class 1 TP = 30 FN = 0 Sensitivity = 100%


Not class 1 FP = 0 TN = 59 Specificity = 100%
Precision = 100% Negative predictive value = 100% Overall prediction accuracy = 100%

Class 2 Not class 2

Class 2 TP = 17 FN = 0 Sensitivity = 100%


Not class 2 FP = 0 TN = 72 Specificity = 100%
Precision = 100% Negative predictive value = 100% Overall prediction accuracy = 100%

Class 3 Not class 3

Class 3 TP = 28 FN = 2 Sensitivity = 93.3%


Not class 3 FP = 0 TN = 59 Specificity = 100%
Precision = 100% Negative predictive value = 96.7% Overall prediction accuracy = 97.75%

Class 4 Not class 4

Class 4 TP = 12 FN = 0 Sensitivity = 100%


Not class 4 FP = 2 TN = 75 Specificity = 97.4%
Precision = 85.7% Negative predictive value = 100% Overall prediction accuracy = 97.75%
TP, TN, FN, and FP stand for true positive events, true negative events, false negative events, and false positive events

1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6
TP rate

TP rate

0.5 0.5

0.4 0.4

0.3 0.3

0.2 Class 1 0.2 Class 1


Class 2 Class 2
Class 3 0.1 Class 3
0.1
Class 4 Class 4
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

FP rate FP rate

Fig. 6 ROC of the proposed ANN classification model Fig. 7 ROC of the decision tree classification model

and 4, since the area under the ROC curve equals to one. sure of separability between classes than the other supervised
However, the area under the curve for the third class is 0.99, classification algorithms.
which is very close to one. On the other hand, the decision
tree classifier is perfectly accurate for classes 1 and 2, since
the area under the curve is one. However, it is less accurate 5 Conclusion
than the ANN classifier for the other classes, since the area
under the curve for the third class is 0.965 and 0.985 for the An artificial neural network-based system for the classifica-
fourth class. Hence, the ANN model is better than the deci- tion of ripeness state of banana fruits has been discussed.
sion tree classifier in distinguishing between the right class The proposed model uses Tamura’s texture features and a
and not the right class. The ANN model has a perfect mea- new feature defined as ripening factor to properly discrimi-

123
Arabian Journal for Science and Engineering

nate between the four banana fruits classes. The system has 11. Khoje, S.A.; Bodhe, S.K.; Adsul, A.: Automated skin defect
optimal performance as compared with other supervised clas- identification system for fruit grading based on discrete curvelet
transform. Int. J. Eng. Technol. 5(4), 3251–3256 (2013)
sification algorithms as the SVM, the naive Bayes, the KNN, 12. Hussain Hassan, N.M.; Nashat, A.A.: New effective techniques
the decision tree, and the discriminant analysis classifiers. for automatic detection and classification of external olive fruits
The overall class recognition accuracy of 100% is obtained defects based on image processing techniques. Multidimens.
for the green and overripen classes, while it is 97.75% for Syst. Signal Process. (2018). https://doi.org/10.1007/s11045-018-
0573-5
the yellowish green and mid-ripen classes. The simplicity, 13. Al-Zu’bi, S.; Al-Ayyoub, M.; Jararweh, Y.; Shehab, M.A.:
the high recognition rate, and the speed of the classification Enhanced 3D segmentation techniques for reconstructed 3D medi-
model, 18 s for the 89 test bananas, make it appropriate for cal volumes: robust and accurate intelligent system. Proc. Comput.
implementing a productive and profitable computer vision Sci. 113, 531–538 (2017)
14. Déniz, O.; Castrillon, M.; Hernández, M.: Face recognition using
machine for the food processing industry. independent component analysis and support vector machines. Pat-
Future directions will focus on applying 3D volume seg- tern Recogn. Lett. 24(13), 2153–2157 (2003)
mentation techniques, transfer learning, and deep learning 15. Zhao, G.; Pietikainen, M.: Dynamic texture recognition using local
methods to supervised/semi-supervised machine learning binary patterns with an application to facial expressions. IEEE
Trans. Pattern Anal. Mach. Intell. 29(6), 915–928 (2007)
algorithms to enhance the classification rate and to mini- 16. Nashat, A.A.: Facial expression recognition using best tree RD-
mize the training and the testing run time for banana fruits LGP encoded features and HMM. Int. J. Wavelets Multireso-
classification application. lut. Inf. Process. 16(6), 1850047 (2018). https://doi.org/10.1142/
S0219691318500479
17. Juncai, H.; Yaohua, H.; Lixia, H.; Kangquan, G.; Satake, T.: Clas-
sification of ripening stages of bananas based on support vector
References machine. Int. J. Agric. Biol. Eng. 8(6), 99–103 (2015)
18. Zhang, Y.; Lian, J.; Fan, M.; Zheng, Y.: Deep indicator for fine-
1. Mendoza, F.; Dejmek, P.; Aguilera, J.M.: Predicting ripening stages grained classification of banana’s ripening stages. EURASIP J.
of bananas (Musa cavendish) by computer vision. Acta Hortic. Image Video Process. 46, 1–10 (2018). https://doi.org/10.1186/
682(183), 1363–1370 (2005) s13640-018-0284-8
2. Mendoza, F.; Aguilera, J.M.: Application of image analysis for 19. Olaniyi, E.O.; Adekunle, A.A.; Odekuoye, T.; Khashman, A.:
classification of ripening bananas. J. Food Sci. 69(9), 471–477 Automatic system for grading banana using GLCM texture fea-
(2004) ture extraction and neural network arbitrations. J. Food Process
3. Prabha, D.S.; Kumar, J.S.: Assessment of banana fruit maturity by Eng. 40(4), 1–10 (2017)
image processing technique. J. Food Sci. Technol. 52(3), 1316– 20. Olaniyi, E.O.; Oyedotun, O.K.; Adnan, K.: Intelligent grading sys-
1327 (2015). https://doi.org/10.1007/s13197-013-1188-3 tem for banana fruit using neural network arbitration. J. Food
4. AlZubi, S.; Islam, N.; Abbod, M.: Multiresolution analysis using Process Eng. 40, 1–9 (2017). https://doi.org/10.1111/jfpe.12335
wavelet, ridgelet, and curvelet transforms for medical image seg- 21. Espinoza, E.M.L.; Duran, M.T.; Morales, R.A.L.; Yepez, E.C.;
mentation. J. Biomed. Imaging (2011). https://doi.org/10.1155/ Robles, N.S.: Determination of the ripeness state of guavas using an
2011/136034 artificial neural network. Res. Comput. Sci. 121, 105–111 (2016)
5. Schelkens, P.; Munteanu, A.; Barbarien, J.; Galca, M.; Giro-Nieto, 22. Sabzi, S.; Gilandeh, Y.A.; Mateos, G.G.: A new approach for visual
X.; Cornelis, J.: Wavelet coding of volumetric medical data sets. identification of orange varieties using neural networks and meta-
IEEE Trans. Med. Imaging 22(3), 441–458 (2003) heuristic algorithms. Inf. Process. Agric. 5, 162–172 (2018)
6. Alzu’bi, S.; Amira, A.: 3D medical volume segmentation using 23. Adebayo, S.E.; Hashim, N.; Abdan, K.; Hanafi, M.; Mollazade,
hybrid multiresolution statistical approaches. Adv. Artif. Intell. K.: Prediction of quality attributes and ripeness classification of
(2010). https://doi.org/10.1155/2010/520427 bananas using optical properties. Sci. Hortic. 212, 171–182 (2016)
7. AlZubi, S.; Sharif, M.S.; Abbod, M.: Efficient implementation 24. Adebayo, S.A.; Hashim, N.; Abdan, K.; Hanafi, M.; Zude-Sasse,
and evaluation of wavelet packet for 3D medical image segmenta- M.: Prediction of banana quality attributes and ripeness classi-
tion. In: IEEE International Symposium on Medical Measurements fication using artificial neural network. In: Acta Horticulturae,
and Applications (2011). https://doi.org/10.1109/MeMeA.2011. Proceedings of the III International Conference on Agricultural and
5966667 Food Engineering, pp. 335–343 (2017). https://doi.org/10.17660/
8. AlZubi, S.; Jararweh, Y.; Shatnawi, R.: Medical volume seg- ActaHortic.2017.1152.45
mentation using 3D multiresolution analysis. In: International 25. Bagri, N.; Johari, P.: A comparative study on feature extraction
Conference on Innovations in Information Technology (IIT) (2012) using texture and shape for content-based image retrieval. Int. J.
9. Nashat, A.A.; Hussain Hassan, N.M.: Automatic segmentation Adv. Sci. Technol. 80, 41–52 (2015)
and classification of olive fruits batches based on discrete wavelet 26. Kebapci, H.; Yanikoglu, B.; Unal, G.: Plant image retrieval using
transform and visual perceptual texture features. Int. J. Wavelets color, shape, and texture features. Comput. J. 54(9), 1475–1490
Multiresolut. Inf. Process. 16(1), 1850003 (2018). https://doi.org/ (2011)
10.1142/S0219691318500030
10. Kumar, H.C.S.; Raja, K.B.; Venugopal, K.R.; Patnaik, L.M.: Auto-
matic image segmentation using wavelets. Int. J. Comput. Sci.
Netw. Secur. 9(2), 305–313 (2009)

123

View publication stats

You might also like