FoodFacts
FoodFacts: Chatbot for Food Healthiness
Humphrey Yang, Instructor Jeffrey Bigham and Joseph Seering
“Is this healthy?” This is a question that everyone asks when purchasing foods. However, to evaluate the healthiness of foods, users have to look at the nutrition facts and ingredients of the product and go through complex formulas to derive a binary label (healthy/unhealthy). This inconvenience decreases users’ willingness to actively make healthy decisions. To address this, I propose FoodFacts, a Facebook chatbot leveraging a neural network that labels the food for you. Users are interfaced with the chatbot via Facebook messenger and are no longer required to look at the ingredients. Instead, the NN will make judgments based on the only nutrition facts. The trained model has a good prediction accuracy on both the training data and held-out data (96% for both data).
Dataset
The dataset contains numerous (177 attributes) nutrition facts about food products (360,000 entries). The data is labeled with the Food Profiling System developed by the British Department of Health. With this system, a product graded 4 or above is considered unhealthy (the higher the worse) and vice versa. While the original profiling system takes the ingredients into consideration to provide a grade, my model uses only 9 nutrients for labeling, assuming the ratios between these 9 nutrients can represent their origin.
The aforementioned dataset was used to train a neural network (2 layers, ReLU activator). The trained model is capable of rating foods with a grade. The grade is then translated into a binary healthy/unhealthy label.
Interface
The trained food-profiling model is packaged as a chatbot and interfaced with users via Facebook messenger. The chatbot has basic functions such as greeting users, introducing its function, explaining the dataset, and labeling products for the user. To label a product, the user can type the nutrition facts into the dialogue window and receive the rating immediately.
The current implementation is not the most effective way to interface users with the Food Profiling System. Future works may adopt image recognition to extract required information, such that the users can take a picture of the nutrition facts and the chatbot will handle the rest.