Food choice motives (i.e., mood, health, natural content, convenience, sensory appeal, price, familiarities, ethical concerns, and weight control) have an important role in transforming the current food system to ensure the healthiness of people and the sustainability of the world. Researchers from several domains have presented several models addressing issues influencing food choice over the years. However, a multidisciplinary approach is required to better understand how various aspects interact with one another during the decision-making procedure. In this paper, four Deep Learning (DL) models and one Machine Learning (ML) model are utilized to predict the weight in pounds based on food choices. The Long Short-Term Memory (LSTM) model, stacked-LSTM model, Conventional Neural Network (CNN) model, and CNN-LSTM model are the used deep learning models. While the applied ML model is the K-Nearest Neighbor (KNN) regressor. The efficiency of the proposed model was determined based on the error rate obtained from the experimental results. The findings indicated that Mean Absolute Error (MAE) is 0.0087, the Mean Square Error (MSE) is 0.00011, the Median Absolute Error (MedAE) is 0.006, the Root Mean Square Error (RMSE) is 0.011, and the Mean Absolute Percentage Error (MAPE) is 21. Therefore, the results demonstrated that the stacked LSTM achieved improved results compared with the LSTM, CNN, CNN-LSTM, and KNN regressor.

Food choices have a significant impact on the long-term viability of modern diets; therefore, knowing consumer dietary patterns is critical in accomplishing sustainability objectives. Understanding food choices is difficult due to the wide range of elements that influence them, including socio-demographic characteristics, attitudes, beliefs, conventions, consumption environments, and cultural settings. Beyond the aforementioned elements, insights into food decision reasons are useful in comprehending food choices. Food choice motives are the reasons or motives that customers have for selecting or eating food [

Bi et al. [

Author | Techniques | Results | Purpose |
---|---|---|---|

Dunstan et al. [ |
Random Forest (RF)-Support Vector Machine (SVM)-eXtreme Gradient Boosting (XGB) | RMSE(SVM) = 0.063 RMSE(RF) = 0.057 RMSE(XGB) = 0.058 | Predicting obesity from food |

Zhu et al. [ |
Machine Learning-based Classification (MLC) | Accuracy = 74.7% & AUC-ROC = 0.85. | Prediction of individual food choice |

Amin et al. [ |
Least Absolute Shrinkage and Selection Operator (LASSO)-Random Forests (RF)-eXtreme Gradient Boost (XGB) | Accuracy = 72% | Prediction of the modified Retail Food Environment Index (food deserts and swamps) |

Nilashi et al. [ |
Latent Dirichlet Allocation (LDA)-Self Organizing Map (SOM)-Classification and Regression Trees (CART) | MAE = 0.3852, RMSE = 0.4691, MAPE = 8.77% and R^{2} = 0.9301 |
Preference prediction |

Cosme et al. [ |
Support Vector Machine (SVM)-Logistic Regression (LR)-Ridge Regression (RR) | Accuracy (LR, RR) = 0.82, Accuracy (SVM) = 0.83 | Assessing spontaneous regulation during food choice |

Hidayat et al. [ |
Multiple Linear Regression (MLR) | MSE (rice) = 2171.04, MAE = 145.79, RMSE = 145.812, MAPE = 0.81% | Predicting food prices |

Baryannis et al. [ |
Support Vector Machine (SVM)-Restricted Decision Trees (RDT)-unrestricted Decision Trees (DT) | Accuracy (SVM) = 0.943 Accuracy (DT) = 0.950 Accuracy (RDT) = 0.916 | Supply chain risk prediction |

Bian et al. [ |
Support Vector Machine Regression (SVR)-Gaussian Process Regression (GPR)-Random Forest Regression (RFR) | R2 (GPR) = 0.88, MAE = 42.57 g/m^{2}, RMSE = 49.18 g/m^{2} |
Prediction of crop yield |

Finding the link between food choices and weight from basic principles is a huge task that has recently been called into doubt. Traditional regression procedures restrict the study to a narrow range of factors and apply independence and linearity assumptions [

The distance between various trait values is calculated using KNN to execute classification. The idea is that if the majority of the K similar samples in the trait space (the feature space’s nearest neighbors) belong to a particular group, then the sample does as well. K is generally an integer less than or equal to 20. The chosen neighbors in the KNN approach are all samples that have been accurately categorized. Based on the categorized choice of the nearest samples, this technique solely determines the class to which the samples to be categorized belong. To circumvent the matching problem between items, the distance between items is calculated using KNN as a non-similarity index between objects. The distance is usually the Euclidean or Manhattan distance (defined in

The KNN algorithm is presented in

Convolutional layers, fully connected layers, pooling layers, nonlinear layers, and the output are the components of CNN. The possibility that precisely captures a particular or group of image groupings is CNN’s outcome. CNN image recognition method _{k} indicates the kth source index, W_{k} is the kth sub-convolution kernel matrix, and s(i, j) is the value of the relevant result matrix element associated with the convolution kernel W. The ReLU function, f(x) = max(0, x), is commonly employed for the output of nonlinear layers. For each negative value in the input image, the ReLU function returns a value of zero, but for each positive value, it returns the same value [

To natively include time dependency into neural network topologies, the recurrent neural networks have been proposed. The key concept is to extend the capabilities of traditional ANN approaches by dynamically providing a sequential framework. Because of LSTM ability to learn both long-and short-term interconnections of a problem, it has been proven a huge success. It has been also developed to deal with the vanishing gradient issue that most RNN designs have [

where x and h represent the input state and the hidden state, respectively. The present time step is represented by t.

The dataset is available at

Features | Description |
---|---|

GPA | Grade point average (numerical value) |

Gender_type | 1-female and 2-male |

Breakfast_type | 1-cereal option and 2-donut option |

Calories_of_chicken | Guessing calories in chicken piadina |

No_calories_day | Importance of consuming calories per day |

Guess_calories_scone | Guessing calories in a scone from starbucks |

Coffee_type | 1-creamy frapuccino and 2-espresso |

Comfort_food_coded | It is based on the reasons that make you eat comfort food |

How_cooking | How often do you cook? |

Comfort_food_coded1 | It is based on the reasons that make you eat comfort food |

Cuisine_type | What type of cuisine did you eat growing up? |

Diet_coded | It is based on words used to describe the diet |

Drink_type | 1-orange juice and 2-soda |

Eating_coded | It is based on the eating changes |

Eating_coded1 | It is based on the eating changes |

Eating_freq | Frequency of eating out in a typical week |

Employ_type | Is the work full time or part time or no time or other |

Ethnic | How likely to eat ethnic food? |

Exercise_regular | How often do you exercise in a regular week? |

Education_of_father | what is the father education? |

Fav_cuisine | It is based on the favorite cuisine you prefer |

Food_favorite | What is your favorite cuisine? |

Fries_type | 1-Mcdonald’s fries or 2-home fries |

Day_fruit | How likely to eat fruit in a regular day? |

Grade_type | 4-senior 3-junior 2-sophomore 1-freshman |

Food_greek | How likely to eat greek food when available? |

Feeling | It is from 1 to 10, where 1 is strongly agree and 10 is strongly disagree |

Ideal_diet | Description for the ideal diet |

Income | Income |

Food_indian | How likely are you to eat Indian food? |

Food_ italian | How likely are you to eat Italian food? |

Rewarding_life | It is from 1 to 10, where 1 is strongly agree and 10 is strongly disagree |

Marital_status | Marital status |

Education_of_mother | what is the mother education? |

Checking_ nutritional | Checking nutritional values frequency |

Campus_on_off | Describes the living situation |

Cooking_parents | How many days a week did the parents cook? |

Meal_pay | How much would you pay for meal out? |

Persian_type | How likely to eat Persian food when available? |

Soup | 1-veggie soup and 2-creamy soup |

SPW | Self-perception of weight |

Sport_type | 1-yes and 2-no |

Food_thai | How likely to eat Thai food when available? |

Calories_ tortilla | 1–580 or 2–725 or 3–940 or 4–1165 |

Calories_ turkey | 1–345 or 2–500 or 3–690 or 4–850 |

Days_veggies | How likely to eat veggies in a day? |

Vitamins | 1-yes and 2-no |

Calories_ of_waffle | 1–575 or 2–760 or 3–900 or 4–1315 |

Weights | Weights in pounds |

Statistical analysis | Count | Mean | Std | Min | 25% | 50% | 75% | Max |
---|---|---|---|---|---|---|---|---|

GPA | 125.0 | 3.418936 | 0.38255 | 2.2 | 3.2 | 3.5 | 3.7 | 4.0 |

Gender_type | 125.0 | 1.392000 | 0.49016 | 1.0 | 1.0 | 1.0 | 2.0 | 2.0 |

Breakfast_type | 125.0 | 1.112000 | 0.31663 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |

Calories_of_chicken | 125.0 | 577.3200 | 131.214 | 265 | 430 | 610 | 720 | 720 |

No_calories_day | 125.0 | 3.024000 | 0.58838 | 2.0 | 3.0 | 3.0 | 3.0 | 4.0 |

Guess_calories_scone | 125.0 | 504.5600 | 230.034 | 315 | 420 | 420 | 420 | 980 |

Coffee_type | 125.0 | 1.752000 | 0.43359 | 1.0 | 2.0 | 2.0 | 2.0 | 2.0 |

Comfort_food_coded | 125.0 | 2.592000 | 1.83204 | 1.0 | 2.0 | 2.0 | 3.0 | 9.0 |

How_cooking | 125.0 | 2.792000 | 1.02623 | 1.0 | 2.0 | 3.0 | 3.0 | 5.0 |

Comfort_food_coded1 | 125.0 | 2.688000 | 1.91098 | 1.0 | 2.0 | 2.0 | 3.0 | 9.0 |

Cuisine_type | 125.0 | 1.336000 | 0.91531 | 1.0 | 1.0 | 1.0 | 1.0 | 6.0 |

Diet_coded | 125.0 | 1.760000 | 0.76622 | 1.0 | 1.0 | 2.0 | 2.0 | 4.0 |

Drink_type | 125.0 | 1.568000 | 0.49734 | 1.0 | 1.0 | 2.0 | 2.0 | 2.0 |

Eating_coded | 125.0 | 1.536000 | 0.75715 | 1.0 | 1.0 | 1.0 | 2.0 | 4.0 |

Eating_coded1 | 125.0 | 4.552000 | 2.54778 | 1.0 | 3.0 | 4.0 | 5.0 | 13 |

Eating_freq | 125.0 | 2.560000 | 1.13876 | 1.0 | 2.0 | 2.0 | 3.0 | 5.0 |

Employ_type | 125.0 | 2.416000 | 0.52646 | 1.0 | 2.0 | 2.0 | 3.0 | 3.0 |

Ethnic | 125.0 | 3.744000 | 1.17709 | 1.0 | 3.0 | 4.0 | 5.0 | 5.0 |

Exercise_regular | 125.0 | 1.528000 | 0.65471 | 1.0 | 1.0 | 1.0 | 2.0 | 3.0 |

Education_of_father | 125.0 | 3.488000 | 1.20225 | 1.0 | 2.0 | 4.0 | 4.0 | 5.0 |

Fav_cuisine | 125.0 | 2.424000 | 1.94796 | 0.0 | 1.0 | 1.0 | 4.0 | 8.0 |

Food_favorite | 125.0 | 1.704000 | 0.90717 | 1.0 | 1.0 | 1.0 | 3.0 | 3.0 |

Fries_type | 125.0 | 1.088000 | 0.28443 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |

Day_fruit | 125.0 | 4.224000 | 0.92338 | 1.0 | 4.0 | 5.0 | 5.0 | 5.0 |

Grade_type | 125.0 | 2.376000 | 1.13353 | 1.0 | 1.0 | 2.0 | 3.0 | 4.0 |

Food_greek | 125.0 | 3.488000 | 1.36556 | 1.0 | 3.0 | 4.0 | 5.0 | 5.0 |

Feeling | 125.0 | 5.456000 | 2.58564 | 1.0 | 3.0 | 5.0 | 8.0 | 10 |

Ideal_diet | 125.0 | 3.704000 | 2.08691 | 1.0 | 2.0 | 3.0 | 6.0 | 8.0 |

Income | 125.0 | 4.536000 | 1.45105 | 1.0 | 4.0 | 5.0 | 6.0 | 6.0 |

Food_indian | 125.0 | 3.152000 | 1.48680 | 1.0 | 2.0 | 3.0 | 5.0 | 5.0 |

Food_ italian | 125.0 | 4.728000 | 0.58717 | 3.0 | 5.0 | 5.0 | 5.0 | 5.0 |

Rewarding_life | 125.0 | 5.104000 | 3.10780 | 1.0 | 2.0 | 5.0 | 8.0 | 10 |

Marital_status | 125.0 | 1.496000 | 0.54807 | 1.0 | 1.0 | 1.0 | 2.0 | 4.0 |

Education_of_mother | 125.0 | 3.440000 | 1.15981 | 1.0 | 2.0 | 4.0 | 4.0 | 5.0 |

Checking_ nutritional | 125.0 | 3.152000 | 1.20520 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 |

Campus_on_off | 125.0 | 1.320000 | 0.67918 | 1.0 | 1.0 | 1.0 | 1.0 | 4.0 |

Cooking_parents | 125.0 | 1.528000 | 0.74677 | 1.0 | 1.0 | 1.0 | 2.0 | 5.0 |

Meal_pay | 125.0 | 3.408000 | 1.04028 | 2.0 | 3.0 | 3.0 | 4.0 | 6.0 |

Persian_type | 125.0 | 2.808000 | 1.41817 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 |

Soup | 125.0 | 3.120000 | 1.11152 | 1.0 | 2.0 | 3.0 | 4.0 | 6.0 |

SPW | 125.0 | 1.216000 | 0.41317 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |

Sport_type | 125.0 | 1.384000 | 0.48831 | 1.0 | 1.0 | 1.0 | 2.0 | 2.0 |

Food_thai | 125.0 | 3.336000 | 1.43652 | 1.0 | 2.0 | 3.0 | 5.0 | 5.0 |

Calories_ tortilla | 125.0 | 947.5200 | 201.274 | 580 | 725 | 940 | 1165 | 116 |

Calories_ turkey | 125.0 | 555.0400 | 152.370 | 345 | 500 | 500 | 690 | 850 |

Days_veggies | 125.0 | 4.008000 | 1.08133 | 1.0 | 3.0 | 4.0 | 5.0 | 5.0 |

Vitamins | 125.0 | 1.512000 | 0.50186 | 1.0 | 1.0 | 2.0 | 2.0 | 2.0 |

Calories_ of_waffle | 125.0 | 1073.400 | 248.667 | 575 | 900 | 900 | 131 | 1315 |

Weights | 125.0 | 158.3600 | 31.1190 | 100 | 135 | 155 | 180 | 265.0 |

Five error analysis criteria are presented to analyze the suggested models in order to verify the efficacy and performance of the prediction models. These criteria are given in

The major experiments used to assess the effectiveness of the stacked-LSTM model are detailed in this section. A version of the Jupyter notebook (6.4.6) was used to execute the stacked-LSTM model. The Jupyter notebook simplifies the process of running and writing Python code. It is a popular open-source tool for building and running deep learning and machine learning algorithms for classification and regression. In this study, the performance of the stacked-LSTM model was compared with the models, namely, LSTM, CNN-LSTM, CNN, and KNN. The performance of these models was evaluated using MAE, MedAE, MSE, MAPE, and RMSE as the evaluation metrics. In the LSTM model, the number of hidden units is 100. The batch size is 32, the used learning rate is 0.001, the iterations number is 100, the Adam optimizer is the used optimizer, the time steps are 48, and the activation function in the output is a linear function. In the stacked-LSTM model, three layers are used. The first layer consists of 128 hidden units, the second layer consists of 128 hidden units, and the third layer consists of 32 hidden units. The batch size is 32, the used learning rate is 0.001, the iterations number is 100, the used optimizer is the Adam optimizer, the time steps are 48, and the used activation function is a linear function. In the CNN-LSTM model, the model includes three convolution layers, one max-pooling layer, one LSTM layer, one hidden layer, and an output layer that returns a single, continuous value. The first convolution layer consists of 64 filters. The number of kernel sizes is 7. The second convolution layer contains 32 filters. The number of kernel sizes is 3. The third convolution layer contains 16 filters. The number of kernel sizes is 3. The LSTM layer includes 128 hidden units. The hidden layer includes 32 neurons. The activation function used in the output layer is the linear function. In the CNN model, the model consists of three convolution layers one max-pooling layer, one hidden layer, and an output layer that returns a single, continuous value. The first convolution layer contains 64 filters. The number of kernel sizes is 7. The second convolution layer contains 32 filters. The number of kernel sizes is 3. The third convolution layer contains 16 filters. The number of kernel sizes is 3. The hidden layer includes 32 neurons. The activation function used in the output layer is the linear function. In the KNN Regressor model, the parameters used for the model are presented in

Model | Parameters |
---|---|

KNN regressor | n_neighbors = 1, weights = distance. |

Model | MAE | MSE | MedAE | RMSE | MAPE |
---|---|---|---|---|---|

LSTM | 0.0100 | 0.00020 | 0.009 | 0.0143 | 22.4 |

Stacked-LSTM | |||||

CNN-LSTM | 0.0093 | 0.00018 | 0.0085 | 0.017 | 21.7 |

CNN | 0.0099 | 0.00014 | 0.0082 | 0.015 | 21.5 |

KNN regressor | 0.0093 | 0.00012 | 0.0075 | 0.014 | 21.2 |

As shown in

In this paper, an effective stacked-LSTM model was developed for the weight prediction of food choices. The proposed stacked-LSTM model uses three layers, where the first layer consists of 128 hidden units, the second layer consists of 128 hidden units, and the third layer consists of 32 hidden units. The Adam optimizer is also used. Several performance metrics, namely, MAE, MSE, MedAE, RMSE, and MAPE, are utilized to assess the suggested model’s effect. The suggested model’s performance was compared to four other models, namely, the LSTM model, the CNN model, the CNN-LSTM model, and KNN. The stacked-LSTM model achieved the best results among the four models, where MAE, MSE, MedAE, RMSE, and MAPE were 0.0087, 0.00011, 0.006, 0.011, and 21, respectively. Possible future work may consider augmenting the model with a food recommendation system. The effect of weight prediction in general healthcare systems as well as the impact of nutrition during the current COVID-19 epidemic are other important considerations.

The authors received no specific funding for this study.

A data availability is found in

The authors declare that they have no conflicts of interest to report regarding the present study.