Classification of Typical Food from Sulawesi using Artificial Neural
Network and Wavelet Haar
Trisno
1
and Salahudin Robo
2
1
Department of Informatika Engineering, STIMIKOM Stellamaris Sumba, Indonesia
2
Department of information system, Universitas Yapis Papua, Papua, Indonesia
Keywords:
Artificial Neural network, backpropagation and wavelet Haar.
Abstract:
Food is the important thing in every region, but not everyone knows the form and type of the food. Therefore,
this article used backpropagation algorithm and wavelet haar 2D method to classify food. The research used
appropriate image data and tested the images using 32*32*3 wavelet Haar 2 D which was changed to 3072.
Extracted feature was processed into 1 dimensional and trained backpropagation neural network to be able
to classify food. The result of backproppagation training was a dataset of 4.160 images. Samples with 10
iterations had 80 % training Acc and 80% validation Acc. Samples with 50 iterations had 81.63 % training
Acc and 81.42% validation Acc. Samples with 100 iterations had 82.7 % training Acc and 82.71% validation
Acc. Samples with 150 iterations had 83.29 % training Acc and 82.11% validation Acc and sample with 200
iterations had 84.31 % training Acc and 82.34% validation Acc.
1 INTRODUCTION
Food product is everything which originates from bi-
ological source for consumption of every living being
to be an energy source for the body to perform var-
ious activities (Turmchokkasam and Chamnongthai,
2018). Typical food, especially from Sulawesi, i.e.
Southeast, South, West, and North Sulawesi, are very
diverse and have different quality and flavour (Chen
et al., 2013). Food is the important thing in every re-
gion to be consumed and to be the pride of local peo-
ple. However, not everyone knows the types of food
in Sulawesi. Therefore, this writing required an im-
plementation using food image from every region (Fu
et al., 1976)(Biphenyls, 2015). The processing used
wavelet Haar and Artificial Neural Network to intro-
duce food images to classify various food from the
regions using backpropagation algorithm (Sarlashkar
et al., 1998) (Singh et al., 2012). Artificial Neural
Network (JST) can be a problem solving algorithm to
perform data mapping, regression, modeling, group-
ing, classification and analysis using wavelet Haar
2D method which can extract image (Debska and
Guzowska-swider, 2011) (Liu et al., 2010).(Wu et al.,
2009).
2 LITERATURE REVIEW
Below are previous studies :
The process of identifying food items from an im-
age is quite an interesting field with various applica-
tions. In this paper, an approach has been presented
to classify images of food using convolutional neu-
ral networks. Unlike the traditional artificial neu-
ral networks, convolutional neural networks have the
capability of estimating the score function directly
from image pixels. A 2D convolution layer has been
utilised which creates a convolution kernel that is con-
volved with the layer input to produce a tensor of out-
puts. There are multiple such layers, and the outputs
are concatenated at parts to form the final tensor of
outputs. We also use the Max-Pooling function for
the data, and the features extracted from this function
are used to train the network.(Attokaren et al., 2017)
Face recognition is an efficient biometric tech-
nique which automatically identifies the face of an
individual from adatabase of images. This paper
proposes a face recognition technique using Gabor
wavelet and Backpropagation Neural Network. In the
proposed method, Gabor wavelet coefficients are used
for creating feature vector due to its representative ca-
pability of the primary visual cortex of Human Vi-
sual System. The method also uses Principal Compo-
nent Analysis for dimensionality reduction. The re-
330
Trisno, . and Robo, S.
Classification of Typical Food from Sulawesi using Artificial Neural Network and Wavelet Haar.
DOI: 10.5220/0009909903300335
In Proceedings of the International Conferences on Information System and Technology (CONRIST 2019), pages 330-335
ISBN: 978-989-758-453-4
Copyright
c
2020 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
duced feature vector is used as the input of the classi-
fier, the Backpropagation Neural Network. (Thomas
et al., 2013) Artificial Neural Network (ANN) clas-
sifiers have been successfully implemented for var-
ious quality inspection and grading tasks of diverse
food products. ANN are very good pattern classi-
fiers because of their ability to learn patterns that are
not linearly separable and concepts dealing with un-
certainty, noise and random events. In this research,
the ANN was used to build the classification model
based on the relevant features of beer. Samples of the
same brand of beer but with varying manufacturing
dates, originating from miscellaneous manufacturing
lots, have been represented in the multidimensional
space by data. The classification has been performed
for two subsets, the first that included samples of good
quality beer and the other containing samples of un-
satisfactory quality. (Debska and Guzowska-swider,
2011)
Image processing and analysis based on the con-
tinuous or discrete image transforms are classic tech-
niques. The image transforms are widely used in
image filtering, data description, etc. Nowadays
the wavelet theorems make up very popular meth-
ods of image processing, denoising and compression.
Considering that the Haar functions are the simplest
wavelets, these forms are used in many methods of
discrete image transforms and processing. (Mehala
and Kuppusamy, 2013)
3 METHODOLOGY
3.1 Research Material
In this study the author uses, some datasbase are cat-
egorized into 6 classes. This dataset contains food
images. Each image on the puppet databes has a size
of 32x32. This food image is collected from several
sources namely google image. Each puppet dataset
has a total image of 100 per class. Food images are
used for training data. validation and classification
testing
Figure 1: Research flowchart
The research flow was Collect image data as nec-
essary, process image using wavelet Haar 2 D size
32*32*3 which was transformed into 3072 which was
feature extracted into 1 dimensional. After the im-
age became 1 dimensional, train network was per-
formed using backpropagation of neural network and
then classification was performed.
3.2 Artificial Neural Network
Artificial neural network is a computer program
which has biological properties which is designed
to simulate information process which uses validated
model and has complex ability to learn nonlinear
input-output relation using sequential training pro-
cedure (Bhotmange and Shastri, 2011) (Basu et al.,
2010).
Artificial neural network is also an artificial intel-
ligence method which is developed progressively and
which produces result in estimation contrasted with
other traditional scientific models, e.g. regression,
correlation, science, engineering, etc. (Vonk et al.,
1995). Below is a figure of the hidden layer of artifi-
cial neural network:
Figure 2: layer of artificial neural network (Naik and Patel,
2017)
This study used 2 hidden layers of artificial neural
network using backpropagagtion algorithm (De Vil-
liers and Barnard, 1993).
Figure 3: architecture of backpropagation (Thomas et al.,
2013)
Backpropagation is one of the algorithms in arti-
ficial neural network training. The algorithm works
backward, from the output layer to the input layer to
renew value in hidden layer based on the obtained er-
ror value. Below are the steps of Backpropagation
Algorithm:
1. Starts from the input layer, count the output of ev-
ery processing element through the input layer.
2. Count error on the output layer, i.e. the difference
between the actual data and the target.
Classification of Typical Food from Sulawesi using Artificial Neural Network and Wavelet Haar
331
3. Transform the error on appropriate in the input
side of processing element.
4. Back propagate the error on the output of every
processing element to the error in the input. Re-
peat the process until the input is reached.
5. Change all weights using errors on the connected
processing input elements and output elements.
Backpropagation Algorithm The equation to cal-
culate neuron in the hidden layer :
X input of training vector
X = (x1, ..., xi, , ..., xn). (1)
T output of training target
T = (t1, ..., ti, ..., tm) (2)
α learning level
Xi input of unit i
Voj bias in hidden unit j
Zj Hidden unit j
Clean input for Zj connected with z inj :
z in
j
= v
o j
+ Σ
i
x
i
v
i j
(3)
The outcome of activation of zj connected with
z inj
z
j
= f (z in
j
) (4)
Wo k Bias for output unit k
Yk output for k
Clean input for Yk connected with y in k
y in
k
= w
ok
+ Σ
j
z
j
w
jk
(5)
The outcome of activation of Yk connected with
z yk
y
k
= f (y in
k
) (6)
Activation of bipolar sigmoid function (column) is
also referred to as hypothesis function which is used
to form limit which has (-1, 1) range.
f
2
(x) =
2
1 + exp(x)
1,
with
f
0
2
(x) =
1
2
[1 + f
2
(x)][1 f
2
(x)] (7)
3.3 Wavelet
Wavelet is a basis. Wavelet basis comes from a scal-
ing function and is also referred to as a scaling func-
tion. Scaling function can be arranged from a num-
ber of copies which have been dilated, translated and
scaled. The function is derived from dilation equa-
tion, which is considered the basis of wavelet theory.
3.4 Wavelet Haar
The wavelet type used in this study was wavelet Haar.
Wavelet Haar is wavelet which is supported com-
pactly, the oldest and simplest wavelet. Wavelet Haar
is orthogonal, meaning related with perpendicular an-
gle or in other words is referred to in mathematics and
supported compactly.(Deshmukh, )
The scaling function of Wavelet Haar is presented
in figure 4 below
Figure 4: Scaling function of wavelet
Image composition of wavelet transformation of
image is filtering image with wavelet filter. The result
of filtering is 4 image sub-fields of the original image.
The four image sub-fields are in the wavelet areas.
The four image sub-fields are low pass-low pass (LL),
low pass–high pass (LH), high pass-low pass (HL),
and high pass-high pass (HH). The process is called
decomposition. It can be resumed with low pass-low
pass (LL) image as the input to get decomposition.
Below is an image decomposition from level 1 to level
3.(Prihartono et al., 2011)
Figure 5: levels of wavelet decomposition
Figure 6: Steps of 2D composition
21 remove column with odd index 12 remove
line with odd index x convolute line with filter X x
convolute line with filter X
CONRIST 2019 - International Conferences on Information System and Technology
332
Lo D is low pass filter for decomposition, Hi D
is high pass filter for decomposition, CA is approx-
imated coefficient, CD h is coefficient of horizontal
detail, CD is coefficient of vertical detail, and CD is
coefficient of diagonal detail. (Misiti et al., 2009)
Below is the research flowchart
Process The stage of the image results by using
haar wavelet to backpropagation can be seen in the
picture below.
Figure 7: Image processing using wavelet haar and back-
propagation
The parts are the same as those described in the
Haar image process but here add the backpropation
algorithm process. the data will be trained with arti-
ficial neural networks using a backpropagation algo-
rithm which has 2 layers of hiden, the first hiden 768
and the second 384 with a lot of input, which is 3072
where input data comes from the size of the image
that has been extracted to 32x32x3 (3 = RGB)
4 RESULTS AND DISCUSSION
4.1 The Processes of Wavelet and
Backpropagation of Neural
Network
This step firstly changed the sizes of images and all
pixels on all images for input. Then they were pro-
cessed for classification. The example is presented
below.
Figure 8: Wavelet process into Artificial Neural Network
4.2 Feature Extract Image
The result of 2D haar wavelet. The process using
this database with 600 images in jpg format used
light source to differentiate shape of food, light, dark,
color, etc. The decomposition of wavelet 2-D of im-
age was similar with the case of one dimensional.
Two dimensional wavelet and scaling function were
obtained by collecting tensor from one dimensional
wavelet and scaling function. The DWT type of both
dimensions leaned toward decomposition ad details in
three orientation (horizontal, vertical, and diagonal).
The charts below explain basic decomposition steps
for image.
Figure 9: Approximation
Figure 10: Horizontal
Figure 11: Vertical
Classification of Typical Food from Sulawesi using Artificial Neural Network and Wavelet Haar
333
space
Figure 12: Diagonal
Below is the result of 2D haar wavelet
Figure 13: Diagonal
4.3 Classification
Classification was performed using Backpropagation
artificial neural network. Two hidden layers were
used and the number of neurons in the hidden layers
was found using trial and error method to get optimal
classification.
The commands of ‘anaconda, python and hard’
tools were used for the classified neural network pro-
cedure. A snapshot is shown below
Figure 14: Diagonal
The validation result is presented in Figure 15
training and validation with backpropagation. Below
is the table of ANN training.
Figure 15: Training and Validation of Backpropagation.
Epoch= iteration
Training= model learning image
Validation= model able to match training and testing
images
Acc= the measurement
Some cases were considered in Figure 15, Train-
ing samples were collected. Samples with 10 itera-
tions had 80 % training Acc and 80% validation Acc.
Samples with 50 iterations had 81.63 % training Acc
and 81.42% validation Acc. Samples with 100 itera-
tions had 82.7 % training Acc and 82.71% validation
Acc. Samples with 150 iterations had 83.29 % train-
ing Acc and 82.11% validation Acc and sample with
200 iterations had 84.31 % training Acc and 82.34%
validation Acc. Below is the result of artificial neural
network classification
Figure 16: Diagonal
The system managed to read the image as
cakalang. The detailed result is presented in Figure
17
Figure 17: lassification Result.
5 CONCLUSION AND
SUGGESTION
Implementing Artificial Neural Network can solve
the research problem because backpropagation and
wavelet method used pattern recognition, forecast or
estimation and image extraction. The research re-
sult of backpropagation algorithm of neural network
showed different accuracy levels. Training and val-
idation accuracy scores were quite good. The re-
searchers suggested continuing this study to produce
CONRIST 2019 - International Conferences on Information System and Technology
334
more accurate process using other programs and func-
tions of artificial neural network training with opti-
mized bias. Backpropagation algorithm is often used
as a suggested toolkit although it requires more mem-
ory than other algorithms. This algorithm shows bet-
ter performance.
REFERENCES
Attokaren, D. J., Fernandes, I. G., Sriram, A., Murthy, Y. S.,
and Koolagudi, S. G. (2017). Food classification from
images using convolutional neural networks. In TEN-
CON 2017-2017 IEEE Region 10 Conference, pages
2801–2806. IEEE.
Basu, J. K., Bhattacharyya, D., and Kim, T.-h. (2010). Use
of artificial neural network in pattern recognition. In-
ternational journal of software engineering and its ap-
plications, 4(2).
Bhotmange, M. and Shastri, P. (2011). Application of arti-
ficial neural networks to food and fermentation tech-
nology. Artificial neural networks–industrial and con-
trol engineering applications. Croatia: InTech, pages
201–222.
Biphenyls, C. (2015). Hhs public access, 91 (2), 165–171.
Chen, Q., Zhang, C., Zhao, J., and Ouyang, Q. (2013).
Recent advances in emerging imaging techniques for
non-destructive detection of food quality and safety.
TrAC Trends in Analytical Chemistry, 52:261–274.
De Villiers, J. and Barnard, E. (1993). Backpropagation
neural nets with one and two hidden layers. IEEE
transactions on neural networks, 4(1):136–141.
Debska, B. and Guzowska-swider, B. (2011). Application
of artificial neural network in food classification. An-
alytica Chimica Acta, 705(1-2):283–291.
Deshmukh, M. P. Ms. vaishali khole—modified aes based
algorithm for mpeg video encryption k icices2014-sa
engineering college, chennai, tamil nadu, india. isbn
no.
Fu, K.-S. et al. (1976). Pattern recognition and im-
age processing. IEEE transactions on computers,
100(12):1336–1346.
Liu, S., Han, K., Song, Z., and Li, M. (2010). Texture
characteristic extraction of medical images based on
pyramid structure wavelet transform. In 2010 Inter-
national Conference On Computer Design and Appli-
cations, volume 1, pages V1–342. IEEE.
Mehala, R. and Kuppusamy, K. (2013). A new image
compression algorithm using haar wavelet transfor-
mation. International Journal of Computer Applica-
tions, 975:8887.
Misiti, M., Misiti, Y., Oppenheim, G., and Poggi, J. (2009).
Matlab wavelet toolbox tm 4 user’s guide. The Math-
Works, Inc. Natick, Massachusetts. 153p.
Naik, S. and Patel, B. (2017). Machine vision based
fruit classification and grading-a review. International
Journal of Computer Applications, 170(9):22–34.
Prihartono, T. D., Isnanto, R. R., and Santoso, I.
(2011). Identifikasi Iris Mata Menggunakan Al-
ihragam Wavelet Haar. PhD thesis, Diponegoro Uni-
versity.
Sarlashkar, A., Bodruzzaman, M., and Malkani, M. (1998).
Feature extraction using wavelet transform for neural
network based image classification. In Proceedings of
Thirtieth Southeastern Symposium on System Theory,
pages 412–416. IEEE.
Singh, A. K., Tiwari, S., and Shukla, V. (2012). Wavelet
based multi class image classification using neural
network. International Journal of Computer Appli-
cations, 37(4):21–25.
Thomas, L. L., Gopakumar, C., and Thomas, A. A. (2013).
Face recognition based on gabor wavelet and back-
propagation neural network. J. Sci. Eng. Res, 4:2114–
2119.
Turmchokkasam, S. and Chamnongthai, K. (2018). The de-
sign and implementation of an ingredient-based food
calorie estimation system using nutrition knowledge
and fusion of brightness and heat information. IEEE
Access, 6:46863–46876.
Vonk, E., Jain, L. C., and Veelenturf, L. (1995). Neural net-
work applications. In Proceedings Electronic Technol-
ogy Directions to the Year 2000, pages 63–67. IEEE.
Wu, M.-K., Wei, J.-S., Shih, H.-C., and Ho, C. C. (2009).
2-level-wavelet-based license plate edge detection. In
2009 Fifth International Conference on Information
Assurance and Security, volume 2, pages 385–388.
IEEE.
Classification of Typical Food from Sulawesi using Artificial Neural Network and Wavelet Haar
335