Sumatra Traditional Food Image Classification Using Classical Machine Learning
Sumatra Traditional Food Image Classification Using Classical Machine Learning
Abstract— Indonesia is a country rich in culture.One of Traditional food itself has an important role apart from
Indonesia’s culturaldiversity is on traditional foods. Traditional cultural aspects. Traditional food have implications for
food not only has a role in the cultural aspect, but also has an biodiversity [3]. The existence of traditional foods provides
influence on biodiversity. Unfortunately, the current diet of variations in people's diet which requires variations in food
people endangers the existence of traditional foods, which
ingredients, where by preserving traditional foods can help
indirectly will also affect Indonesia's food security. Indonesia
Local Food Database is one solution proposed to prevent this maintain varieties of these food ingredients and indirectly can
problem, where the database will play a role to monitor food preserve biodiversity.
systems in Indonesia. In this research, database development will At present, people diets are only based on certain
focus on collecting data for Sumatra traditionalfood, and also
building a model for image classification which will later become
commodities, which causes the diversity of traditional foods to
one of the main features of the database. Some features like color be threatened. One solution that can be applied is
and texture are extracted from the image. These features are using territorial approach to food systems [4]. Food system
used for classification using 5 classical machine learning models. itself is a complex system that involves many interactions
Evaluation results show performance that as good as deep between humans and natural components [5]. Food systems
learning approach. involve food processing such as production, processing,
distribution, and consumption to ensure food security of a
Keywords—classical machine learning, traditional food, food population [6]. A territorial approach to food systems will
security, feature extractions, histograms, Gabor features
support Indonesian agriculture, which will have a positive
I. INTRODUCTION impact for Indonesia’s economy.
Indonesia is a large country consisting of hundreds of Indonesia has done several things to ensure food security
cultures and ethnicities, where each ethnic originates from its in Indonesia. Unfortunately, it has not been fulfilled because
own geographical area. For example, Javanese and Sundanese there is an imbalance in food supply. Some regions are still
originate from Java, Malays and Bataks are from the island of experiencing undersupply, and some other are experiencing
Sumatra, and Dayaks come from Kalimantan. Each ethnic oversupply [7]. Based on the United Nations World Food
group contributes to the diversity of Indonesian culture, such as Program (UN WFP), some parts of Indonesia are still
language, art, food, and some other aspects of culture. categorized as "chronically food insecure". The availability of
Although Sumatra is not the most populous island in food supplies is a major problem in Food Security Indonesia
Indonesia [1], the island of Sumatra has several ethnicities [8].
which have contributed greatly to Indonesian culture. One of As part of the development of a database of Indonesian
the examples is the traditional food of the Minangkabau ethnic Local Food Database, this research will discuss the
group that is famous not only in Indonesia but also overseas classification of Indonesian traditional food images using
because of the migration culture of the Minangkabau [2]. classical machine learning. The classical machine learning
*Petrus Mursanto is corresponding author from Faculty of Computer
Science, Univesitas Indonesia santo@cs.ui.ac.id
method was chosen because the number of food classes is the needs of the traditional food database to be developed. List
small, so the classical method was deemed sufficient to of food images that are being collected in this research can be
provide good performance. Automatic classification of seen in Table 1. Next, the collected images will be
Indonesian food images is expected to ease the development preprocessed to improve image quality and maintaining
of Indonesian Local Food Database, so that later it can be uniformity of data before feature extraction is performed. After
used to help maintaining food security and sustainability in that the data will be divided into data for training and testing to
Indonesia. build and test machine learning models. Finally, the results of
testing will be evaluated using several metrics.This
The Indonesian Local Food Database will contain images methodology is illustrated in Figure 1.
of traditional Indonesian foods. Data development in this
database isexpected to be supported by the high culture of A. Data Acquisition
uploading food photos on social media [25], where we could For this study, the data used are images of 8 traditional
put these images to our database.In addition, database Sumatran foods. The food is ordered from a restaurant that
development will also involve the development of specializes in traditional food and then photographed in the
classification system for Indonesian food images. The laboratory using a uniform method. Food images are obtained
classification system will be used to classify new images for using the same camera, which is a Digital SLR camera that
the database. In addition, the food classification system produces images in CR2 format. Food is placed in a mini
developed is expected to have good performance so that studio box to provide identical location. The lighting conditions
people can later use this system to find out the type of food in the mini studio box are set to 1250 lumens with the help of
based on the image. artificial light.
This paper is organized as follows: the first section explains Images acquisition is done from several. The first angle of
the background and motivations of this research.The second capture is where the camera is set to position 45O and is about
sectionprovides related works on traditional foods and image 1.2 meters from food. The focus of the lens for this shooting
classification using classical machine learning. The next angle is 80mm. Another angle of capture is where the camera
section explains the methodology used in research ranging is at 90O from food. In this position, the camera is set within
from collecting traditional food data to evaluating the results of 0.7 meters of food and the focus of the lens used is 50mm. For
the classification.The fourth section presents the experiment each angle, about 20 times the photo was taken with a variety
setup and its results. Summary and future works of this of food angles to the camera to diversify the image obtained.
research are provided in the last section of this paper. The list of traditional Sumatran food collected in its image can
II. RELATED WORKS be seen in the Table 1.
For Indonesian food, Setyonoet. al, have classified the B. Image Pre-Processing
image for traditional Betawi food. Image classification is Pre-processing is done in the form of cropping parts of the
carried out on 12 types of food where the data is obtained by images to get the Region of Interest (ROI), namely the food
crawling from Google. Betawi food images then is classified part only. In addition, the exposure of the images are also set
using deep learning[9]. Convolutional Neural Network (CNN) based on the histogram using Adobe Photoshop Lightroom to
is also used in research [10] for food classification. get the overall results of the standardized image. Before
Classification with the classical method requires the conducting the feature extraction process,the images were
extraction of information that can be used as a feature for resized to 224 by 224 pixels in python.An example of image
building models from images. Commonly used features are comparison before and after preprocessing can be seen in
color and texture, as in research [11][12]. In research [13], Figure 2.
texture, color, and local region features are extracted from C. Feature Extraction
images and then classified using the K-Nearest Neighbors
As mentioned in the previous section, the extracted features
classifier. Features are often combined to get better machine
are generally in the form of textures and colors. Previous works
learning performance, as in research [14] that uses multilevel
have shown that both of these features are good for use in food
salient region detection, multiscale segmentation, and fast
image classification. This research will use the histogram
rejection in feature extraction.
feature to extract color information from the image. In addition,
In general, research related to image classification uses the Gabor filters are used to retrieve texture information from the
following methodologies: feature extraction and classification. image.
In this research, the features used are histograms for colors, and
Gabor features for textures. As for the classifier that will be
used are as follows: Logistic Regression, Linear Discriminant
Analysis (LDA), Random Forest, and Decision Tree.
III. METHODOLOGIES
Before conducting a classification using classical machine
learning, data for this research were collected by photographing
the required images according to research needs. For this Fig. 1. Methodology used in this paper
reason, the data used in this study are original and adjusted to
2019 3rd International Conference on Informatics and Computational Sciences (ICICoS)
TABLE I. List of Traditional Food for Acquisition D. Data Training and Classification
Data Training is carried out using several classical machine
Food List
No learning models. Models used include Logistic Regression,
Food Name Area Ethnicity
Linear Discriminant Analysis (LDA), Decision Tree, and
1 Rendang West Sumatra Minangkabau Random Forest. Logistic Regression is a classification
2 Mie Aceh Aceh Acehnese calculation that is based on the linear regression formula.
Logistic Regression is quite commonly used in image
3 Pempek South Sumatra Malays classification in various fields, for example in the health sector
4 Bika Ambon North Sumatra Malays [19]. LDA is a classification method which will form a new
feature where the new features will be selected in order to
5 Tekwan South Sumatra Malays
make the distinction between classes even greater. LDA has
6 KueAdee Aceh Acehnese been used several times in other studies to classify food
images [20] [21]. Decision trees classify images by building a
7 Otak-otak Riau Islands Malays
tree of features in the training data for use in testing data.
8 SayurNangka West Sumatra Minangkabau Decision trees often encounter the problem of over fitting, for
this reason the Random Forest method is used in which in this
training several decision trees are built which will be used
randomly when testing data. Random forest itself has also
been used for food classification [22].
E. Evaluation
The results of the classification of each machine learning
model will then be evaluatedby the quality of the classification
results and the duration of the program runtime. The quality of
the classification result will be measured by calculating the
accuracy score, which can be obtained by the following
formula:
Fig. 2. Example of image before and after preprocessing
process of each model to produce accurate predictions. The TABLE III. RUNTIME PERFORMANCE
selection of histogram and Gabor features also proved
appropriate for classifying food images from this dataset. No Model Runtime (seconds)
Examples of correctly and incorrectly classified data are
presented on Figure 3. 1 Logistic Regression 20.7879
Classical machine learning uses computations that are less
2 LDA 0.8507
intensive than deep learning, so the program requires onlyshort
amount of runtime duration. Feature extraction for histogram 3 Decision Tree 0.7883
and Gabor takes 23.4536 seconds. Prediction of each model
4 Random Forest 0.6445
and runtime duration for trainingcan be seen in the Table2 and
Table 3.
V. CONCLUSION AND FUTURE WORKS
The evaluation and runtime results show that the classifier
involving tree is best suited for classifying these food Classical machine learning is a suitable approach for
images.Random forest classifier looks superior among others classifying small amounts of data. The selection of the right
because it can provide perfect metric evaluation values and features will affect the results of the evaluation of the machine
with shortest computation runtime.This shows that the use of learning model. Data collected in this research is proven to be
classical machine learning approach with tree is appropriate for able to support the performance of classifier to be able to
this case. provide good performance. Future work will be related to the
As a comparison, experiment using deep learning is development of Indonesia Local Food Database, both in terms
conducted using the same dataset. The experiment was carried of the dataset and in terms of the selection of classification
out using DenseNet-121 with 10 epochs and batch size of 128. methods.
The experiment shows an accuracy value of 0.99 which shows
that the classical approach can provide predictions that are as ACKNOWLEDGMENT
accurate as the deep learning. This classical machine learning
experiments also perform better than previous work using This work is supported by
classical method[13][23] in terms of accuracy. HibahPublikasiInternasionalTerindeks 9 (PIT 9) funded by
DRPM Universitas Indonesia No:NKB-
0011/UN2.R3.1/HKP.05.00/2019.
REFERENCES
[1] Bps.go.id. (2019). Penduduk Indonesia menurut Provinsi 1971, 1980,
1990, 1995, 2000 dan 2010. [online] Available at:
https://www.bps.go.id/statictable/2009/02/20/1267/penduduk-indonesia-
menurut-provinsi-1971-1980-1990-1995-2000-dan-2010.html [Accessed
10 Jul. 2019].
[2] Hastuti, P., Thoyib, A., Troena, E., & Setiawan, M. (2015). The Minang
Entrepreneur Characteristic. Procedia - Social And Behavioral Sciences,
211, 819-826. doi: 10.1016/j.sbspro.2015.11.108
[3] J. C. Kwik, “Traditional Food Knowledge: Renewing Culture and
Restoring Health”, M.S. Thesis, Environment and Resource Studies,
University of Waterloo, Waterloo, 2008.
[4] FAO, "FAO - News Article: Food diversity expresses cultural heritage
and is key for healthy diets", Fao.org, 2019. [Online]. Available:
http://www.fao.org/news/story/en/item/1171702/icode/. [Accessed: 10-
Jul- 2019].
[5] Allen, T., & Prosperi, P. (2016). Modeling Sustainable Food Systems.
Environmental Management, 57(5), 956-975. doi: 10.1007/s00267-016-
0664-8
[6] J. R. Porter, L. Xie, A. J. Challinor, K. Cochrane, S. M. Howden, M. M.
Fig. 3. Examples of a correctly and incorrectly classified data for bika
Iqbal, D. B. Lobell, and M. I. Travasso, “Food security and food
ambon and pempek.
production systems”, Climate Change 2014: Impacts, Adaptation, and
Vulnerability, pp. 485-533, 2014.
TABLE II. EVALUATION SCORE
[7] M. Limenta and S. Chandra, "INDONESIAN FOOD SECURITY
POLICY", Indonesian Law Review, vol. 2, pp. 245-265, 2018.
Metrics
Model [Accessed 10 Jul 2019].
Accuracy F1- Score [8] WFP, “Executive Brief: Indonesia Food Security Assessment and
Logistic Regression 0.7701 0.7439 Classification”, United Nations World Food Programme, 2007.
[9] N. F. P. Setyono, D. Chahyati, M. , " Betawi Traditional Food Image
LDA 0.6781 0.6631 Detection using ResNet and DenseNet", International Conference on
Advanced Computer Science and Information Systems 2018, pp. 441-
Decision Tree 0.9885 0.9849 445, 2018.
Random Forest 1 1 [10] R. P. Prasetya, F. A. Bachtiar, "Indonesian Food Items Labeling for
Tourism Information Using Convolution Neural Network", 2017
2019 3rd International Conference on Informatics and Computational Sciences (ICICoS)
International Conference on Sustainable Information Engineering and [17] S. Ting and B. Zhang, "Diabetes Mellitus Detection Based on Facial
Technology (SIET), pp. 327-331, 2017. Block Texture Features Using the Gabor Filter," 2014 IEEE 17th
[11] Y. Wang, C. Liu, F. Zhu, C. J. Boushey and E. J. Delp, "Efficient International Conference on Computational Science and Engineering,
superpixel based segmentation for food image analysis," 2016 IEEE Chengdu, 2014, pp. 1-6.doi: 10.1109/CSE.2014.35
International Conference on Image Processing (ICIP), Phoenix, AZ, [18] Daugman, "High confidence visual recognition of persons by a test of
2016, pp. 2544-2548. doi: 10.1109/ICIP.2016.7532818WFP, “Executive statistical independence, " IEEE Trans. on PAMI, vol. 25, no. 9, 1993.
Brief: Indonesia Food Security Assessment and Classification”, United [19] H. Abedy, F. Ahmed, M. N. Qaisar Bhuiyan, M. Islam, M. N. Ali and
Nations World Food Programme, 2007. M. Shamsujjoha, "Leukemia Prediction from Microscopic Images of
[12] Y. He, C. Xu, N. Khanna, C. J. Boushey and E. J. Delp, "Food image Human Blood Cell Using HOG Feature Descriptor and Logistic
analysis: Segmentation, identification and weight estimation," 2013 Regression," 2018 16th International Conference on ICT and
IEEE International Conference on Multimedia and Expo (ICME), San Knowledge Engineering (ICT&KE), Bangkok, 2018, pp. 1-6.
Jose, CA, 2013, pp.1-6. doi: 10.1109/ICME.2013.6607548 doi: 10.1109/ICTKE.2018.8612303
[13] Y. He, C. Xu,N. Khanna, C. J. .Boushey,R. J. Delp, "ANALYSIS OF [20] AF. Mendoza, P. Dejmek and J. Aguilera, "Colour and image texture
FOOD IMAGES: FEATURES AND CLASSIFICATION ", ICIP 2014, analysis in classification of commercial potato chips", Food Research
pp. 2744-2748, 2014. International, vol. 40, no. 9, pp. 1146-1154, 2007. Available:
[14] F. Zhu, M. Bosch, N. Khanna, C. Boushey and E. Delp, "Multiple 10.1016/j.foodres.2007.06.014.
Hypotheses Image Segmentation and Classification With Application to [21] A. Haidar, H. Dong, N. Mavridis, " Image-Based Date Fruit
Dietary Assessment", IEEE Journal of Biomedical and Health Classification", International Congress on Ultra Modern
Informatics, vol. 19, no. 1, pp. 377-388, 2015. Available: Telecommunications and Control Systems 2012, pp. 357-363, 2012.
10.1109/jbhi.2014.2304925 WFP, “Executive Brief: Indonesia Food [22] L. Bossard, M. Guillaumin, L. V. Gool, " Food-101 – Mining
Security Assessment and Classification”, United Nations World Food Discriminative Components with Random Forests", 13th ECCV:
Programme, 2007. European Conference on Computer Vision, pp. 446-461, 2014.
[15] R. A. Asmara, F. Rahutomo, Q. Hasanah and C. Rahmad, "Chicken [23] Liu, L., Ngadi, M., Prasher, S., & Gariépy, C. (2010). Categorization of
meat freshness identification using the histogram color feature," 2017 pork quality using Gabor filter-based hyperspectral imaging technology.
International Conference on Sustainable Information Engineering and Journal Of Food Engineering, 99(3), 284-293. doi:
Technology (SIET), Malang, 2017, pp. 57-61. 10.1016/j.jfoodeng.2010.03.001
doi: 10.1109/SIET.2017.8304109 [24] Zhu, B., Jiang, L., Luo, Y., & Tao, Y. (2007). Gabor feature-based apple
[16] J. Kamarainen, "Gabor features in image analysis," 2012 3rd quality inspection using kernel principal component analysis. Journal Of
International Conference on Image Processing Theory, Tools and Food Engineering, 81(4), 741-749. doi: 10.1016/j.jfoodeng.2007.01.00
Applications (IPTA), Istanbul, 2012, pp. 13-14.doi: [25] Barre, L., Cronin, K., & Thompson, A. (2016). What People Post About
10.1109/IPTA.2012.6469502 Food on Social Media. Journal Of Nutrition Education And Behavior,
48(7), S52. doi: 10.1016/j.jneb.2016.04.141