0% found this document useful (0 votes)
5 views8 pages

Classification of Some Fruits Using Imag

The study developed an image processing algorithm to classify fruits based on size and color, utilizing 300 samples from various apple and orange varieties. The classification achieved success rates of 88% to 100% across different fruit types, with machine learning algorithms like KNN and MLP showing high accuracy in training. This research aims to enhance post-harvest technology and reduce waste in fruit production through automated quality control methods.

Uploaded by

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

Classification of Some Fruits Using Imag

The study developed an image processing algorithm to classify fruits based on size and color, utilizing 300 samples from various apple and orange varieties. The classification achieved success rates of 88% to 100% across different fruit types, with machine learning algorithms like KNN and MLP showing high accuracy in training. This research aims to enhance post-harvest technology and reduce waste in fruit production through automated quality control methods.

Uploaded by

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

Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

DOI: https://doi.org/10.24925/turjaf.v9i12.2189-2196.4445

Turkish Journal of Agriculture - Food Science and Technology

Available online, ISSN: 2148-127X │www.agrifoodscience.com │ Turkish Science and Technology Publishing (TURSTEP)

Classification of Some Fruits using Image Processing and Machine Learning


Dilara Gerdan Koç1,a,*, Mustafa Vatandaş1,b
1
Department of Agricultural Machinery and Technologies Engineering, Faculty of Agriculture, Ankara University, 06110 Ankara, Turkey
*
Corresponding author
ARTICLE INFO ABSTRACT
In this study, an image processing algorithm and classification unit were developed to classify the
Research Article fruits according to their size and color characteristics. For this purpose, a total of 300 fruits (50 fruit
samples from each of the Starkrimson Delicious and Golden Delicious apple varieties, Washington
Navel and Valencia Midknight orange varieties, Ekmek and Eşme quince varieties) were used in
Received : 13/05/2021 the experiments. The size and color values measured with a caliper and a spectrophotometer were
Accepted : 26/11/2021 entered in the developed image processing algorithm to determine the success rates of classifying
the fruits. The integration of image processing algorithm with the classification unit classified 88%,
100%, 96%, 82%, 86%, respectively. On the other hand, the size and color values read in fruits with
the image processing algorithm were evaluated using predictive techniques used in data mining.
Keywords: For this purpose, K Nearest Neighbor (KNN), Decision Tree (DT), Naive Bayes classification and
Fruit classification Multilayer Perceptron Neural Network (MLP) algorithms were used. Algorithms were run with 10-
Image processing fold cross validation method. In the training of artificial classifiers, the success was 93.6% for KNN,
Real-time video processing 90.3% for DT, 88.3% for Naive Bayes, 92.6% for MLP and 94.3% for RF.
Machine learning
Post-harvest technology

a b [email protected] https://orcid.org/0000-0001-6733-4943
[email protected] https://orcid.org/0000-0002-2705-299X

This work is licensed under Creative Commons Attribution 4.0 International License

Introduction
The external features such as color, size, texture, According to the report of the Fresh Fruit and
different flaws and shape in the products to be offered to Vegetable Workshop published by the General Directorate
the market are important features in classification and of Agricultural Research and Policies in 2019, there was an
grading. One of the most important quality features in fruits increase of 24.03% in total fruit yield, 21.03% in the
and vegetables is their appearance. The appearance not production area and 50.11% in the production amount.
only affects the market value of the products, its However, this increase causes approximately 30-40% of
preferences and the choice of the consumer, but it also product to be wasted in total production due to wrong
affects the interior quality to a certain extent. Problems mechanization applications after harvest. Applications of
arising from processes such as classification, packaging post-harvest technologies can minimize the loss of fresh
and storage of fresh fruits and vegetables before they are fruits and vegetables from harvest to consumption, reduce
placed on the market determine the market price formation quantitative and qualitative losses, as well as maintain
and consequently affect the producer income (Pezikoğlu et product quality, such as nutritional value, physical
al 2004). Manual quality control of the fruit takes time and appearance and sensory properties. Some studies show that
labor intensive. Therefore, computerized vision systems there are large differences between post-harvest losses of
are widely used for automation-based external quality developing and developed countries, with estimated losses
control of food and agricultural products. Today, with between 2% and 23% (Singh et al 2014). Studies on image
advances in machine vision can produce accurate, fast, processing have continued from past to present. For
objective and efficient results in the non-destructive fruit example; some of the researcher were used image
classification due to the availability of low-cost hardware processing techniques for edge detection, feature
and software (Naik and Patel 2017). extraction and color detection of yellow, red and green
apples in their study on yield mapping in peach fruit, using
2189
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

image processing techniques such as histogram was 0.9763, and the root-mean-square error (RMS error)
thresholding and logarithm transformation, color, texture was 1.3243 mm.
and shape of images taken under natural conditions. In this study, apple, quince and orange fruit varieties
Feature extraction method has been used and algorithms were tried to be classified according to the color and size
have been developed. In the event that a fruit comes in front by developing an image processing algorithm.
of the camera, the system processes the image taken from
the camera and provides numerical and visual information Materials and Methods
about the size and color of the fruit examined on the screen
(Tonguç 2007; Kim et al 2009; Kurtulmuş et al 2014). The Biological Materials
researcher stated that some of the algorithms he developed In this study, apple, orange and quince varieties were
have been successful in determining the fruit at the level of used as biological materials. In studies on the classification
85%. Sungur and Özkan (2015) made a quality control of fruits using image processing techniques, the number of
application using MATLAB software to detect pollution in sample sizes taken varies between 43 and 948 (Örnek
chicken eggs and calculate egg volume. The researcher 2014; Yabanova and Yumurtacı 2018). Besides these
used the fuzzy logic algorithm to determine the degree of values, considering the statistical evaluation principles, the
quality. According to the results obtained, the algorithm sample number for each variety was determined as 50
developed works with 98% accuracy. Örnek (2014) fruits.
investigated the grading efficiency of the real-time image
processing system developed with transverse and Software and Measuring Devices
longitudinal roller-type mechanical carrot sorting LabVIEW (Laboratory Virtual Instrument Engineering
machines. The classification of carrots on a belt, which can Workbench) package program was used to develop image
speed adjusted by a geared motor with classification process algorithm. And digital caliper was used to measure
machine is based on the analysis of these images. fruit diameter values. The digital caliper is capable of
According to the results obtained, the ratio of carrots reading with a sensitivity of 1/100 mm. Xrite Ci60 model
falling to the faulty section in a transverse roll, a portable spectrophotometer was used to obtain color data
longitudinal roll and real time classification machine was from fruits. The spectrophotometer is able to determine the
found to be between 0.65% - 99.33%, 18.39% - 88.90% color values in the wavelength range of 400 - 700 nm in
and 5.42% - 9.03. Al-Shekaili et al (2016) classified the more than one color space and in this study, the desired L*
types of dates grown in various regions of Saudi Arabia a* b* color space measurements was made. (Figure 1a).
according to their hardness. Instead of the traditional
expensive and time-consuming methods used to determine Classification Unit
the quality of dried fruits, they used artificial neural In the study, Logitech C930E model web cam was used
network and linear discrimination analysis methods by to obtain images of fruits (Figure 1b). The dimensions of
removing histogram and texture features from 1800 the camera are 29 × 94 × 24 mm and can take up to 1920 ×
images, for example, in the computer vision system they 1080 pixels. The camera used is placed on a tripod so that
developed. Researchers classified dried fruits into soft, the classification device can be seen from the top.
semi-hard and hard. The results were successful for LDA The belt conveyor, which is the most important
and 84% for ANN and 77% for ANN. Jhawar (2016) component of the classification unit, was manufactured
classified taken from 160 orange photographs using the from stainless steel chrome sheet and aluminum material.
pattern recognition method. Designed classification The conveyor belt has a tape of 88 mm width, 2 mm
system; data collection and processing, feature extraction thickness, 650 - 700 mm and is black and can eliminate the
and making decisions. Images were taken at a resolution of electrostatic effect. All of the fasteners of the belt conveyor
640 × 480 pixels with a digital camera from a special box are made of stainless material. The outer diameter of the
illuminated with 430 luxurious lights. According to the drive roller is 32 mm, but there are holes of 25 mm depth
results of the study, 90% and 98% success was achieved in and 8 mm diameter on both ends of the roller. One end of
the classification of oranges. Ishikawa et al (2018), in their the drive roller is 14 mm, the other end is 17 mm in
study, classified the strawberries by using the shape diameter and it is made of aluminum to prevent the
information taken from digital images. Using the SHAPE bearings from rusting (Figure 1c).
software, they used fruit length, width, projection area and The spindle conveyor drive roller of the DC motor
fruit border lines data from 2969 photos for classification. operating the belt conveyor is coupled by direct engagement.
They emphasized that the method of machine learning was The output speed of the DC motor reducer is 90 min-1 and
successful in identifying strawberry fruits of nine different the motor operates with a nominal 24V DC voltage. The
shapes. Li et al (2019) have developed an online optical speed of the band can be adjusted with a DC motor driver
and spectroscopic-based system for the rapid added to the system. The motor driver added to the system
determination of internal and external quality in apples can control the motors in the range of 5 - 30 volts.
after harvest. A new image segmentation method has been In the classification device, two pneumatic double-
developed in order to determine the image of apple acting cylinders, which perform the main separation, are
containing all surface information in the online detection used. NPN type transistors were used to trigger the pistons.
system consisting of the external quality detection It is energized by means of 24 V with a capacity of 0,15 -
mechanism and the internal quality detection mechanism. 0,8 MPa as directional control valve. A pair of solenoid
In the study, the fruit external quality assessment rate was valves that control the pistons and a compressor with a
96.76%, the correlation coefficient in size measurement maximum capacity of 6.8 bar producing the required
compressed air has been added to the system.
2190
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

(a) (b) (c)


Figure 1. Spectrometer and calibration plates (a), camera and tripod unit (b), Belt conveyor system(c)

Arduino development board was used to control the The size and color values read with caliper and
pneumatic pistons on the belt system. Arduino Uno is a spectrophotometer were entered into the developed image
development board that uses Microcontroller processing algorithm and the success of classifying the
(ATmega328), which contains 14 digital input-output pins fruits correctly was determined.
and 6 analog input pins that can be connected with various
boards and other circuits. Machine Learning Algorithms
In the readings performed by the algorithm, a database
Method of three hundred objects with four numerical qualities (fruit
In the first stage of the measurements, the randomly diameter, R color channel, G color channel and B color
selected apple, quince and orange varieties were numbered channel) was created from the size and color values of
with labels affixed to the stem pit, and then the maximum apple, orange and quince. Class assignments (labels) of
distance between the flower pit and the stem pit of the fruits fruits whose qualities are determined in the database have
was measured and recorded. A total of 300 measurements been made. Using the KNIME Analytics Platform
were obtained. In the measurements carried out by the software, the data were introduced with descriptive
algorithm, the size readings were determined by first statistical methods, and then analyzed with the
converting the RGB images taken from the fruits to the classification techniques used in data mining. KNN,
grayscale images and then determining the borders (edge decision tree, Naive Bayes classification, Random Forest
detection). A platform placed under the fruits allows the and MLP are used in the classification where tag values are
widest parts to be measured by the camera. Under the tried to be predicted (Figure 2.). In the decision tree
camera, the fruit is placed so that the flower pit is below. formation, gain information was taken as the basis of
The measurements were made according to the quality and minimum description length (MDL) was used
classification values specified in TSE standards. In Table as pruning method. Decision Tree algorithm evaluates how
1, the minimum diameter values determined by TSI for well each sample separates its attributes according to target
apple, in Table 2. the length characteristics of the orange classes by using information gain and entropy. The
determined by TSE are also given. The algorithm distinguishing feature with the least entropy is selected and
developed for the apples is coarse and normal size, and for used as a test at the root node of the tree. Entropy is a
the oranges, the size number is between 0… 13, which is measure commonly used in information theory that
indicated on the front panel in the height indicators and characterizes the homogeneity of samples. The greater the
classified by opening pistons on the belt. difference of the data, namely the entropy measure, the
Xrite Ci60 spectrophotometer color readings on the more uncertain and unstable the results found with that
three surfaces determined from the vicinity of the stalk pit data. If all objects are in the same class, entropy is zero
of fruits and the average of three-color channels (L, a, b) (Silahtaroğlu 2016; Köse 2018). Entropy is calculated with
were obtained. The imported Lab color values are the following equation:
converted to RGB color space. Delta E is a measure of
c
color difference and is determined using the Euclidean |Ni| |Ni|
distance between two samples in the LAB space. Color Entropy(Nj)= ∑ log2
|Nj| |Nj|
image quality, the camera that captures images, etc. i=1
devices, compression on the image, restoration,
rearrangement, image transmission depends on many Here;
factors such as (Ouni et al. 2008). For this reason, Delta E Nj: Total number of records of N attributes in the
value is also given to indicate the color difference between attribute set,
the color values taken by spectrophotometry and image Ni: Refers to the number of records of the i'th option of
processing. Surfaces with color readings were then placed the attribute N (Köse 2018).
in a position where the camera could see, and the real-time
measurement results of the developed image processing The differences that occur according to this feature in
algorithm on the same surface were recorded in the Excel order to make the correct classification at the stage of
file. The color values are divided into classes only for forming nodes and branches according to the
apples within the standard set by TSE. distinguishing feature of the samples are called Gain
2191
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

Information. Gain Information is obtained by calculating The training and results processing of this method are
the differences between the weighted sums of the entropies very fast, but may be insufficient in solving complex
of each subsection (Silahtaroğlu 2016). The Gain classification problems. Bayes' theorem is calculated by
Information formula is given below: the formula below.

D=H(D)- ∑nt=1 P(Di ) H(Di ) 𝜌(𝐴⁄𝐵) = (𝜌(𝐵 ⁄𝐴) × 𝜌(𝐴))⁄𝜌(𝐵)


In the formula;
Here; P (A): The predecessor probability of event A,
D: Gain, P (B): successive probability of event B,
H: Entropy, P (B | A): Probability of B event when A event occurs,
P: Probability (Weight) (Silahtaroğlu 2016). P (A | B): When event B occurs, it is the probability of
A event (Çalış et al 2013).
Using Bayes theory, it is used to calculate the
probability values of the effects of each criterion on the In addition, algorithms were run with 10- fold cross
result and to calculate which data is a member of which validation method in dividing training and test parts for
class (Çalış et al 2013). Naive Bayes classification classification. In this method, it is based on the principle of
technique analyzes the condition change situation. For dividing the dataset into ten parts and using each piece as
example, in the case where B occurs, the probability of A the test and the remaining nine pieces as the training set.
occurrence is tried to be predicted. At the same time, it can The overall error and success rates of the system are
be questioned as the possibility of B occurrence in the case calculated by taking the average of ten results.
where A occurs (Şeker and Erdoğan 2018).

Table 1. Smallest diameter measurements accepted by apples according to classes (Anonymous 2007a)
Extra Class I Class II
Large size (L), mm 65 60 60
Normal size (N), mm 60 55 50

Table 2. Length characteristics of oranges (Anonymous 2007b)


Size No 0 1 2 3 4 5 6
Orange (mm) 92-110 87-100 84 - 96 81 - 92 77 - 88 73 - 84 70 - 80
Size No 7 8 9 10 11 12 13
Orange (mm) 67 - 76 64 - 73 62 - 70 60 - 68 58 -66 56 - 63 53 - 60

Figure 2. KNIME workflow

2192
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

Results and Discussion


Screen of classification process of the algorithm spectrophotometer were entered for each color channel, the
developed are given in Figure 3. In the attempts made in success of apple varieties in terms of color was found to be
the classification system for 50 Starkrimson Delicious 100%. However, orange and quince varieties were
varieties, 6 wrong classifications were made. In the unsuccessful in the classification according to color
classification made according to TS 100; for the extra class, because, there were no significant differences in colors.
the 1st piston was triggered and for the 2nd class apples, Delta E values ranged from 5.86 to 37.44 (Table 3.). In
the 2nd piston was triggered. In apples that are in the first Figure 4, regression graphs of fruits are given.
class, pistons were not triggered and passed directly over Sabancı et al. (2016) Using image processing techniques
the belt. Its success in the classification in Starkrimson to classify Golden Delicious, Granny Smith and Starking
Delicious apple variety was 88%. In 50 Golden Delicious Delicious apple varieties, the values obtained by using Bayes
apple varieties, the classification success by dimensions Net, Naive Bayes, K Star, SMO, RBF Network, RBF
was 100%. Er et al. (2013) studied real-time image Classifier, MLP Classifier, J48, Random Tree and Random
processing for classification process of apple varieties Forest algorithms. they achieved a success rate of 95.56%
using a the belt conveyor. Color, size parameters and fruit with the J48 algorithm in their classification and 97.78% on
weights estimated from size and area values, and the the MLP Classifier algorithm in color classification.
system's success was 95.5% stated. Bul et al (2005) in their Küçükönder et al. (2015) KStar compared the success of the
study on the classification of good and bad quality beans algorithms by classifying the color data from Random Forest
using image processing techniques, they achieved 87% and tomatoes using C4.5 algorithms. As a result of the
success in real-time processing and classification of beans comparison, they found the accuracy rates of Kstar, Decision
on the belt driven by two DC motors. Tree (C4.5), and Random Forest algorithms as 100%,
The orange classification process was carried out again 70.74%, and 98.30%, respectively. Al-Shekaili et al. (2016),
according to the class numbers specified by TS 34. For 0- in the study where they classified the varieties of dates
2 group, the first piston, for 3- 6 group, the 2nd piston was grown in various regions of Saudi Arabia according to their
triggered, in 7-13 group, the pistons were not triggered and hardness, extracting histogram and tissue properties from the
free passage was allowed. In orange varieties, there is the monochrome images of 1800 samples, using artificial neural
possibility of being in more than one group at the same network (ANN) and linear discrimination analysis (LDA)
time in terms of fruit diameter. According to TS 34; methods, 84% for LDA and% for ANN. They have achieved
Group 0....2: Oranges with a minimum diameter of 84 77 percent success. Dried fruits were classified as soft, semi-
mm and a maximum diameter of 110 mm, hard and hard in the study, 84% for LDA and 77% for YSA.
Group 3…6: Oranges with a minimum diameter of 70 Ataş (2016) used image processing to extract robust features
mm and a maximum diameter of 92 mm, in his study on Siirt pistachio, and classified the obtained
Group 7...13: Refers to oranges with a minimum mechanical data with NB, ANN and SVM, which are
diameter of 53 mm and a maximum diameter of 76 mm. In supervised machine learning algorithms. He stated that the
the measurements of fruit sizes, if the product diameter was highest classification success was ANN with an accuracy of
measured with the lower limits, it was evaluated as if it was 83.33%. Solak and Altınışık (2017) used image processing
in the following group. Because the diameter values techniques and average-based classification and K-means
measured by image processing are due to the tendency to clustering methods to identify and classify hazelnut fruits in
give more values than the caliper (measured) diameter their studies. While the hazelnut fruit detection was detected
values. When analyzed, classification success by size for with 100% success by image processing, they achieved a
Washington Navel variety was 96% and 82% for Valencia classification success of 90% and 100%, respectively, with
Midknight variety. In the study of Jhawar (2016), 90% and the other algorithms used. White et al. (2017) analyzed the
98% success were achieved in the classification of oranges length, width and color data determined by image processing
by using the pattern identification method over the photos from some olive varieties grown in Spain with ANN. The
taken from 160 oranges. researchers reported that the diagnosis of fruit sizes with
Considering that there is no classification in terms of ANN can be made with 90% accuracy. Yabanova and
size and color in the quince classification process Yumurtacı (2018) classified dynamically weighed eggs with
according to TS 1817. The classification process was made support vector machines. In the application, they found
by determining the smallest and largest diameter values for 100% success in training and testing up to 11 input data.
both varieties and entering the lower and upper limit values Koklu ve Ozkan (2020) studied on multi-class classification
of the diameter measurements that were read by the caliper of dry beans. For this aim, taken images from dry beans and
in the algorithm. In both quince varieties, the 1st piston was evaluated machine learning algorithms. MLP, SVM, KNN,
triggered for correct classification, and the 2nd piston for DT algorithms scores were 92.36%, 100.00%, 95.03%,
incorrect classifications. With this method, system success 94.36%, 94.92%, 94.67%, and 86.84% respectively.
was 95% with 5 incorrect readings in Ekmek quince variety Confusion matrix and accuracy criteria for all algorithms are
and 86% with 7 incorrect readings in Eşme quince variety. given in Table 4.
When the upper and lower limit values obtained from the

2193
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

Figure 3. Screen of classification process

Figure 4. Regression graphs of fruits


2194
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

Table 3. Delta E values of fruits


Starkrimson Golden Washington Valencia
Sample no Ekmek Quince Eşme Quince
Delicious Delicious Navel Midknigh
1 17.47 14.92 14.93 9.59 9.56 11.58
2 18.78 21,93 17.43 9.18 10.21 11.5
3 19.88 15.26 16.85 10.39 7.36 16.06
4 19.59 21.67 12.81 10.79 6.41 15.02
5 17.73 22.62 7.05 6.53 6.08 5.83
6 28.41 20.96 11.57 9.77 9.97 9.48
7 6.14 19.04 11.71 10.5 13.01 10.27
8 14.55 14.97 12.65 11.85 10.66 4.58
9 11.9 15.11 14.02 16.31 10.38 13.27
10 22.1 19.19 18.59 12.28 9.17 10.05
11 16.72 17.38 13.18 11.89 11.81 4.91
12 11.06 20.14 3.18 9.03 13.4 11.54
13 23.59 20.97 20.28 9.3 5.17 11.08
14 20.59 16.47 12.67 14.08 9.24 2.61
15 27.89 16.24 18.05 8.9 6.03 7.37
16 12.86 19.75 12.85 10.44 6.63 7.85
17 21.29 20.16 13.4 5.54 10.89 9.16
18 7.09 12.02 14.35 7.88 7.06 7.35
19 27.41 16.74 13.36 10.66 10.39 4.1
20 27.28 17.98 8.84 8.17 12 5.74
21 17.19 20.64 10.42 12.67 13.36 9.62
22 20.44 21.4 8.73 13.2 14.97 4.01
23 20.76 18.98 12.02 8.1 9.64 12.73
24 23.67 18.98 10.92 9.59 10.27 10.45
25 8.77 21.12 17.15 5.69 15.27 7
26 23.08 17.97 10.53 7.47 14.39 11.63
27 20.3 18.14 12.07 7.12 11.24 5.17
28 23.21 18.42 16.84 8.79 14.35 7.16
29 16.94 15.25 12.58 12.83 15.89 9.92
30 22.11 21.53 12.54 7.49 14.12 12.36
31 16.58 20.12 12.82 10.15 7.55 9.5
32 23.52 22.02 15.61 12.46 14.93 10.28
33 26.05 16.77 10.54 8.34 16.31 8.97
34 33.27 20.96 9.43 13.81 14.42 11.778
35 18.3 21.63 21.31 13.06 8.08 9.92
36 23.95 20.24 9.4 6.6 14.49 6.51
37 25.24 22 17.15 9.46 15.9 6.86
38 37.44 21.71 16.72 9.3 7.09 7.57
39 19.01 17.94 12.03 9.01 6.35 8.58
40 22.59 22 14.58 10.89 10.13 13.62
41 5.86 20.4 10.33 13.07 11.1 9.02
42 21.02 26.94 8.02 11.11 7.62 8.26
43 16.17 11.17 6.91 6.95 10.56 16.77
44 21.37 22.05 8.64 7.11 13.89 9.56
45 12.01 22.81 10.41 10.29 7.61 8.73
46 18.95 16.93 6.09 10.08 4.52 8.12
47 10.73 26.63 9.64 12.71 9.73 8.76
48 16.91 23.04 6.46 9.75 6.14 8.44
49 16.8 26.29 7.09 6.61 10.43 10.11
50 17.74 17.61 8.48 11.23 8.96 23.91

Table 4. Confusion matrix and accuracy criteria of algorithms


Accuracy (%) Error (%) F-Measure Recall Precision Sensitivity
KNN 93.667 6.333 0.826 0.905 0.905 0.76
DT 90.333 9.667 0.777 0.8 0.755 0.8
Naive Bayes 88.333 11.667 0.752 0.94 0.627 0.94
MLP 92.667 7.333 0.817 0.76 0.884 0.76
RF 94.333 5.667 0.848 0.84 0.857 0.84

2195
Koç and Vatandaş / Turkish Journal of Agriculture - Food Science and Technology, 9(12): 2189-2196, 2021

Conclusion
In the study, an image processing algorithm was Papatya Yayıncılık Eğitim, 280 s., İstanbul/Turkey. (In
developed to classify fruits according to their size and color Turkish).
characteristics, and it was integrated into a classification
unit and used in trials. On the other hand, the size and color
values read on fruits by image processing software were Küçükönder H, Vursavuş KK, Üçkardeş F. 2015. Determining
evaluated with the estimator techniques used in data The Effect of Some Mechanical Properties on Color Maturity
mining. Algorithms run with 10-fold cross validation of Tomato With K-Star, Random Forest and Decision Tree
method yielded highly accurate results. Both online and (C4.5) Classification Algorithms. Turkish Journal of
offline classification methods were successful for the fruits Agriculture-Food Science and Technology, 3(5): 300-306,
that were tested. DOI:
Kurtulmuş F, Lee WS, Vardar A. 2014. Immature peach detection
Information in colour images acquired in natural illumination conditions
using statistical classifiers and neural network. Precision
agriculture, 15(1), 57-79. DOI:https://doi.org/ 10.1007/
This study is derived from the master’s thesis entitled s11119-013-9323-8.
“Classification of Some Fruits with Image Processing Li L, Peng, Y., Li, Y., Liu, Y. 2019. A nondestructive on-line
Techniques” (Council of Higher Education: detection system of apple internal and external parameters
https://tez.yok.gov.tr/UlusalTezMerkezi/tezSorguSonucY based on optical technique. An ASABE Meeting
eni.jsp) supervised by Prof. Dr. Mustafa Vatandas. Presentation, DOI: https://doi.org/10.13031/aim.201900783.
Naik S, Patel B (2017). Machine vision based fruit classification
and grading-a review. International Journal of Computer
References Applications, 170(9), 22-34.
Örnek, MN. 2014. Havuç Sınıflandırmada Gerçek Zamanlı
Al-Shekaili NH, Manickavasagan A, Al-Mezeini NK, Rahman Görüntü İşleme Makinası Tasarımı ve Bazı Mekanik
MS, Guizani N. 2016. Computer vision technique to classify Sınıflandırma Makinaları ile Boylama Etkinliklerinin
dates based on hardness. Journal of Agricultural and Marine Karşılaştırılması. Doktora Tezi, Selçuk Üniversitesi, Fen
Sciences Vol. 22 (1): 36-41. Anonymous 2007a. Apple Bilimleri Enstitüsü, Tarım Makinaları Anabilim Dalı, Konya.
Standard. TS 100. Turkish Standards Institution, Ouni S, Zagrouba E, Chambah M, Herbin M. 2008. A New
Ankara/Turkey. Generic Colour Full Reference Metric. ISIVC 2008.
Anonymous 2007b. Citrus Standard. TS 34. Turkish Standards Pezikoglu F, Ergun ME, & Erkal S. 2004. The situation of modern
Institution, Ankara/Turkey. retailers in fresh fruit and vegetable marketing channel.
Anonymous 2007c. Quince Standard. TS 1817. Turkish Journal of Ataturk Central Horticultural Research Institute
Standards Institution, Ankara/Turkey. (Turkey).
Ataş M. 2016. Extraction of robust features from Siirt pistachio Sabancı K, Ünlerşen MF, Dilay Y. 2016. Determination Using
images for pistachio sorting system. Dicle University Journal Image Processing Techniques the Classification Parameters
of Engineering, 7(1): 93-102. of Apple Varieties Grown in the Karaman Region. Journal of
Bul E, Gelen G, Altun H. 2005. Görüntü İşlemeye Dayalı Agricultural Machinery Science, 12 (2), 133-139.
Tarımsal Ürün Sınıflandırma. 11. Ulusal Elektrik- Şeker ŞE, Erdoğan D. 2018. KNIME İle Uçtan Uca Veri Bilimi.
Elektronik- Bilgisayar Mühendisliği Kongresi, 22-25 Eylül 1. Basım, 440 s., Demet Erdoğan Yayınevi. (In Turkish).
2005, Şişli-İstanbul. (In Turkish). Silahtaroğlu G. 2016. Veri Madenciliği Kavram ve Algoritmaları.
Çalış K, Gazdağı O, Yıldız O. 2013. Automatic Detection of 3. Basım, 304 s., Papatya Yayıncılık, İstanbul. (In Turkish).
Advertising Email Using Text Mining. International Journal Singh V, Hedayetullah M, Zaman P, Meher J. 2014. Postharvest
of Informatics Technologies, 6(1): 1-7. technology of fruits and vegetables: An overview. Journal of
Er O, Cetişli B, Sofu MM, Kayacan C. 2013. Real-Time Postharvest Technology, 2(2), 124-135.
Automatic Apple Classification. Süleyman Demirel Solak S, Altınışık U. 2017. Detection and classification of
University Journal of Natural and Applied Science, 17(2), 31- hazelnut fruit by using image processing techniques and
38, 2013. clustering methods. SAKARYA UNIVERSITY JOURNAL
Ishikawa T, Hayashi A, Nagamatsu S, Kyutoku Y, Dan I, Wada OF SCIENCE, Doi: 10.16984/saufenbilder.303850 22 (1),
T, Oku K, Saeki Y, Uto T, Tanabata T, Isobe S, Kochi1 N. 56-65.
2018. Classifıcation of Strawberry Fruit Shape by Machine Sungur C, Özkan H. 2015. A real time quality control application
Learning. International Archives of the Photogrammetry, for animal production by image processing. Journal of the
Remote Sensing & Spatial Information Sciences, 42(2). Science of Food and Agriculture, 95(14), 2850-2857.
Jhawar J. 2016. Orange Sorting by Applying Pattern Recognition Tonguç G. 2007. Fruit Classification Using Image Process
on Colour Image. Procedia Computer Science 78 (2016) 691 Techniques. M.Sc. Thesis, Süleyman Demirel University
– 697. Graduate School of Applied and Natural Sciences Machine
Kim DG, Burks TF, Qin J, Bulanon DM. 2009. Classification of Education Department, Isparta, Turkey.
grapefruit peel diseases using color texture feature analysis. Yabanova İ, Yumurtacı M. 2018. Classification of Dynamic Egg
Int J Agric & Biol Eng, Vol. 2 No.3, 41-50p. Weight Using Support Vector Machine. Journal of the
Koklu, Murat; Ozkan, Ilker A. 2020. Multiclass classification of Faculty of Engineering and Architecture of Gazi University
dry beans using computer vision and machine learning 33:2 (2018) 393-402.
techniques. Computers and Electronics in Agriculture, 174(),
105507–. doi: 10.1016/j.compag.2020.105507.
Köse İ. 2018. Veri Madenciliği Teori Uygulama ve Felsefesi.

2196

You might also like