Article information

2022 , Volume 27, ¹ 6, p.88-99

Arnita A., Yani M., Marpaung F., Hidayat M., Widianto A.

A comparative study of convolutional neural network and k - nearest neighbours algorithms for food image recognition

Food plays a vital role in everyday life, and public awareness of food quality has increased. The availability of many types of food has made it difficult for people to choose the right type of healthy food for consumption. The Convolutional Neural Network (CNN) and 𝑘-nearest neighbours (KNN) algorithms can be used to create classification and identification models, including food identification. Therefore, we need a system that can quickly identify the type of food and calculate the caloric value contained in the food to be consumed to maintain a healthy diet. To create the best identification model based on the goodness of the model. Metrics for accuracy, prediction, recall, and F1-score will be used for food identification using the CNN and KNN algorithms. This research method extracts food image input using the hue, saturation, and value (HSV) color space. Then the extracted data is classified using the CNN and KNN algorithms. Simulation in this study is done using 900 food images. The data is divided into two categories, namely training and test data, with a ratio of 75 and 25 %, respectively. The KNN algorithm was tested with 𝑘 = 3, 5, and 7, in simulation process and compared with the CNN. Based on the experiments conducted, it was found that the CNN method was better than the KNN Algorithm. There are two classes of food types that are resulted with wrong predictions, while the CNN method predicts only 1 class of food type as wrong. This is indicated by the accuracy of the CNN method, which is 5 % better than the KNN(3) method. The accuracy of the CNN method is 94 %, while the accuracy of the KNN(3) method is 89 %. The F1-score value for the CNN method is 0.94 and the KNN(3) method is 0.89. The CNN allows the model to produce an average precision of 87.7 %, the accuracy of 86.89 %, recall of 86.89 %, and F1-score of 86.33 %. The model formed using CNN is the best food identification model based on this simulation.

[full text]
Keywords: food image recognition, convolutional neural network, k -nearest neigh-bours, HSV color space

doi: 10.25743/ICT.2022.27.6.008

Author(s):
Arnita A.
Position: The master of mathematics
Office: Department of Mathematics Universitas Negeri Medan
Address: 20221, Indonesia, Medan
E-mail: arnita@unimed.ac.id

Yani Muhammad
Position: The master of mathematics
Office: Department of Mechanical Engineering Universitas Muhammadiyah Sumatera Utara
Address: 20238, Indonesia, Medan

Marpaung Faridawaty
Position: The master of mathematics
Office: Department of Mathematics Universitas Negeri Medan
Address: 20221, Indonesia, Medan
E-mail: farida2008.unim@gmail.com

Hidayat Muhammadh
Position: The master of mathematics
Office: Department of Mathematics Universitas Negeri Medan
Address: 20221, Indonesia, Medan

Widianto Azi
Office: Department of Mathematics Universitas Negeri Medan
Address: 20221, Indonesia, Medan

References:
[1] Ashakiran D.R., Deepthi R. Fast foods and their impact on health. Journal of Krishna Institute of Medical Sciences University. 2012; 1(2):7–15.

[2] Bahadoran Z., Mirmiran P., Azizi F. Fast food pattern and cardiometabolic disorders: a review of current studies. Health Promotion Perspectives. 2015; 5(4):231. DOI:10.15171/hpp.2015.028.

[3] Xiao L., Lan T., Xu D., Gao W., Li C. A simplified CNNs visual perception learning network algorithm for foods recognition. Computers & Electrical Engineering. 2021; 92:107152. DOI:10.1016/j.compeleceng.2021.107152.

[4] Shimoda W., Yanai K. CNN-based food image segmentation without pixel-wise annotation. International Conference on Image Analysis and Processing. Springer, Cham.: 2015; 449–457. DOI:10.1007/978-3-319-23222-5 55.

[5] Sugiarth I.G., Sudarma M., Widyantara I.M. Ekstraksi fitur warna, tekstur dan bentuk untuk clustered-based retrieval of images (CLUE). Majalah Ilmiah Teknologi Elektro. 2016; 16(1):85. DOI:10.24843/mite.1601.12.

[6] Ibraheem C.M., Reddy G.U. Content based image retrieval using HSV color, shape and GLCM texture. International Journal of Advanced Research in Computer and Communication Engineering. 2015; 4(10):378–383. DOI:10.17148/IJARCCE.2015.41082.

[7] Anton A., Nissa N.F., Janiati A., Cahya N., Astuti P. Application of deep learning using convolutional neural network (CNN) method for womens skin classification. Scientific Journal of Informatics. 2021; 8(1):144–153. DOI:10.15294/sji.v8i1.26888.

[8] Indolia S., Goswami A.K., Mishra S.P., Asopa P. Conceptual understanding of convolutional neural network — a deep learning approach. Procedia Computer Science. 2018; 132:679–688. DOI:10.1016/j.procs.2018.05.069

[9] Imandoust S.B., Bolandraftar M. Application of k-nearest neighbor (knn) approach for predicting economic events: theoretical background. International Journal of Engineering Research and Applications. 2013; 3(5):605–610.

[10] Syaliman K.U., Nababan E.B., Sitompul O.S. Improving the accuracy of k-nearest neighbor using local mean based and distance weight. Journal of Physics: Conference Series. 2018; 978(1):012047. DOI:10.1088/17426596/978/1/012047.

[11] Gou J., Xiong T., Kuang Y. A novel weighted voting for k-nearest neighbor rule. Journal of Computers. 2011; 6(5):833–840. DOI:10.4304/jcp.6.5.833-840.

[12] Bhatia N. Survey of nearest neighbor techniques. 2010. Available at: http://arxiv.org/abs/1007.0085.

[13] Pathanjali C., Salis V.E., Jalaja G., Latha A. A comparative study of Indian food image classification using K-nearest-neighbour and support-vector-machines. International Journal of Engineering & Technology. 2018; 7(3.12):521–525. DOI:10.14419/ijet.v7i3.12.16171.

[14] Kamilaris A., Prenafeta-Bold ́u F.X. A review of the use of convolutional neural networks in agriculture. The Journal of Agricultural Science. 2018; 156(3):312–322. DOI:10.1017/S0021859618000436.

[15] Alzubaidi L., Zhang J., Humaidi A.J., Al-Dujaili A., Duan Y., Al-Shamma O., Santamar ́ıa J., Fadhel M.A., Al-Amidie M., Farhan L. Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. Journal of Big Data. 2021; 8(1):1–74.

[16] Gupta V., Sachdeva S., Dohare N. Deep similarity learning for disease prediction. Trends in Deep Learning Methodologies. 2021: 183–206.

[17] Karyono G. Analisis teknik data miningalgoritma c4. 5 dan k-nearest neighboruntuk mendiagnosa penyakit diabetes mellitus. STMIKPoliteknik PalComTech. 2016; 12. Available at: http://news.palcomtech.com/wp-content/uploads/downloads/2016/06/IT13GiatKaryono.pdf.

[18] Vapnik V.N. Statistics the elements of statistical learning. The Mathematical Intelligencer. 2009; 27(2):83–85. Available at: http://www.springerlink.com/index/D7X7KX6772HQ2135.pdf.

[19] Wu X., Fu X., Liu Y., Lim E.P., Hoi S.C., Sun Q. A large-scale benchmark for food image segmentation. Proceedings of the 29th ACM International Conference on Multimedia. 2021; 506–515.

[20] He Y., Xu Ch., Khanna N., Boushey C.J., Delp E.J. Analysis of food images: features and classification. 2014 IEEE International Conference on Image Processing (ICIP). IEEE; 2014; 2744–2748. DOI:10.1109/ICIP.2014.7025555. Available at: https://ieeexplore.ieee.org/document/7025555.

[21] Gonzalez R.C. Digital image processing. Pearson Education India; 2009.

[22] Agaputra M.D., Wardani K.R., Siswanto E. Pencarian citra digital berbasiskan konten dengan ekstraksi fitur HSV, ACD, dan GLCM. Jurnal Telematika. 2013; 8(2):8. Available at: https://journal.ithb.ac.id/telematika/article/view/73.

[23] Kavitha C., Rao B.P., Govardhan A. Image retrieval based on color and texture features of the image sub-blocks. International Journal of Computer Applications. 2011; 15(7):33–37. DOI:10.5120/1958-2619.

[24] Hema D., Kannan D.S. Interactive color image segmentation using HSV color space. Science and Technology Journal. 2020; 7(1):37-41. DOI:10.22232/stj.2019.07.01.05.

[25] Handayani I. Application of k-nearest neighbor algorithm on classification of Disk Hernia and Spondylolisthesis in Vertebral Column. Indonesian Journal of Information Systems. 2019; 2(1):57–66. DOI:10.24002/ijis.v2i1.2352.

[26] Putra W.S. Klasifikasi citra menggunakan convolutional neural network (CNN) pada Caltech 101. Jurnal Teknik ITS. 2016; 5(1). DOI:10.12962/j23373539.v5i1.15696. Available at: https://ejurnal.its.ac.id/index.php/teknik/article/view/15696.

[27] Han J., Pei J., Kamber M. Data mining: concepts and techniques. Elsevier; 2012.

[28] Bramer M. Data for data mining. Principles of Data Mining. London: Springer; 2016: 9–19.

[29] Makkar T., Kumar Y., Dubey A.K., Rocha A., Goyal A. Analogizing time complexity of KNN and CNN in recognizing handwritten digits. 2017 Fourth International Conference on Image Information Processing (ICIIP). IEEE; 2017; 1–6. DOI:10.1109/ICIIP.2017.8313707. Available at: https://ieeexplore.ieee.org/document/8313707.

[30] Yamashita R., Nishio M., Do R.K., Togashi K. Convolutional neural networks: an overview and application in radiology. Insights Into Imaging. 2018; 9(4):611–629.

[31] Setianto Y.A., Kusrini K., Henderi H. Penerapan algoritma k-nearest neighbour dalam menentukan pembinaan koperasi kabupaten kotawaringin timur. Creative Information Technology Journal. 2019; 5(3):232–241. DOI:10.24076/citec.2018v5i3.179.

[32] Angreni I.A., Adisasmita S.A., Ramli M.I., Hamid S. Pengaruh nilai k pada metode k-nearest neighbor (KNN) terhadap tingkat akurasi identifikasi Kerusakan Jalan. Rekayasa Sipil. 2018; 7(2):63–70. DOI:10.22441/jrs.2018.v07.i2.01. Available at: https://publikasi.mercubuana.ac.id/index.php/jrs/article/view/jrs.2018.v7.i2.01.

[33] Thirunavukkarasu K., Singh A.S., Irfan M., Chowdhury A. Prediction of liver disease using classification algorithms. 2018 4th International Conference on Computing, Communication and Automation (ICCCA). IEEE; 2018; 1–3. DOI:10.1109/CCAA.2018.8777655. Available at: https://ieeexplore.ieee.org/document/8777655/authors#authors.

[34] Nafi Dzikrulloh N., Indriati B.D. Penerapan metode k-nearest neighbor (KNN) dan metode weighted product (WP) dalam penerimaan calon guru dan karyawan tata usaha baru berwawasan teknologi (studi kasus: sekolah menengah kejuruan muhammadiyah 2 kediri). Journal Pengembangan Teknologi Informasi dan Ilmu Komputer e-ISSN. 2017; (2548):964X. Available at: http://repository.ub.ac.id/id/eprint/147404.

Bibliography link:
Arnita A., Yani M., Marpaung F., Hidayat M., Widianto A. A comparative study of convolutional neural network and k - nearest neighbours algorithms for food image recognition // Computational technologies. 2022. V. 27. ¹ 6. P. 88-99
Home| Scope| Editorial Board| Content| Search| Subscription| Rules| Contacts
ISSN 1560-7534
© 2024 FRC ICT