Professional Documents
Culture Documents
Nearest Neighbor
Abstract— This study proposes a method of searching for differentiate beef and pork. Imagery is also applied to the
broccoli quality based on imagery using the Fuzzy K-Nearest classification of domestic chicken egg grades [5].
Neighbor (F-KNN). Broccoli is used because it is a type of
herbaceous vegetable that has a unique color and shape so visual In the process of digital image processing, feature
assessment is still limited. The data used in this study were taken extraction is needed to extract features from objects that are to
from 2 cities in Indonesia, Pasuruan and Malang Regency which be distinguished from other objects. Common features of
consisted of good quality and bad quality. The total data used is feature extraction include shape, color, texture, and size.
120, each quality comprising 60 images. In the pre-processing Implementation using texture feature extraction has been
process, several stages are carried out to proceed to the next carried out using texture feature extraction Local Binary
process. Feature extraction is done through algorithms, namely Pattern (LBP) to classify papaya [6] and other multi-class
HSI (Hue, Saturation, and Intensity) and LBP (Local Binary fruits [7]. A similar implementation of texture feature
Pattern), which are then divided into training and testing data. extraction has also been carried out by [8] for setting lace
F-KNN is used as a classification. The accuracy obtained from image parameters. Researchers [9] and [10] also use similar
this study reached 94.4%. This value indicates that the use of feature extraction for their research by combining other
both feature extraction and classification algorithms produces features.
good accuracy in the training and testing data with a 40:60
scenario. This result showed the potential of the feature In addition to texture feature extraction, color feature
extraction and F-KNN algorithm when classifying a large extraction also needs to be done to distinguish an object with
number of broccoli qualities. a certain color. Research [11] used Hue, Saturation, Intensity
(HSI) color feature extraction to detect bleeding in wireless
Keywords—Fuzzy K-Nearest Neighbor, HSI Features capsule endoscope images using the Support Vector Machine
Extraction, LBP Feature Extraction, Broccoli Classification. (SVM) classification algorithm. The classification algorithm
is also needed because it is an important step in classifying an
I. INTRODUCTION object. One of them is the Fuzzy K-Nearest Neighbor which
Broccoli (Brassica oleracea var. Italica) is an herbaceous is a classifier algorithm that is widely used for classification,
vegetable that is rich in nutrients and is often consumed by the both in the form of images [12]–[15] or data [16].
public. Broccoli is easy to cultivate in cool, wet climates. A Classification to determine the quality of an object using this
good time to plant broccoli is at the beginning of the rainy algorithm has been carried out by [17] to classify the quality
season or the beginning of the dry season. However, it is of milkfish, and [18] to classify soybean plant diseases in leaf
possible if broccoli is grown all year round if it is cultivated images with the highest accuracy of 83.33%.
intensively.
Based on the literature study, LBP texture feature
This incentive treatment aims to maintain the quality of extraction and HSI color feature extraction have been widely
broccoli so that consumers get optimal nutrition from this used for digital image research and produce high accuracy.
vegetable. Currently, the quality of broccoli is usually visually Good quality broccoli has a tight texture and a fresh white
rated by farmers based on the size, color, shape, and longevity color and vice versa. Objectively classifying broccoli's quality
of the broccoli after harvest. However, this visual rate is can help improve consistency and accuracy in assessing the
limited in detecting more subtle quality differences in quality of vegetables by using feature extraction and classifier
broccoli. algorithms. So that it can provide benefits in supporting the
production of higher-quality vegetables and ensuring the
Digital image processing is now often developed by optimal availability of nutrients for consumers.
researchers as a method of classification or identification
through images, both on fruits and vegetables. Research [1] In this study, to classify the quality of broccoli, we used
succeeded in classifying the maturity level of Golek Mango the feature extraction of the LBP texture and the HSI color
using the Fuzzy C-Means classification method and obtaining obtained from pre-processing. After that, we used the Fuzzy
a high accuracy of 83.3%. Digital image processing was also K-Nearest Neighbor (F-KNN) Classifier, which refers to the
developed for detecting and classifying citrus fruit diseases as research above that has never done a quality classification of
was done by [2]. In research conducted by [3] digital imagery broccoli based on color and texture, creating a gap in this
is also used to measure the dimensions of sunflowers. study.
Classification image processing is also used by [4] to
The upcoming section will explain the methodology then selecting the best image from the Hue, Saturation, and
employed in this study, along with a comprehensive Intensity image processes. Next, we select the intensity to be
description of each stage involved. The findings and processed into texture extraction. Figure 3 shows the results
subsequent discussion will be presented in Chapter III, of the color character values of each image.
followed by a concluding section in Chapter IV.
II. METHODOLOGY
In this stage, we describe the methods and data we used
in this study. Figure 1 shows the five stages starting from the
input image, pre-processing, feature extraction,
classification, and output which we will explain in detail (a) (b) (c)
between the sub-chapters.
Fig. 3 Channel separator based on each channel (a) Hue, (b) Saturation, and
(c) Intensity.
B. Pre-processing Data
After inputting the dataset, the next step is pre-processing
which aims to convert the data into numbers. This process
requires several steps the image is separated from the
background. It starts with processing the initial data from the
input RGB image, then we convert it into an HSI image. After
that, the process continues by separating the HSI channels,
P = the number of sampling points
gp = the gray value of 𝑝
gc = center pixel value
𝑠 = sign (binary code).
Before carrying out feature extraction using the LBP
method, the segmented image data is converted into a
grayscale image. Furthermore, the grayscale image pixel
values are extracted using LBP [21].
D. Classification using Fuzzy K-Nearest Neighbor (F-KNN)
Object classification is an important area of research and
practical applications in a variety of fields, including pattern
Fig. 5 The HSI color model based on circular color planes [19]
recognition and artificial intelligence, statistics, cognitive
To convert RGB images to HSI use Equation (1). In psychology, vision analysis, and medicine. Pattern
Equation (1), the H function for hue values. The value of θ is recognition and pattern classification are based on data where
obtained from Equation (2). The saturation value is the sample size of each class is small. In many circumstances,
determined by Equation (3) and the intensity is determined the K-Nearest Neighbor (KNN) algorithm is used to perform
by Equation (4). the classification. This decision provides a simple
θ if B ≤ G nonparametric procedure for class labels to input patterns
𝐻={ (1)
360 if B > G based on class labels represented by KNN [22].
The Fuzzy K-Nearest Neighbor (F-KNN) algorithm is a
1
[(𝑅−𝐺)+(𝑅−𝐵)] development of K-NN, the F-KNN algorithm focuses more
𝜃 = 𝑐𝑜𝑠 −1 { 2
1 } (2) on class membership into a pattern (pattern) than assigning
[((𝑅−𝐺)2 + (𝑅−𝐵)(𝐺−𝐵))]2
patterns to a particular class. The basis of this algorithm is to
3 determine membership as a function of the pattern distance
𝑆 = 1 − (𝑅+𝐺+𝐵) [min (𝑅, 𝐺, 𝐵)] (3) from K-NN and determine the possible classes [23].
The Fuzzy K-Nearest Neighbor (F-KNN) classification
1 process has several stages, the first is by determining the
𝐼 = (𝑅 + 𝐺 + 𝐵) (4) value of the i-class membership in the j-neighbor. The
3
following is Equation (7) which is used in determining the
2) Local Binary Pattern (LBP) membership value.
Local Binary Pattern (LBP) is a method used for texture 𝑛𝑗
0.51 + ( ) ∗ 0.49 → 𝑗 = 𝑖
recognition by using a grayscale color on a surface based on 𝑢𝑗 (𝑥) = { 𝐾
(7)
the difference between the neighboring pixels and the central 𝑛𝑗
( ) ∗ 0.49 → 𝑗 ≠ 𝑖
pixel. LBP is widely used in various applications. LBP works 𝐾
by labeling the pixels in the image based on the neighboring
threshold of each pixel and displaying them in binary [20] where,
The basic operation of LBP measures 3x3 of an image uij = neighbor membership value
using 8 neighboring pixels as shown in Figure 6. nj = the number of class-i neighbors in the KNN set
To determine the membership value of each class in the test
data, the process uses the formula Equation (8).
1
∑𝑘
𝑗=1 𝑢𝑖𝑗 ( 2 )
||𝑥−𝑥𝑗 ||
𝑢𝑖 (𝑥) = 1
𝑚−1
(8)
∑𝑘
𝑗=1 ( 2 )
||𝑥−𝑥𝑗 ||
𝑚−1