12
4 th ICRIEMS Proceedings Published by The Faculty Of Mathematics And Natural Sciences Yogyakarta State University, ISBN 978-602-74529-2-3 M - 9 Application of Fuzzy Model to Classification The Tomatoes Ripeness Edi Wahyudi 1, a) , Uke Ralmugiz 1, b) , Karina Nurwijayanti 1, c) Agus Maman Abadi 2, d) 1 Graduate Program of Mathematics Education, and 2 Mathematics department, faculty of mathematics and science Yogyakarta State University Jl Kolombo No 1, Karangmalang, Depok, Sleman, Yogyakarta, Indonesia a) Corresponding author: [email protected] b) [email protected] c) [email protected] d) [email protected] Abstract. Keeping the peel of fruit to remain acceptable by the consumers is the key to success in the business of fruits and vegetables. This research applied fuzzy logic as the proponent to classify the ripeness of tomatoes (lycopersicon esculentum). The ability to keep fresh after the harvest is relatively short so it requires farmers to crop quicker although it is still unripe for industrial purpose. The packing of tomatoes on great amount and the time for shipping need to be taking care of so that the tomatoes will not be rotten until the industry place. Fuzzy model one is of the methods to that can be used to classify the tomatoes maturity. The process did was changing the image type from red green blue into grayscale type that was used as the research data, followed extraction to obtain the information from the images. The amounts of training data were 32 tomatoes and the amounts of testing were 15 tomatoes. The accuracy level of the fuzzy model for the training data was 90.62%. On the other hand, the accuracy level of the fuzzy model for the testing data was 80%. INTRODUCTION The criteria to analyze the ripeness generally is included the physical appearance like skin color. It can determine the ripeness of the fruits especially the ripeness of fruits and vegetables. An image color analysis procedure is used to classify the fresh tomatoes into six phases of maturity and pictures from any tomato is changed into Hue, Saturation, and intensity [1]. Heron & Zachariah use spectrophotometer or sensitive light to measure the light reflectance, transmission, or characteristic [2]. The characteristic of light reflection from tomatoes is used to evaluate the fruit quality and provide the medium selection for tomatoes[3]. The use of machine vision algorithm for the structure of the market product according to the color and the damage [4]. Classification is vital for the evaluation of agricultural produce [5]. The characteristic of fresh tomato can be seen from the handling system post-harvest to decide the feature, level of color, and firmness changes in component handling steps [6]. Tomatoes harvested at the stage before the mature to maintain the fruit freshness or the color change from the pink into dark red. The delivery of tomatoes at the stage of pink color requires handling modification technique to hamper the ripeness. An analysis procedure of maturity color image is developed to classify the tomatoes into four classification standards, those are: raw, half-mature, mature, and rotten. The color of tomatoes can be used to indicate that the fruit is raw, half-mature, mature, and rotten. The extraction of tomatoes color characteristic can be used to know the level of tomatoes ripeness for industrial purposes, besides the classification of tomatoes ripeness. The result of research on the color of apples explains the color model based on the normal color variabilities is explained and each pixel of an image on apple is compared to model [7]. Leemans, et al. introduce Gaussian model from skin color on fruit. A method to pixel part based on Bayesian classification process seen from healthy and defective fruits frequency is estimated to the division of classification [7].There are two ways to identify the ripeness of tomatoes; those are destructive and non- destructive. Destructively, the ripeness of tomatoes can be seen by splitting tomatoes into two parts to see the level of its ripeness. The splitting of tomato can be done if it is ready to be used or to be treated. It the tomatoes will be sent to industry so the tomatoes will quickly rot. We need a method to decide the level of tomatoes' ripeness

Application of Fuzzy Model to Classification The Tomatoes

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Application of Fuzzy Model to Classification The Tomatoes

4th ICRIEMS Proceedings Published by The Faculty Of Mathematics And Natural Sciences Yogyakarta State University, ISBN 978-602-74529-2-3

M - 9

Application of Fuzzy Model to Classification The

Tomatoes Ripeness

Edi Wahyudi1, a), Uke Ralmugiz1, b), Karina Nurwijayanti1, c) Agus Maman Abadi2, d)

1Graduate Program of Mathematics Education, and 2Mathematics department, faculty of mathematics and science

Yogyakarta State University

Jl Kolombo No 1, Karangmalang, Depok, Sleman, Yogyakarta, Indonesia

a)Corresponding author: [email protected]

b) [email protected] c) [email protected]

d) [email protected]

Abstract. Keeping the peel of fruit to remain acceptable by the consumers is the key to success in the business of

fruits and vegetables. This research applied fuzzy logic as the proponent to classify the ripeness of tomatoes

(lycopersicon esculentum). The ability to keep fresh after the harvest is relatively short so it requires farmers to crop

quicker although it is still unripe for industrial purpose. The packing of tomatoes on great amount and the time for

shipping need to be taking care of so that the tomatoes will not be rotten until the industry place. Fuzzy model one is

of the methods to that can be used to classify the tomatoes maturity. The process did was changing the image type

from red green blue into grayscale type that was used as the research data, followed extraction to obtain the information

from the images. The amounts of training data were 32 tomatoes and the amounts of testing were 15 tomatoes. The

accuracy level of the fuzzy model for the training data was 90.62%. On the other hand, the accuracy level of the fuzzy

model for the testing data was 80%.

INTRODUCTION

The criteria to analyze the ripeness generally is included the physical appearance like skin color. It can

determine the ripeness of the fruits especially the ripeness of fruits and vegetables. An image color analysis

procedure is used to classify the fresh tomatoes into six phases of maturity and pictures from any tomato is changed

into Hue, Saturation, and intensity [1]. Heron & Zachariah use spectrophotometer or sensitive light to measure

the light reflectance, transmission, or characteristic [2]. The characteristic of light reflection from tomatoes is used

to evaluate the fruit quality and provide the medium selection for tomatoes[3]. The use of machine vision

algorithm for the structure of the market product according to the color and the damage [4].

Classification is vital for the evaluation of agricultural produce [5]. The characteristic of fresh tomato can

be seen from the handling system post-harvest to decide the feature, level of color, and firmness changes in

component handling steps [6]. Tomatoes harvested at the stage before the mature to maintain the fruit freshness

or the color change from the pink into dark red. The delivery of tomatoes at the stage of pink color requires

handling modification technique to hamper the ripeness. An analysis procedure of maturity color image is

developed to classify the tomatoes into four classification standards, those are: raw, half-mature, mature, and

rotten.

The color of tomatoes can be used to indicate that the fruit is raw, half-mature, mature, and rotten. The

extraction of tomatoes color characteristic can be used to know the level of tomatoes ripeness for industrial

purposes, besides the classification of tomatoes ripeness. The result of research on the color of apples explains the

color model based on the normal color variabilities is explained and each pixel of an image on apple is compared

to model [7]. Leemans, et al. introduce Gaussian model from skin color on fruit. A method to pixel part based on

Bayesian classification process seen from healthy and defective fruits frequency is estimated to the division of

classification [7].There are two ways to identify the ripeness of tomatoes; those are destructive and non-

destructive. Destructively, the ripeness of tomatoes can be seen by splitting tomatoes into two parts to see the

level of its ripeness. The splitting of tomato can be done if it is ready to be used or to be treated. It the tomatoes

will be sent to industry so the tomatoes will quickly rot. We need a method to decide the level of tomatoes' ripeness

Page 2: Application of Fuzzy Model to Classification The Tomatoes

M - 10

non-destructively is without ruining the tomatoes so that they can be sold and arrive at the industry in accordance

with the desired maturity level. based colour classification system that provide reliability, high speed and

repeatable operation. Hence the production increases and reduces its dependency on manpower[8].

Fuzzy model is often used in various fields; such as signal process, control, communication, business, and

health. Fuzzy model is a system built by definition, ways of working, and clear description based on fuzzy logic

theory and choosing some processes on fuzzy rules, inference, fuzzifies, defuzzification [9]. Some example of the

use of the fuzzy model can be seen in washing machine, camcorder, automatic system in a car, and train control

system in Japan [10]. An object-based fuzzy logic classifier is then implemented to improve upon the pixel-based

classification by identifying one additional class in dense urban areas[9] and classifiers can be even improved

by obtaining the appropriate variable contexts, i.e., appropriate granularities and membership function

parameters [11]. Fuzzy logic maps the input space into output space by using fuzzy role. The input used in this

research is the result of extraction from tomatoes with output, the level of tomatoes ripeness. Fuzzified used is

triangular membership functions. Fuzzy inference uses Mamdani method. Defuzzification uses bisector and the

formation process of the fuzzy model uses MATLAB software. The purpose of this research is to classify the fuzzy

model to detect the level of tomatoes ripeness.

METHOD

The data used in this research were the images of raw, half-ripe, ripe, and rotten tomatoes. Data retrieval

training were 34 tomatoes and data testing were 12 tomatoes which were taken from Demangan Market,

Yogyakarta. The steps used in this research were: 1) Changing the images’ type from RGB into grayscale, and

than extracting grayscale images so that input obtained which will be used on the Fuzzy model; those are contrast,

correlations, energy, homogeneity, mean, variance, standard deviation, kurtosis, entropy, IDM, and extracting is

done by using MATLAB software, 2). Define fuzzy input set, 3). Define fuzzy output set. 4). Determine fuzzy rule,

5). Inferencing and defuzzification of training data and testing data.

RESULT AND DISCUSSION

Extraction

The method used to obtain the information of tomatoes is image extracting which use 11 information from the

images which have relation to the quantity of color or kinds of the colors. That information are; contrast,

correlation, energy, homogeneity, mean, variance, standard deviation, skewness, kurtosis, entropy, inverse

difference moment (IDM). The extraction process is done by the help of MATLAB software by utilizing the

provided script. The tomatoes images type RGB need to be changed into grayscale type because the extraction

process can be done only in grayscale image type.

Define Fuzzy Input Set

Input variabel are contrast, correlation, energy, homogeneity, mean, variance, standard deviation, skewness,

kurtosis, entropy, and inverse difference moment (IDM).

a. Contrast

The value of contras from image extraction process of training data is 0.030208 for minimum value and

0.090104 for maximum value so that the universal sets for contrast is AU = [0.030208 0.090104]. There are

9 fuzzy sets difined in contrast input in the membership function as follows:

Page 3: Application of Fuzzy Model to Classification The Tomatoes

M - 11

03772.0;0

03772.003021.0;00751.0

03772.0

1

x

xx

A

04516.003772.0;

03772.003021.0;

04516.0,03021.0;

00744.0

04516.000751.0

03021.00

2

x

x

xx

x

xA

05266.004516.0;

04516.003772.0;

05266.0,0772.0;

0075.0

05266.000744.0

03772.00

3

x

x

xx

x

xA

06017.005266.0;

05266.004516.0;

06017.0,04516.0;

00751.0

06017.00075.0

04516.00

4

x

x

xx

x

xA

06767.0006017.0;

006017.005266.0;

06767.0,05266.0;

0075.0

06767.000751.0

05266.00

5

x

x

xx

x

xA

07511.006767.0;

06767.0006017.0;

07511.0006017.0;

0075.0

07511.000751.0

006017.00

6

x

x

xorx

x

xA

08261.007511.0;

07511.006767.0;

08261.006767.0;

0075.0

08261.000744.0

06767.00

7

x

x

xorx

x

xA

009012.008261.0;

08261.007511.0;

009012.007511.0;

00751.0

009012.00075.0

07511.00

8

x

x

xorx

x

xA

009012.0;

009012.008261.0;

08261.0;

00075.0

08261.00

9

x

x

xx

A

b. Correlation

The value of universal set for correlation from image extraction process of training data is 0.94887 for

minimum value and 0.98064 for maximum value so that the universal sets for correlation is BU = [0.94887

0.98064]. There are 9 fuzzy sets difined in correlation input in the membership function as follows:

09528.0;0

09528.09489.0;0039.0

09528.0

1

x

xx

B

09568.009528.0;

09528.009489.0;

09568.009489.0;

004.0

09568.00039.0

09489.00

2

x

x

xorx

x

xB

09608.009568.0;

09568.009528.0;

09608.009528.0;

004.0

09608.00039.0

09528.00

3

x

x

xorx

x

xB

09648.009608.0;

09608.009568.0;

09648.009568.0;

004.0

09648.0004.0

09528.00

4

x

x

xorx

x

xB

09687.009648.0;

09648.009608.0;

09687.009608.0;

0039.0

09687.0004.0

09608.00

5

x

x

xorx

x

xB

09727.009687.0;

09687.009648.0;

09727.009648.0;

004.0

09727.00039.0

09648.00

6

x

x

xorx

x

xB

09767.009727.0;

09727.009687.0;

09767.009687.0;

004.0

09767.0004.0

09687.00

7

x

x

xorx

x

xB

09806.009767.0;

09767.009727.0;

09806.009727.0;

0039.0

09806.0004.0

09727.00

8

x

x

xorx

x

xB

Page 4: Application of Fuzzy Model to Classification The Tomatoes

M - 12

09806.0;

09806.009767.0;

09767.0;

00039.0

09767.00

9

X

x

xx

B

c. Energy

The value of universal set for energy from image extraction process of training data is 0.23693 for minimum

value and 0.44605 for maximum value so that the universal sets for energy is CU = [0.23693 0.44605].

There are 9 fuzzy sets difined in energy input in the membership function as follows:

9806.0;0

2631.02369.0;0262.0

2631.0

1

x

xx

C

2892.02631.0;

2631.02369.0;

2892.02369.0;

0262.0

2892.00262.0

2369.00

2

x

x

xataux

x

xC

3154.02892.0;

2892.02631.0;

3154.02631.0;

0262.0

3154.00261.0

2631.00

3

x

x

xataux

x

xC

3415.03154.0;

3154.02892.0;

3415.02892.0;

0261.0

3415.00262.0

2892.00

4

x

x

xataux

x

xC

3676.03415.0;

3415.03154.0;

3676.03154.0;

0261.0

3676.00261.0

3154.00

5

x

x

xataux

x

xC

3938.03676.0;

3676.03415.0;

3938.0,3415.0;

0262.0

3938.00261.0

3415.00

6

x

x

xx

x

xC

4199.03938.0;

3938.03676.0;

4199.03676.0;

0261.0

4199.00262.0

3676.00

7

x

x

xataux

x

xC

4461.04199.0;

4199.03938.0;

4461.03938.0;

0262.0

4461.00261.0

3938.00

8

x

x

xataux

x

xC

4461.0;

4461.04199.0;

4199.0;

10261.0

4199.00

9x

xx

C

d. Homogeneity

The value of universal set for homogeneity from image extraction process of training data is 0.96554 for

minimum value and 0.98763 for maximum value so that the universal sets for homogeneity is UD = [0.96554

0.98763]. There are 9 fuzzy sets difined in homogeneity input in the membership function as follows:

9683.0;0

9683.09655.0;0028.0

9683.0

1

x

xx

D

9711.09683.0;

9683.09655.0;

9711.09655.0;

0028.0

9711.00028.0

9655.00

2

x

x

xataux

x

xD

9738.09711.0;

9711.09683.0;

9738.09683.0;

0027.0

9738.00028.0

9683.00

3

x

x

xataux

x

xD

9766.09738.0;

9738.09711.0;

9766.09711.0;

0028.0

9766.00027.0

9711.00

4

x

x

xataux

x

xD

Page 5: Application of Fuzzy Model to Classification The Tomatoes

M - 13

9793.09766.0;

9766.09738.0;

9793.09738.0;

0027.0

9793.00028.0

9738.00

5

x

x

xataux

x

xD

9821.09793.0;

9793.09766.0;

9821.09766.0;

0028.0

9821.00027.0

9766.00

6

x

x

xataux

x

xD

9821.09821.0;

9821.09793.0;

9821.09793.0;

0027.0

9821.00028.0

9793.00

7

x

x

xataux

x

xD

9876.09821.0;

9821.09821.0;

9876.09821.0;

0027.0

9876.00028.0

9821.00

8

x

x

xataux

x

xD

9876.0;

9876.09849.0;

9849.0;

10027.0

9849.00

9x

xx

D

e. Mean

The value of universal set for contrast from image extraction process of training data is 28.3515 for

minimum value and 62.7587 for maximum value so that the universal set for contrastis UE = [28.3515

62.7587]. There are 9 fuzzy sets difined in mean input in the membership function as follows:

65.32;0

65.3235.28;3.4

65.32

1

x

xx

E

95.3665.32;

65.3235.28;

95.3635.28;

3.4

95.363.4

35.280

2

x

x

xataux

x

xE

25.4195.36;

95.3665.32;

25.4165.32;

3.4

25.413.4

65.320

3

x

x

xataux

x

xE

56.4525.41;

25.4195.36;

56.4595.36;

3.4

56.453.4

95.360

4

x

x

xataux

x

xE

86.4956.45;

56.4525.41;

86.4925.41;

3.4

86.493.4

25.410

5

x

x

xataux

x

xE

16.5486.49;

86.4956.45;

16.5456.45;

3.4

16.543.4

56.450

6

x

x

xataux

x

xE

46.5816.54;

16.5486.49;

46.5886.49;

3.4

46.583.4

86.490

7

x

x

xataux

x

xE

76.6246.58;

46.5816.54;

76.6216.54;

3.4

76.623.4

16.540

8

x

x

xataux

x

xE

76.62;

76.6246.58;

2.211;

13.4

46.580

9x

xx

E

f. Variance

The value of universal set for variance from image extraction process of training data is 445.739 for

minimum value and 1555.2718 for maximum value so that the universal sets for variance is UF = [445.739

1555.2718]. There are 9 fuzzy sets difined in contrast input in the membership function as follows:

4.584;0

4.5847.445;7.138

4.584

1

x

xx

F

1.7234.584;

4.5847.445;

1.7237.445;

7.138

1.7237.138

7.4450

2

x

x

xataux

x

xF

8.8611.723;

1.7234.584;

8.8614.584;

7.138

8.8617.138

4.5840

3

x

x

xataux

x

xF

Page 6: Application of Fuzzy Model to Classification The Tomatoes

M - 14

10018.861;

8.8611.723;

10011.723;

2.138

10017.138

1.7230

4

x

x

xataux

x

xF

11391001;

10018.861;

11398.861;

138

11392.138

8.8610

5

x

x

xataux

x

xF

12781139;

11391001;

12781001;

138

12782.138

10010

6

x

x

xataux

x

xF

14171278;

12781139;

14171139;

139

1417139

11390

7

x

x

xataux

x

xF

15551417;

14171278;

15551278;

138

1555139

12780

8

x

x

xataux

x

xF

1555;

15551278;

6738;

1139

14170

9x

xx

F

g. Standard deviation

The value of universal set for standard deviation from image extraction process of training data is 21.1125

for minimum value and 39.4369 for maximum value so that the universal sets for standard deviation is

𝑈𝐺= [21.1125 39.4369]. There are 9 fuzzy sets difined in standard deviation input in the membership

function as follows:

4.23;0

4.2311.21;29.2

4.23

1

x

xx

G

69.254.23;

4.2311.21;

69.2511.21;

29.2

69.2529.2

11.210

2

x

x

xataux

x

xG

98.2769.25;

69.254.23;

98.274.23;

29.2

98.2729.2

4.230

3

x

x

xataux

x

xG

27.3098.27;

98.2769.25;

27.3069.25;

29.2

27.3029.2

69.250

4

x

x

xataux

x

xG

57.3227.30;

27.3098.27;

57.3298.27;

3.2

57.3229.2

98.270

5

x

x

xataux

x

xG

86.3457.32;

57.3227.30;

86.3427.30;

29.2

86.343.2

27.300

6

x

x

xataux

x

xG

15.3786.34;

86.3457.32;

15.3757.32;

29.2

15.3729.2

57.320

7

x

x

xataux

x

xG

44.3915.37;

15.3786.34;

44.3986.34;

29.2

44.3929.2

86.340

8

x

x

xataux

x

xG

44.39;

44.3915.37;

15.37;

129.2

15.370

9x

xx

G

h. Skewness

The value of universal set for skewness from image extraction process of training data is -0.63222 for

minimum value and 0.3525 for maximum value so that the universal sets for skewness is UH = [-0.63222

0.3525]. There are 9 fuzzy sets difined in skewness input in the membership function as follows:

:

Page 7: Application of Fuzzy Model to Classification The Tomatoes

M - 15

5091.0;0

5091.06322.0;1231.0

5091.0

1

x

xx

H

386.05091.0;

5091.06322.0;

386.06322.0;

1231.0

386.01231.0

)6322.0(0

2

x

x

xataux

x

xH

263.0386.0;

386.05091.0;

263.05091.0;

1231.0

263.01231.0

)5091.0(0

3

x

x

xataux

x

xH

1399.0263.0;

263.0386.0;

1399.0386.0;

1231.0

1399.01231.0

)386.0(0

4

x

x

xataux

x

xH

01677.01399.0;

1399.0263.0;

01677.0263.0;

1231.0

01677.01231.0

)263.0(0

5

x

x

xataux

x

xH

1063.001677.0;

01677.01399.0;

1063.01399.0;

1231.0

1063.01231.0

)1399.0(0

6

x

x

xataux

x

xH

2294.01063.0;

1063.001677.0;

2294.001677.0;

1231.0

2294.01231.0

)01677.0(0

7

x

x

xataux

x

xH

3525.02294.0;

2294.01063.0;

3525.01063.0;

1231.0

3525.01231.0

1063.00

8

x

x

xataux

x

xH

3525.0;

3525.02294.0;

2294.0;

11231.0

2294.00

9x

xx

H

i. Kurtosis

The value of universal set for kurtosis from image extraction process of training data is 1.5809 for minimum

value and 2.9849 for maximum value so that the universal sets for kurtosis is UI = [1.5809 2.9849]. There

are 9 fuzzy sets difined in kurtosis input in the membership function as follows:

756.1;0

756.11581;175.0

756.1

1

x

xx

I

932.1756.1;

756.1581.1;

932.1581.1;

175.0

932.1175.0

581.10

2

x

x

xataux

x

xI

107.2932.1;

932.1756.1;

107.2756.1;

175.0

107.2175.0

756.10

3

x

x

xataux

x

xI

283.2107.2;

107.2932.1;

283.2932.1;

175.0

283.2175.0

932.10

4

x

x

xataux

x

xI

458.2283.2;

283.2107.2;

458.2107.2;

175.0

458.2175.0

107.20

5

x

x

xataux

x

xI

634.2458.2;

458.2283.2;

634.2283.2;

175.0

634.2175.0

283.20

6

x

x

xataux

x

xI

809.2634.2;

634.2458.2;

809.2458.2;

175.0

809.2175.0

458.20

7

x

x

xataux

x

xI

985.2809.2;

809.2634.2;

985.2634.2;

175.0

985.2175.0

634.20

8

x

x

xataux

x

xI

985.2;

985.2809.2;

809.2;

1176.0

809.20

9x

xx

I

j. Entropy

The value of universal set for entropy from image extraction process of training data is 4.3781 for minimum

value and 5.6899 for maximum value so that the universal sets for entropy is UK = [4.3781 5.6899]. There

are 9 fuzzy sets difined in entropy input in the membership function as follows:

Page 8: Application of Fuzzy Model to Classification The Tomatoes

M - 16

542.4;0

542.4378.4;164.0

542.4

1

x

xx

J

706.4542.4;

542.4378.4;

706.4378.4;

164.0

706.4164.0

378.40

2

x

x

xataux

x

xJ

87.4706.4;

706.4542.4;

87.4542.4;

164.0

87.4164.0

542.40

3

x

x

xataux

x

xJ

034.587.4;

87.4706.4;

034.5706.4;

164.0

034.5164.0

706.40

4

x

x

xataux

x

xJ

198.5034.5;

034.587.4;

198.587.4;

164.0

198.5164.0

87.40

5

x

x

xataux

x

xJ

362.5198.5;

198.5034.5;

362.5034.5;

164.0

362.5164.0

034.50

6

x

x

xataux

x

xJ

526.5362.5;

362.5198.5;

526.5198.5;

164.0

526.5164.0

198.50

7

x

x

xataux

x

xJ

526.5526.5;

526.5362.5;

69.5362.5;

164.0

69.5164.0

362.50

8

x

x

xataux

x

xJ

69.5;

69.5526.5;

526.5;

1164.0

526.50

9x

xx

J

k. IDM

The value of universal set for IDM from image extraction process of training data is 0.000099378 for

minimum value and 0.0002869 for maximum value so that the universal sets for IDM is UK = [0.000099378

0.0002869]. There are 9 fuzzy sets difined in IDM input in the membership function as follows:

0001424.0;0

0001424.000009938.0;164.0

0001424.0

1

x

xx

K

0001424.00001424.0;

0001424.000009938.0;

0001854.000009938.0;

00003227.0

0001424.000003227.0

00009938.00

2

x

x

xataux

x

xK

0002283.00001854.0;

0001854.00001424.0;

0002283.00001424.0;

00003225.0

0002283.000003228.0

0001424.00

3

x

x

xataux

x

xK

0002713.00002283.0;

0002283.00001854.0;

0002713.00001854.0;

0000323.0

0002713.00000323.0

0001854.00

4

x

x

xataux

x

xK

0003143.00002713.0;

0002713.00002283.0;

0003143.00002283.0;

0000323.0

0003143.00000323.0

0002283.00

5

x

x

xataux

x

xK

0003573.00003143.0;

0003143.00002713.0;

0003573.00002713.0;

0000323.0

0003573.00000323.0

0002713.00

6

x

x

xataux

x

xK

0004003.00003573.0;

0003573.00003143.0;

0004003.00003143.0;

00003227.0

0004003.000003227.0

0003143.00

7

x

x

xataux

x

xK

0004433.00004003.0;

0004003.00003573.0;

0004433.00003573.0;

0000323.0

0004433.00000323.0

0003573.00

8

x

x

xataux

x

xK

0004433.0;

0004433.00004003.0;

0004003.0;

10000323.0

0004003.00

9x

xx

K

Page 9: Application of Fuzzy Model to Classification The Tomatoes

M - 17

Define Output Fuzzy Set

The output of Fuzzy set in this research is divided into four, those are; raw, half-ripe, ripe, and rotten.

They are presented by using membership function on the hose [1 4], those are:

2;0

21;1

2

x

xx

RAWL

32;

21;

21;

1

31

20

_

x

x

xorx

x

xRIPEHALFL

43;

21;

22;

1

41

20

x

x

xorx

x

xRIPEL

4;1

43;1

4

x

xx

ROTTENL

The function above showed in Figure 1.

FIGURE 1. Degree of membership

Determine Fuzzy Rules

Training data used were 34 images

so that there were 32 fuzzy rules. The 32

rules were obtained by counting the

membership degree of the data on each

input and output. The value of membership

degree is used as representative rules in the

fuzzy set. The processes to gain the fuzzy

rules which will be count using the MATLAB.

However, it will be given example manual to

make the rules by using the second image data is an image of half-ripe red guava. The rule formation can be

done after the extraction process finished so that it gained 11 variable input. Below is the result of the second

image on its extraction process successively by using the MATLAB:

TABLE 1. Resulted of classification fuzzy rules

No

Degree of Membership

Output A B C D E F G H I J K

1 A3 B4 C6 D8 E4 F2 G3 H5 I9 J8 K9 Ripe

2 A4 B5 C4 D8 E3 F4 G5 H9 I7 J8 K4 Ripe

3 A4 B2 C5 D6 E4 F2 G3 H3 I6 J5 K5 Rotten

4 A3 B5 C4 D7 E4 F4 G4 H5 I6 J7 K6 Half Ripe

Page 10: Application of Fuzzy Model to Classification The Tomatoes

M - 18

Inferencing and Defuzzification

Used by mamdani fuzzy inference sytem and centroid defuzzification obtained result of training data and testing data.

The result showed in Table 2 and Table 3.

5 A1 B6 C7 D9 E2 F2 G3 H8 I5 J3 K2 Ripe

6 A4 B6 C3 D7 E5 F5 G5 H7 I5 J8 K5 Ripe

7 A6 B7 C6 D8 E9 F8 G8 H1 I5 J7 K6 Rotten

8 A3 B6 C5 D7 E6 F4 G5 H1 I5 J6 K6 Raw

9 A4 B5 C3 D7 E3 F5 G5 H8 I5 J5 K2 Ripe

10 A5 B1 C4 D6 E4 F3 G3 H4 I5 J6 K5 Rotten

11 A3 B5 C4 D7 E3 F3 G4 H8 I5 J6 K3 Ripe

12 A3 B6 C4 D7 E3 F3 G4 H5 I5 J5 K4 Ripe

13 A1 B3 C8 D8 E2 F1 G1 H3 I4 J3 K4 Rotten

14 A4 B4 C4 D6 E5 F4 G4 H3 I4 J7 K5 Rotten

15 A2 B1 C9 D8 E2 F1 G1 H4 I4 J4 K4 Rotten

16 A1 B5 C7 D9 E1 F2 G2 H8 I4 J1 K2 Rotten

17 A4 B6 C5 D7 E6 F6 G7 H4 I4 J7 K4 Half Ripe

18 A5 B4 C3 D7 E5 F4 G5 H4 I4 J7 K5 Raw

19 A2 B7 C4 D9 E1 F3 G4 H9 I4 J2 K1 Half Ripe

20 A4 B6 C3 D7 E7 F6 G6 H3 I4 J9 K7 Raw

21 A4 B6 C4 D7 E6 F6 G6 H3 I4 J7 K5 Raw

22 A3 B4 C5 D8 E3 F3 G3 H5 I4 J5 K4 Rotten

23 A2 B2 C7 D8 E2 F2 G2 H5 I3 J2 K2 Rotten

24 A3 B9 C7 D9 E8 F8 G8 H2 I3 J6 K4 Raw

25 A9 B2 C2 D1 E6 F6 G7 H3 I3 J6 K4 Raw

26 A7 B6 C1 D6 E8 F9 G9 H4 I3 J8 K4 Half Ripe

27 A3 B8 C3 D8 E6 F6 G7 H4 I3 J8 K4 Half Ripe

28 A3 B9 C7 D9 E8 F9 G9 H1 I2 J5 K3 Raw

29 A4 B6 C3 D7 E4 F5 G6 H5 I2 J6 K3 Ripe

30 A2 B7 C4 D8 E3 F4 G4 H4 I2 J4 K2 Ripe

31

32

A4

A3

B9

B8

C1

C4

D7

D8

E7

E4

F9

F6

G9

G10

H6

H6

I2

I1

J9

J4

K3

K3

Raw

Half Rape

Page 11: Application of Fuzzy Model to Classification The Tomatoes

M - 19

TABLE 2. Resulted of classification training data

No Real Output Value of

Defuzzification

Output of

Model

1 Ripe 3 Ripe

2 Ripe 3 Ripe

3 Rotten 3.62 Rotten

4 Rotten 3.53 Rotten

5 Ripe 3 Ripe

6 Ripe 3 Ripe

7 Rotten 3.62 Rotten

8 Raw 1.38 Raw

9 Ripe 3 Ripe

10 Rotten 3.62 Rotten

11 Ripe 3 Ripe

12 Ripe 3 Ripe

13 Rotten 3.36 Rotten

14 Rotten 2.5 Half Ripe

15 Rotten 3.65 Rotten

16 Rotten 2.5 Half Ripe

17 Half Ripe 1.94 Half Ripe

18 Raw 3.51 Rotten

19 Half Ripe 2 Half Ripe

20 Raw 1.37 Raw

21 Raw 1.38 Raw

22 Rotten 3.62 Rotten

23 Rotten 3.63 Rotten

24 Raw 1.36 Raw

25 Raw 1.36 Raw

26 Half Ripe 2 Half Ripe

27 Half Ripe 2 Half Ripe

28 Raw 1.37 Raw

29 Ripe 3 Ripe

30 Ripe 3 Ripe

31 Raw 1.38 Raw

32 Half Ripe 2 Half Ripe

Table 3. Resulted of classification Testing Data

No Original Output Defuzzification Output Modle

1 Half Ripe 2 Half Ripe

2 Raw 2.5 Half Ripe

3 Rotten 3.56 Rotten

4 Ripe 3 Ripe

5 Rotten 3.59 Rotten

6 Ripe 3 Ripe

7 Ripe 3 Ripe

8 Raw 1.38 Raw

9 Rotten 2.5 Half Ripe

10 Raw 1.37 Raw

11 Half Ripe 2.5 Half Ripe

12 Ripe 3 Ripe

13 Raw 1.38 Raw

14 Ripe 2.5 Half Ripe

15 Half Ripe 2.5 Half Ripe

Based on Table 2 and Table 3, obtained accuracy of tomatoes ripeness are 90.62% for training data and 80%

for testing data

CONCLUSION

The ripeness classification of tomatoes using the fuzzy model by image processing from RGB changes into

grayscale. The images from grayscale were extracted to gain the contrast, correlation, energy, homogeneity,

mean, variance, standard deviation, skewness, kurtosis, entropy, and IDM. After gaining the values of

extracting, the universal set is created to its input and output. In addition, the fuzzy set is defined for each input

Page 12: Application of Fuzzy Model to Classification The Tomatoes

M - 20

and output followed by inference from fuzzy rules and the last is the defuzzification towards the existing rules.

After finishing the processes, the fuzzy system is obtained. The formed fuzzy system will be used to decide the

level of ripeness on the testing data. The accuracy of the tomatoes ripeness for training data were 90.62%,

meanwhile; classifying the accuracy of tomatoes ripeness level on the data testing were 80%.

REFERENCES

1. K. Choi., G. Lee., Y.J. Han, J. M. Bunn, Journal Am. Soc. Agric. Eng. 38 (1), 171–176, (1995). 2. J. H. Heron, and G. L. Zachariah, Journal Transactions oftheASAE 17(5), 987-992, (1974)

3. S. Moini, and M. O’Brien, Journal Transactions oftheASAE 21(4), 797-800, (1978)

4. S. A. Shearer, and F. A. Paynen, Journal Transactions oftheASAE 33(6):2045-2050, (1990).

5. I. Kadir, and D. E. Guyer, 27 (2003) 375-382, (2003).

6. R. L. Shewfelt., S. E. Prussia., A. V. A. Resurreccion., W. C. Hurst., and D. T. Cambell, Journal J. of

Food Sci. 52(3):661-664, (1987).

7. Leemans et al., Journal . Computers and Electronics in Africulture. Volume 23. : 43-53, (1999)

8. M. Dadwal, and V. K Banga, Journal international of engineering and advanced technologu,2 (1): 225-

229, (2012)

9. A. Naba, Belajar Cepat Fuzzy Logic Menggunakan Matlab, (Yogyakarta : Andi, 2009)

10. L. X. Wang, A Course in Fuzzy System and Control, (Prentice Hall International: New Jersey, 1997).

11. A. K. Shackelford, and C. H. Devis, Journal IEEE transactions on geoscience and remote sensing, 41

(10): 10, (2003)

12. R. Alcala, Y. Nojima, F. Herrera, and H. Ishibuchi, Journal springer, DOI 10.1007/s00500-010-0671-2,

(2010).