Diet N Workout Recom
Diet N Workout Recom
Dr. S. NagaMallik Raj, Associate Professor of Computer Science Department (CSE), Vignan’s
Institute of Information Technology, Vishakapatnam, India, [email protected]
Y.S.S.S.R.Prabhakar , Take Sai Manohar, Tadi Prem Kumar Naidu, Pilla Keerthi Priya,
Rajavarapu Tejaswini, Computer Science Department (CSE), Vignan’s Institute of Information
Technology, Vishakapatnam, India, [email protected]
ABSTRACT: The rising prevalence of obesity and chronic illnesses has sparked a growing interest
in personalized health and wellness solutions. Diet and exercise recommendation systems have
gained recognition as a valuable method for providing personalized suggestions to promoting healthy
behaviors and improving health outcomes. However, existing systems often overlook individual
differences and preferences, resulting in less-than-optimal recommendations. This study aims to
close this divide through the creation of a personalized diet and exercise recommendation system
that utilizes Streamlit for the user interface and the Nearest Neighbors machine learning algorithm.
To develop our recommendation system, we utilized the food.com recipes and reviews dataset,
which provided a wealth of information for our content-based recipe recommendations. This dataset
includes recipe and review data from Food.com, featuring over 500,000 recipes and a community-
inspired activity feed for users to share their reviews. It encompasses various features such as recipe
identifier, title, components, time required for preparation, duration of cooking, number of servings
cuisine, and nutrition information. We employed feature engineering techniques to predict a
recipe's cuisine based on its ingredients. Our methodology involves leveraging Scikit-learn's
machine-learning capabilities to analyze user data, including demographic information, dietary
habits, exercise history, and health metrics. By utilizing algorithms like Ball Tree, KD Tree, or k-
nearest neighbors, the system learns patterns from the data to generate personalized
recommendations. We evaluate the effectiveness of our proposed system through extensive
experimentation and user feedback. By comparing the system's recommendations with expert advice
or established guidelines, we can assess its accuracy and efficacy. Additionally, user satisfaction and
adherence to the recommendations serve as crucial metrics for evaluating the system's performance.
Keywords: Diet Recommendation, Machine Learning, Ball tree and KD Tree, Scikit-learn,
Personalized Healthcare.
1. INTRODUCTION
In recent years, the widespread occurrence of lifestyle-related conditions, including obesity, diabetes,
and heart-related ailments, has reached alarming levels globally. These conditions are often
attributed to unhealthy dietary habits and sedentary lifestyles. Consequently, there is a growing
demand for effective interventions that encourage nutritious dietary practices and consistent exercise
routines. Traditional approaches to diet and workout recommendations often rely on generic
guidelines that may not account for individual preferences, dietary restrictions, or fitness goals.
However, with the advancements in machine learning and data science, personalized
recommendation systems have surfaced as an encouraging answer to tackle this issue to address this
challenge. These systems leverage user-specific data, such as nutritional profiles, fitness levels, and
lifestyle preferences, to generate tailored recommendations for diet and exercise. In this study, we
introduce a unique method to personalized diet and workout recommendations using machine-
learning techniques. Our system integrates various components, including data preprocessing, feature
scaling, nearest neighbors, modelling, and pipeline construction, to deliver customized
recommendations customized to meet the individual preferences and needs of each user. At the heart
of our recommendation system lies in the utilization of a nearest neighbors algorithm, specifically
1545 JNAO Vol. 15, Issue. 1 : 202
tailored to handle nutritional and fitness data. By leveraging cosine similarity metrics and brute-
force algorithms, we can identify the most relevant recipes and workout routines that closely match
the user's input parameters. Moreover, our system incorporates scalable preprocessing techniques
and pipeline construction to ensure efficient processing of large datasets while maintaining the
integrity of the recommendations. One of the primary benefits of our method is its adaptability to
diverse user-profiles and dietary requirements. Whether an individual follows a specific dietary
regimen, such as veganism or gluten-free diet, or has unique fitness goals, our recommendation
system can accommodate these variations and provide tailored suggestions accordingly.
Furthermore, we extend our framework to encompass workout recommendations, leveraging the
capabilities of OpenAI's cutting-edge linguistic algorithms. By leveraging OpenAI's advanced
technology text generation capabilities, we allow users to obtain customized exercise plans and
fitness advice tailored to their fitness goals, experience level, and physical limitations. By leveraging
machine learning techniques and user-specific data, we strive to equip people with the knowledge to
make educated decisions regarding their diet and physical activity, thereby fostering enduring health
and well-being.
2. REVIEW OF LITERATURE
Recently, there has been an increasing focus on the creation of diet and workout recommendation
systems, particularly those that are personalized to individual needs. This interest has been fueled by
the potential of these systems to improve health outcomes, reduce the likelihood of long-term health
conditions along with aid in the management of specific health problems including diabetes,
cancer along with post-transplant weight gain. The use of deep learning algorithms and medical
datasets has been proposed as a method for developing personalized nutrition plans, and
researchers have been investigating the potential of these systems in various healthcare settings.
The study by Subramaniyaswamy et al. (2018) proposed a personalized nutritional suggestion
platform, guided by ontology, within an IoT-enabled healthcare framework [1], which utilizes deep
learning algorithms and medical datasets. This approach has the potential to provide personalized
nutrition plans, taking into account individual health conditions and dietary requirements. However,
investigations are required to confirm the efficacy and precision of these recommendations in real-
world settings. Furthermore, The research performed by Raggatt and colleagues in 2018 emphasized
the interaction regarding the effects of fitness inspiration on social media on health and well-being
[2]. This finding emphasizes the importance of considering social and behavioral factors in the
development of diet and workout recommendation systems. Subsequent studies ought to explore the
influence of social media and a and other behavioral influences on adopting and adhering to
personalized nutrition and exercise plans. In addition, there is a need for tailored diet and workout
recommendation systems for specific populations, such as American Indian patients and kidney
transplant recipients. For example, Burke et al. (2019) discussed the importance of nutrition for
American Indian athletes[3], and the study by Grgic and colleagues (2021) focused on sodium
bicarbonate and exercise performance in the context of kidney transplant recipients[4].
These findings highlight the necessity of recommendations that are sensitive to cultural nuances and
specific to conditions, aimed at meeting the distinct needs of different populations. Moreover, the
study by Schmitz and colleagues (2019) emphasized the potential regarding home-based exercise and
weight management programs for breast cancer survivors. This suggests the importance of regarding
exercise and nutritional guidance tailored to particular health conditions, such as breast cancer[5].
Future research should explore the optimal combination of exercise and dietary interventions for
different patient populations undergoing treatment or in posttreatment phases.
Furthermore, the study by Iwendi et al. (2020) an effective patient diet recommendation system
supported by IoMT (Internet of Medical Things), utilizing machine learning techniques models[6].
This technological approach holds promise for developing user-friendly and effective diet and
workout recommendation systems. However, investigation is required to evaluate the usability and
acceptance of these systems among patients and healthcare providers Freitas et al. (2017) discuss the
advantages associated with health, physical appearance, enhanced vitality and fitness, while also
considering obstacles like motivation, scheduling conflicts, financial limitations, and the easy
availability of unhealthy food options [7]. This highlights the importance of not only providing
1546 JNAO Vol. 15, Issue. 1 : 202
recommendations but also addressing the motivational and environmental factors that may hinder
individuals from following the recommendations effectively.
In conclusion, the literature on diet and workout recommendation systems has provided meaningful
perspectives on the potential of tailored dietary strategies, the impact of social and and behavioral
factors, and the importance of tailored recommendations for specific populations. Subsequent studies
ought to concentrate on verifying the precision and efficacy of these systems, exploring the impact of
social and behavioral influences, and developing culturally sensitive and condition specific
recommendations. Additionally investigation is required to evaluate the usability and acceptance of
technological methods in this domain. This will aid in creating efficient and intuitive systems for
promoting healthy dietary intake and regular physical activity.
3. METHODOLOGY
The project involves the development of a Diet Recommendation System utilizing a a content-centric
methodology to offer personalized dietary suggestions based on nutritional data and ingredients. It
integrates FastAPI, a high performance web framework, to facilitate efficient API creation, enabling
seamless interaction with users.
The backend, complemented by Pydantic models for data validation, employs scikit-learn for
preprocessing and nearest neighbors prediction. By leveraging these technologies, the system aims to
optimize health outcomes by promoting healthy eating habits through tailored recommendations.
5. WORKING PROCESS
Our recommendation system uses a content-centric methodology for promoting healthy eating habits.
A content-based recommendation system operates by leveraging the or attributes of items to
recommend analogous items to users. This system functions through the examination of item
content, including text, images, or audio, to detect patterns or attributes linked to specific
items. These identified patterns or attributes are utilized to perform comparisons between items,
thereby enabling the system to suggest similar items to users. Therefore, the system utilizes data on
the nutritional content and components of food items to provide customized recommendations to
users. A notable benefit of the content-based method is its ability to consider an individual's dietary
needs and preferences, including any allergies or specific food likes and dislikes. Through providing
personalized food suggestions, a content-based food suggestion system aids individuals in making
informed dietary choices, thereby enhancing their overall wellness. Moreover, by introducing users
to a range of healthy food options, the system also supports the discovery of new and nutritious
foods, broadening their dietary variety and helping to prevent dietary monotony. These factors
contribute to a more diverse and balanced diet, potentially leading to improved long-term health
outcomes of the user.
7. UI INTERFACE
In the development of the proposed recommendation system for recipes based on input nutrition data
and ingredients, a combination of powerful tools was utilized to create an efficient and scalable
solution. These tools, including FastAPI, Pydantic, pandas, scikit-learn, NumPy, and the regular
expressions module (re), played crucial roles in different aspects of the project, ranging from
building the API endpoints to implementing machine learning algorithms and data preprocessing
techniques[8]
Backend Development:
The application leverages the FastAPI framework to develop rapid and high-performance web APIs.
Upon receiving a request from a user, which could include user information, nutritional details, and
more, the model springs into action, crafting a curated list of food recommendations that align with
the user's input. These suggestions are then delivered back to the user through the API.
Frontend Development:
The application's interface is crafted using Streamlit, a Python-based open-source framework
designed for building web apps efficiently, particularly in the fields of data science and machine
learning[9]. Streamlit supports seamless integration with key Python libraries like scikit-learn, Keras,
PyTorch, SymPy (for LaTeX), NumPy, pandas, and Matplotlib, enhancing its utility for a wide range
of applications. Our application features three distinct web pages. The introductory page, Hello.py,
serves as the entry point, offering users a welcoming overview of the project. A navigation sidebar is
positioned on the left, guiding users to two main functionalities: the automatic diet recommendation
and the custom food recommendation sections. In the diet recommendation segment, users input
personal details such as age, weight, and height to receive tailored diet plans. Meanwhile, the custom
food recommendation page provides an option for users to refine their food choices based on
specific nutritional parameters, catering to more detailed dietary preferences.
REFERENCES:
1. Subramaniyaswamy, V., Manogaran, G., Logesh, R., Vijayakumar, V., Chilamkurti, N.,
Malathi, D., & Senthilselvan, N. (2018). An ontology-driven personalized food recommendation in
an IoT-based healthcare system. The Journal of Supercomputing, 75, 3184-3216.
http://doi.org/10.1007/s11227-018- 2331-8
2. Raggatt, M., Wright, C., Carrotte, E., Jenkinson, R., Mulgrew, K., Prichard, I., & Lim, M.
(2018). "I aspire to look and feel healthy like the posts convey": engagement with fitness inspiration
on social media and perceptions of its influence on health and wellbeing. BMC Public Health, 18.
http://doi.org/10.1186/s12889-018-5930-7
1551 JNAO Vol. 15, Issue. 1 : 202
3. Burke, L., Castell, L., Casa, D., Close, G., Costa, R., Desbrow, B., Halson, S., Lis, D., Melin,
A., Peeling, P., Saunders, P., Slater, G., Sygo, J., Witard, O., Bermon, S., & Stellingwerff, T. (2019).
International Association of Athletics Federations Consensus Statement 2019: Nutrition for
Athletics. International Journal of Sport Nutrition and Exercise Metabolism, 29(2), 73-84.
http://doi.org/10.1123/ijsnem.2019-0065
4. Grgic, J., Grgic, I., Del Coso, J., Schoenfeld, B.J., & Pedisic, Z. (2021). Effects of sodium
bicarbonate supplementation on exercise performance: An umbrella review. Journal of the
International Society of Sports Nutrition, 18(1), 71. https://doi.org/10.1186/s12970-021-00469-7.
5. Schmitz, K.H., Troxel, A.B., Dean, L.T., DeMichele, A., Brown, J.C., Sturgeon, K., Zhang, Z.,
Evangelisti, M., Spinelli, B., Kallan, M.J., Denlinger, C., Cheville, A., Winkels, R.M., Chodosh, L.,
Sarwer, D.B. (2019). Effect of home-based exercise and weight loss programs on breast cancer-
related lymphedema outcomes among overweight breast cancer survivors: The WISER Survivor
randomized clinical trial. JAMA Oncology, 5(11),1605-1613.
https://doi.org/10.1001/jamaoncol.2019.2109
6. Iwendi, C., Khan, S., Anajemba, J.H., Bashir, A., & Noor, F. (2020). Realizing an efficient
IoMT- assisted patient diet recommendation system through machine learning model. IEEE Access,
8, 28474- 28484. https://doi.org/10.1109/ACCESS.2020.2968537
7. Freitas, P., Ferreira, P.G., Silva, A.G., Stelmach, R., Carvalho-Pinto, R., Fernandes, F.L.,
Mancini, M., Sato, M.N., Martins, M., & Carvalho, C. (2017). The role of exercise in a weight-loss
program on clinical control in obese adults with asthma: A randomized controlled trial. American
Journal of Respiratory and Critical Care Medicine, 195, 32-42. https://doi.org/10.1164/rccm.201603-
0446OC
8. Doppala BP, Naga Mallik Raj S, Stephen Neal Joshua E, Thirupathi Rao N (2021) Automatic
determination of harassment in social network using machine learning. https://doi.org/10.1007/978-
981- 16-1773-7
9. NagaMallik Raj, S., Neeraja, S., Thirupathi Rao, N., Bhattacharyya, D. (2023). Multitask Deep
Learning Model for Diagnosis and Prognosis of the COVID-19 Using Threshold-Based
Segmentation with U- NET and SegNet Classifiers. In: Sisodia, D.S., Garg, L., Pachori, R.B.
Tanveer, M. (eds) Machine Intelligence Techniques for Data Analysis and Signal Processing.
Lecture Notes in Electricall Engineering, vol 997. Springer, Singapore. https://doi.org/10.1007/978-
981-99-0085-5.