bit-Tech
Vol. 8 No. 2 (2025): bit-Tech

Comparison of K-means and DBSCAN Web- Based Food in Clustering Based on Nutritional Content

Gina Purnama Insany (Nusa Putra University)
Anggun Fergina (Nusa Putra University)
Muhammad Ilham Juardi (Nusa Putra University)



Article Info

Publish Date
10 Dec 2025

Abstract

Food is the main energy source for the human body; however, poor dietary habits can lead to health risks such as obesity and cardiovascular diseases. Understanding the nutritional composition of food is essential to support healthier dietary decisions. Clustering food based on nutritional content can support personalized diet planning and assist healthcare professionals in recommending healthier food choices. This study applies clustering techniques to group foods based on their nutritional content specifically carbohydrate, calorie, protein, and fat levels using K-Means and DBSCAN algorithms. These unsupervised learning methods are suitable for analyzing numerical data without predefined categories. A key challenge in clustering is determining the optimal number of clusters; thus, evaluation methods such as the Elbow Method, Davies-Bouldin Index (DBI), and Silhouette Score were utilized. The K-Means algorithm achieved a Silhouette Score of 0.578 and a DBI of 0.661, indicating reasonably good clustering, though cluster separation was not optimal. In contrast, DBSCAN outperformed K-Means with a Silhouette Score of 0.626 and a DBI of 0.328, suggesting more compact and well-defined clusters. This indicates that DBSCAN formed more distinct and separated clusters, which is essential for effective grouping of foods based on nutritional similarity. The clustering results were deployed via an interactive web application using Streamlit an open-source Python framework enabling rapid development of lightweight web interfaces. This platform allows users to interactively explore clustering patterns through visualizations and tables, providing an intuitive tool to understand food groupings based on nutritional profiles

Copyrights © 2025






Journal Info

Abbrev

bt

Publisher

Subject

Computer Science & IT

Description

The bit-Tech journal was developed with the aim of accommodating the scientific work of Lecturers and Students, both the results of scientific papers and research in the form of literature study results. It is hoped that this journal will increase the knowledge and exchange of scientific ...