Agnel Charities
Fr. C. Rodrigues Institute of Technology, Vashi
(An Autonomous Institute & Permanently Affiliated to University of Mumbai)
Honors/Minors Degree Program in AIML Project
Subject AI & ML in Healthcare Lab (HAIMLC701)
Branch and IT Sem - VII
Semester
Group 5022140 Ayush Nair
Members 5022159 Harshal Shirole
5022172 Bhumi Vedant
Title of the Diabetes Prediction & Diet Planner
Mini
Project
Name and
signature of
practical in
charge
1. Introduction
Diabetes is one of the most prevalent and rapidly growing chronic diseases globally, posing major
challenges to healthcare systems and individuals alike. It results from either the pancreas not
producing enough insulin or the body’s ineffective use of insulin, leading to elevated blood glucose
levels. Over time, uncontrolled diabetes can cause serious health complications such as
cardiovascular disease, kidney failure, nerve damage, and vision problems. Early prediction and
lifestyle management are therefore crucial in mitigating the risks associated with diabetes.
With the advancement of Artificial Intelligence (AI) and Machine Learning (ML), it is now
possible to predict the likelihood of diabetes using patient health parameters such as glucose level,
BMI, blood pressure, insulin, and family medical history. These technologies enable early detection
and personalized management strategies that go beyond conventional diagnostic methods.
This project focuses on designing an intelligent system that not only predicts the risk of diabetes but
also recommends a personalized diet plan suitable for the user’s condition. By integrating AI-
driven prediction models with nutritional science, the system provides a holistic solution—offering
both early detection and preventive lifestyle guidance. The project contributes to the growing field
of AI in healthcare, aiming to enhance public health outcomes through data-driven disease
prediction and personalized nutrition recommendations.
1.1 Motivation
In today’s world, diabetes has become a common lifestyle disease, largely due to poor dietary
habits, sedentary routines, and increasing stress levels. Many individuals remain unaware of their
diabetic tendencies until the condition becomes severe, leading to costly treatments and long-term
complications. Although regular health checkups and medical consultations are effective preventive
measures, they are not always feasible or accessible to everyone due to time, cost, and awareness
constraints.
The motivation behind this project lies in empowering individuals with proactive health
management tools. By leveraging machine learning, users can assess their diabetes risk quickly
and accurately using basic health parameters. Additionally, incorporating an intelligent diet
recommendation system ensures users receive tailored nutritional guidance based on their
predicted risk level—be it diabetic, pre-diabetic, or non-diabetic.
This approach bridges medical diagnosis and lifestyle management by offering continuous support
for healthier living. It demonstrates how technology can play a transformative role in preventive
healthcare—helping individuals take informed actions and maintain optimal well-being through AI-
driven insights and customized diet planning.
1.2 Problem statement
Most existing healthcare applications for diabetes focus on diagnosis after onset rather than early
detection or prevention. Furthermore, current diet recommendation platforms typically provide
generalized meal plans without considering individual health parameters or risk predictions. As a
result, users receive non-personalized advice that may not align with their medical needs, lifestyle,
or blood glucose tendencies.
The problem this project addresses is the lack of an integrated system that combines disease
prediction with personalized dietary guidance. Specifically:
• Traditional diagnostic approaches often identify diabetes at an advanced stage rather than
predicting it early.
• Existing diet recommendation systems are not data-driven and fail to adapt to individual
metabolic profiles.
This project proposes a Diabetes Prediction and Diet Recommendation System that uses
machine learning algorithms to predict the probability of diabetes based on medical and
physiological parameters. Based on the prediction result, it recommends suitable dietary plans—for
example, low glycemic index foods for diabetic individuals, balanced nutrition for pre-diabetic
users, and preventive diets for non-diabetic individuals.
By addressing these gaps, the system aims to provide personalized, preventive, and adaptive
healthcare support, promoting a healthier lifestyle and reducing the long-term burden of diabetes
through intelligent prediction and nutrition planning.
2. EDA
Exploratory Data Analysis (EDA) was performed on the PIMA Indians Diabetes Dataset to
understand patterns and correlations among clinical attributes relevant to diabetes prediction. The
dataset includes key features such as Pregnancies, Glucose, Blood Pressure, Skin Thickness,
Insulin, BMI, Diabetes Pedigree Function, and Age.
Statistical summaries and visualizations such as histograms, boxplots, and heatmaps were used to
identify data distribution, detect missing values, and analyze relationships with the target variable
(“Outcome”). The correlation matrix highlighted that Glucose, BMI, and Age are the strongest
predictors of diabetes, while Insulin and Skin Thickness showed moderate associations.
Data cleaning included handling missing and zero entries through imputation, ensuring the dataset’s
suitability for model training. The EDA phase also helped in defining the data retrieval logic for
the RAG model, allowing the chatbot to cross-reference real report data with insights derived from
the PIMA dataset and additional medical literature.
Overall, EDA provided a foundation for accurate diabetes prediction, informed feature selection,
and the creation of a knowledge base that the RAG chatbot later uses to generate context-aware
and medically aligned dietary advice.
3. Stress Diagnosis Based on Physiological Data
The system’s diagnostic engine interprets physiological and medical parameters from both user-
entered data and uploaded health reports (such as blood test results). Key parameters include
Glucose levels, BMI, Insulin, and Blood Pressure.
Once a report is uploaded, the RAG-based LLM chatbot parses the document using Natural
Language Processing (NLP) and extracts critical values (e.g., fasting glucose, HbA1c, cholesterol).
The extracted data is then passed through the trained diabetes prediction model (based on the PIMA
dataset), which classifies the user as:
• Non-Diabetic (Low Risk)
• Pre-Diabetic (Moderate Risk)
• Diabetic (High Risk)
The combination of ML-based prediction and report understanding ensures greater diagnostic
reliability. The chatbot uses the RAG framework to reference authoritative medical sources and
create responses backed by factual, domain-specific information. This hybrid setup allows the
system to go beyond raw number analysis — providing clinically informed, explainable, and
tailored feedback.
4. RAG-Based AI Diet Recommendation Chatbot
The RAG (Retrieval-Augmented Generation) chatbot serves as the heart of the system’s diet
recommendation process. It leverages both the prediction outcome and contextual health
information from the uploaded reports.
Here’s how it works:
1. Retrieval Step:
The system retrieves relevant diet plans, medical guidelines, and food recommendations
from a curated knowledge base containing verified data from healthcare datasets, WHO
recommendations, and nutrition research articles.
2. Augmented Generation Step:
The LLM (e.g., GPT-based model) integrates the retrieved data with the patient’s unique
parameters (glucose, BMI, insulin, age) and report insights to generate a personalized,
evidence-based diet plan.
For instance:
• If the user’s report shows high glucose and cholesterol, the chatbot suggests a low-
glycemic, heart-healthy diet emphasizing fiber, whole grains, and omega-3 sources.
• For pre-diabetic individuals, it proposes portion-controlled, balanced diets with periodic
re-evaluation.
• For non-diabetic users, it provides preventive diet strategies and healthy eating habits.
This approach ensures that recommendations are not only AI-generated but also contextually
grounded in medical data, improving the precision and trustworthiness of the system.
5. Explainable AI and Transparency
Explainability is central to healthcare AI systems. The RAG chatbot incorporates Explainable AI (XAI)
features to make its decisions transparent and medically interpretable.
After processing a user’s report, the chatbot provides a concise rationale such as:
“Your fasting glucose level (145 mg/dL) and BMI (31) indicate a higher diabetes risk. Therefore, a low-
carbohydrate, high-fiber diet is recommended to manage blood sugar levels effectively.”
Feature importance analysis from the prediction model (via SHAP values or feature weights) helps users
understand which parameters influenced their risk score the most. The LLM further elaborates in natural
language, making medical results understandable even for non-experts.
Additionally, RAG ensures traceability — each recommendation can be traced back to its source in the
retrieved medical knowledge base, ensuring ethical and evidence-based use of AI in healthcare.
6. Review and Feedback Analysis
User feedback plays a key role in refining both prediction accuracy and the quality of dietary
recommendations. After receiving a diet plan, users can rate their satisfaction or provide notes on how well
the diet aligned with their lifestyle and medical needs.
The RAG chatbot then learns from this feedback using reinforcement learning from human interaction
(RLHF) concepts. Over time, the model adapts its tone, precision, and diet variety according to user
patterns.
Additionally, the chatbot collects anonymized insights on diet effectiveness, helping improve the
underlying knowledge base. For instance, if many users report improvement from high-fiber diets
in pre-diabetic cases, the system dynamically prioritizes those recommendations in similar
scenarios. This continuous learning loop ensures personalization improves with every interaction.
7. Implementation
The system is implemented using:
• Machine Learning: Scikit-learn-based model trained on the PIMA dataset
• RAG Framework: LLM (e.g., GPT or Llama) integrated with a domain-specific vector database
(e.g., FAISS or Chroma)
• Frontend: Streamlit or Flask for user interaction
• Backend: Python APIs handling model inference and document retrieval
This modular design allows scalability — new medical conditions or nutrition datasets can be added
easily without retraining the entire model.
8. Result and Conclusion
The RAG-powered Diabetes Prediction and Diet Recommendation Chatbot successfully demonstrates the
synergy between machine learning prediction and large language model intelligence.
The prediction model, trained on the PIMA dataset, achieved high accuracy in classifying diabetic and non-
diabetic individuals. The LLM-based RAG architecture enhanced the system’s ability to interpret medical
reports and deliver personalized, medically relevant diet recommendations with clear explanations.
User testing indicated that participants found the chatbot’s guidance understandable, relevant, and clinically
consistent. The explainability module improved user trust, while the retrieval layer ensured all responses were
grounded in verified medical literature.
In conclusion, this hybrid system represents a next-generation AI healthcare assistant capable of not only
predicting diseases but also offering scientifically validated, user-specific lifestyle interventions. Future
enhancements may include integration with wearable health devices, multi-language diet generation, and
real-time glucose tracking-based recommendation updates, moving toward a comprehensive AI-driven
healthcare ecosystem.
9. Review and Feedback analysis