The Machine Learning part of this application are glycemic index and glycemic load prediction. We create a model for predict glycemic index and glycemic load from specific food nutritions. User could put the nutritions such as calories, proteins, carbohydrats and fats and the glycemic index and glycemic load will be processed in the model.
The dataset used in this project was obtained through web scraping from the following website: Glycemic Index Guide. The dataset includes detailed nutritional information such as category, name, glycemic index, glycemic load, calories, proteins (g), carbohydrates (g), and fats (g).
For more details and access to the dataset used in training the machine learning models, please visit the following link: Nutrition Food Dataset.
Feel free to explore the dataset and utilize it for your own analyses or experiments.
We evaluated several machine learning models to predict glycemic index and glycemic load, including linear regression, decision tree, support vector regression (SVR), and FFNN. Through our experimentation, we found that the FFNN model outperformed the others, achieving the lowest MAE (Mean Absolute Error). Here is a breakdown of FFNN model architecture:
-
Input Layer: The model starts with an input layer shaped to accommodate the number of numeric features in the dataset.
-
Hidden Layers:
- Two dense layers with 32 units each and ReLU activation functions.
- One dense layer with 64 units and a ReLU activation function.
- One dense layer with 128 units and a ReLU activation function.
- Dropout Layer: A dropout layer with a dropout rate of 0.2 is included to prevent overfitting during training.
-
Output Layer: The model concludes with a dense layer that outputs a single value (the predicted glycemic index) using a ReLU activation function.
This architecture is chosen based on its performance in minimizing Mean Absolute Error (MAE) during model selection, demonstrating its effectiveness in predicting glycemic index from the provided dataset.
example of best model for glycemic index predcition
example of best model for glycemic load predcition
Upon evaluation, the model achieved promising results in predicting glycemic index, providing valuable insights into the nutritional characteristics of the foods analyzed.
example of glycemic index prediction
example of glycemic load prediction
- Clone this repository or you can download the dataset
- Install the required libraries
- Pre-process the data
- Build and compile the model with the architectures as mentioned above
- Convert the model to .h5 format