Arnita, M. Yani, F. Marpaung, M. Hidayat, A. Widianto
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 k-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 k = 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. © Institute of Computational Technologies SB RAS. All rights reserved.
Department of Mathematics Universitas Negeri Medan, North Sumatera, Medan, 20221, Indonesia; Department of Mechanical Engineering, Universitas Muhammadiyah Sumatera Utara, North Sumatera, Medan, 20238, Indonesia