Ai Dietician System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

ABSTRACT

Nowadays, a man or women mentor by many fitness issues which include

health problem, keeping right eating regimen problem, etc. Therefore we're

growing this internet site for imparting unique dietician records and right exercise

expertise for regular individuals and for handicap peoples also. The powerful

non-public nutritional suggestions are very crucial for dealing with our fitness,

stopping persistent sicknesses and the interactive eating regimen making plans

allows a person to modify the plan in a less complicated way. The internet site is

to be produced on Artificial Intelligence and Dietician. Here there are individuals,

the admin and person. The person fills the registration shape after which login to

the internet site. After login customers need to fill non-public records along with

age, weight, height, gender and exercising degree. For calculating BMI age,

weight, height, gender and exercising degree are necessary. On the premise of

calculated BMI (Body Mass Index) Artificial Dietician will show the right

dietician for logged person. This utility shows the consumer to what to do as an

example food plan tips, Exercises, Online Training, etc. Here we've cover done

of kind sporting events like Yoga, Gym sporting events, Aerobics, Cardio, Basic

workouts, etc. The consumer also can hearth place a question to the admin on

his/her fitness associated troubles to hold his/her health and the admin can supply

answers on customer’s troubles. To hold fitness and to have our fitness in top

circumstance, everybody must take a food plan. This may be very crucial for

i
retaining a very good fitness circumstance. Nowadays human beings are taking

non wholesome meals and that they were given a few excessive sicknesses due

to their careless behaviour. These sicknesses are curable however fitness

circumstance degrades. So everyone must take right food plan for his/her personal

concern. People must observe nutritional tips as well.

ii
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO

ABSTRACT I
LIST OF FIGURES V
LIST OF ABBREVIATIONS V

1 INTRODUCTION
1.1 AI DIETICIAN SYSTEM 1
1.2 OVERVIEW 2
1.3 SCOPE OF THE PROJECT 3

2 LITERATURE SURVEY 4

3 SYSTEM ANALYSYS 8
3.1 EXISTING SYSTEM 8
3.1.1 Disadvantage of the existing system 10
3.2 PROPOSED SYSTEM 10
3.2.1 Advantages of the proposed system 11
3.3 REQUIREMENT SPECIFICATION 12
3.3.1 Hardware requirements 12
3.3.2 Software requirements 12
3.4 LANGUAGE SPECIFICATION 13
4 SYSTEM DESIGN 18

iii
4.1 DESIGN GOALS 18
4.1.1 Input/Output privacy 18
4.1.2 Efficiency 18
4.2 SYSTEM ARCHITECTURE 18
4.3 FLOW CHART 21
4.4 ACTIVITY DIAGRAM 22
4.5 SEQUENCE DIAGRAM 23

5 MODULE DESCRIPTION 24

5.1. MODULES 24
5.1.1 Diet module 24
5.2 ALGORITHMS USED 24
5.2.1 Expert system 24
5.2.2 Modified RETE algorithm 26
APPENDIX 1 30

APPENDIX 2 41

REFERENCES 44

iv
LIST OF FIGURES

FIGURE NO TITLE PAGE NO

4.1 SYSTEM ARCHITECTURE 20


4.3 FLOW CHART 21
4.4 ACTIVITY DIAGRAM 22
4.5 SEQUENCE DIAGRAM 23
5.2.1 EXPERT SYSTEM 22
5.2.2 MODIFIED RETE ALGORITHM 28

LIST OF ABBREVIATIONS

ABBREVIATION DEFINITION

AI ARTIFICIAL INTELLIGENCE
RETE REE-tee

v
CHAPTER 1

INTRODUCTION

1.1 AI DIETICIAN SYSTEM

As people across the globe are becoming more interested in watching their
weight, eating more healthy food and avoiding junk food, a system that can
measure calories and nutrition in every day meals can be very useful for
maintaining our health. Food calorie and nutrition measurement system is very
beneficial for dietitians and patients to measure and manage the daily food intake.
The proposed system is a responsive website which contains the knowledge and
data regarding the fitness of a person. We also referred data required to develop
the website, from gym exercise book which makes the website a unique one. This
website consists the user interface which will be publicly displayed on the website
i.e. the basic information regarding the fitness such as how to maintain good
health by doing some workouts and by eating some food products which includes
calories, proteins and carbohydrates etc. Also contains user login such as Admin
and User.

The Artificial Dietician is a bot with artificial intelligence about human


diets. It acts as a diet consultant similar to a real dietician. A dietician consults a
person based on his schedule, body type, height and weight. The system too asks
all this data from the user and processes it. To maintain health and to have our
health in good condition, everyone should take a diet. This is very important for
maintaining a good health condition. Nowadays people are taking non healthy
food and they got some severe diseases because of their careless behaviour. These
diseases are curable but health condition degrades. So every person should take
proper diet for his/her own concern. People should follow dietary guidelines as
well. This program work exactly fulfils this requirement. This work provides a
required diet plan to the user by considering different factors.

1
1.2. OVERVIEW

As people across the globe are becoming more interested in watching their
weight, eating more healthy food, and avoiding junk food, a system that can
measure calories and nutrition in every day meals can be very useful for
maintaining our health.

• Food calorie and nutrition measurement system is very beneficial for dietitians
and patients to measure and manage the daily food intake.

• The proposed system is a responsive website which contains the knowledge and
data regarding the fitness of a person

• We also referred data required to develop the website, from gym exercise book
which makes the website a unique one.

• This website consist the user interface which will be publicly displayed on the
website i.e. the basic information regarding the fitness such as how to maintain
good health by doing some workouts and by eating some food products which
includes calories, proteins and carbohydrates etc.

• Also contains user login such as Admin and User, whereas the user is given
specific credentials to login and use the system once the details provided are
verified by the system.

2
1.3. SCOPE OF THE PROJECT

The future scopes in this application are going to be the improved GUI of this
application. A proper workout schedule and routine will be provided to the user
for a better fit life. Less use of database and conditioning algorithms and more
use of Artificial Intelligence. This is a web base application which can also be
developed as a Android and IOS application:

▪ Dietitians can use this system to make sure what they recommend
patients.

▪ This system can be very well used in medical colleges for teaching and
practicing purposes so that student can learn from it.

▪ This system can also be utilized in gym particularly for calculating the
customers' calories and diet plans.

▪ Individual can also use this software especially for themselves in home.
▪ It is also useful for the elderly where one can take good care of their health who
want to follow a recommended diet plan.

▪ For the people, those who cannot go the gym can also be benefitted for
the system since they can follow the same workout plans at home and meals
accordingly.

3
CHAPTER 2

LITERATURE SURVEY

[1] ARTIFICIAL INTELLIGENCE DIETICIAN 1 YASH VASHISHTHA ,


2 SWEETY THAPA.

As individuals over the globe are getting more keen on watching


their weight, eating more solid food and staying away from lousy nourishment, a
framework that can quantify calories and sustenance in consistent suppers can be
exceptionally helpful for keeping up our wellbeing. Food calorie and nourishment
estimation framework is gainful for dietitians and patients to gauge and deal with
the day by day food admission. The proposed framework is a responsive site
which contains the information and information with respect to the wellness of
an individual. We additionally alluded to information needed to build up the site,
from rec enter exercise book which makes the site a novel one. This site
comprises the UI which will be publicly shown on the site for example the
fundamental data seeing the wellness, for example, how to keep up great
wellbeing by doing a few exercises and by eating some food items which
incorporate calories, proteins and starches and so forth. Additionally contains
client login, for example, Admin and User. Man-made consciousness and
Dietetics paper unique will give an outline of modules created in this site. The
online counterfeit dietician is a bot with man-made consciousness about human
eating regimens. It goes about as an eating regimen advisor like a genuine
dietician. Dieticians are instructed with supplement estimation of nourishments.
A dietician counsels an individual dependent on his timetable, body type, tallness
and weight. The framework also asks this information from the client and cycles
it. It gets some information about how long the client functions, his stature,
weight, age and so forth. The framework stores and cycles this information and

4
afterward computes the supplement esteem expected to top off client needs. This
software reduces the time span and cost for expert advice for diet. This product
diminishes the time compass and cost for master advice for eating routine.

[2] PRAJAKTA DADA SAHEB JADHAV, APURVA MADAN


SINNARKAR, SNEHA VAIDESWARAN & PROF. BHARATI.M.

In today’s world, due to hectic schedule people cannot concentrate


on their health. So there is need to suggest a diet plan, so they can maintain their
health. We should take proper diet for our growth. AI dietician is an artificial
intelligence dietician which provides proper diet plan to the user. The already
existing system considered only a particular disease. The approach presented in
this paper considers Height, Weight, BMI, Age, Gender and various diseases.. A
weighing machine is used to measure weight. The evaluation parameters are
Height, Weight, BMI, Age, Gender and various diseases. The obtained result is
in the form of a diet plan. So every individual should take legitimate eating
regimen for his/her own anxiety. Individuals ought to follow dietary rules too.
This work precisely satisfies this prerequisite. This work gives a required eating
regimen plan to the client by considering various components. The framework
quantifies a client's BMI utilizing his or then again her tallness and weight. It
gives an appropriate eating regimen plan to the individual thinking about age,
gender, weight, illness. We will create an App in which a diet plan will be shown.
Each and everyone should take care of his/her health and should maintain a proper
health condition. This system provides a diet plan to the user to lose weight.
Eating habits of different persons are different therefore their diet plan should be
different. Lifestyle of each person is different. The user has to enter the
information about his lifestyle and according to that, the diet plan will be
displayed. The proposed work gives some of the following results:

5
The system gives a diet plan to the users on mobile based on BMI and other
factors. This result represents diet plan for obese people.

[3] FITTRAX – AI DIET CONSULTANT -BY ADARSH KUMAR SINGH


, AMANRATHORE , AYUSH AGARWAL AND ANUJ AGARWAL

In the cutting edge time there has been an expanding measure of interest in
actual wellness and wellbeing with the vast majority, there are individuals who
have a full ongoing for that, yet it might compel them time or spot conditions. In
view of that task gave a portable application to the activity of wellness in each
spot and whenever, along these lines encouraged a ton of inconvenience
discipline on a particular spot or a particular time in the day and assisted them
with ascertaining calories that are copied through game exercise and eating good
food. There are parcels of uses that are keen on wellbeing, wellness and
sustenance, yet the client needs one application joined between them to encourage
the arrangement and the client doesn't occupy from more than one application
and give its own all out accurate outcomes.

[4] Hitesh Pruthi, Hardik Parvadiya, Varun Rawool, Joel Philip

Functionalities:

• Specialist Chat Bot: - The talk bot can help people track indications
and get a plausible analysis according to the manifestations shared.

• Altered Diet Plans :- Fittrax is quick, easy to utilize and has all the
cool instruments to assist you with succeeding your eating regimen and get in
shape:

• An instinctive food journal to plan and monitor what you're eating.


6
• A magnificent network that is prepared to help you and super
charge your weight misfortune.

• Itemized announcing and objectives for every one of your calories,


macros and supplements, including food and dinners.

• An activity journal to record all the calories you consume.

• A weight tracker to record your weight reduction progress.

[5] Prajakata Dada Saheb Jadhav, Apurva Madan Sinnarkar,


Snehavaideswaran

Gym Exercises: - Fittrax is a professional app that provides pre-set workout


plans for bodybuilding, fitness and powerlifting User- friendly interface allows
everyone to take full advantage of exercises for training the most important
muscle groups , we also give you the motivation that helps you through the pain,
fear and shyness. Enjoy the amazing results and use Fittrax whatever you want at
your own convenience. The conclusion can be utilized to become familiar with
your side effects and the infection. You can additionally interface with the correct
specialist and get total medical care arrangement atone spot. The thought is to
make human existence easier by advancing wellbeing training and great
wellbeing rehearsals with assistance of brilliant wellbeing tips, wellbeing data
and wellbeing guidance around fitness, nutrition and prosperity. All in all, we
need to present a wellbeing pal in each life.

7
CHAPTER 3

SYSTEM ANALYSIS

3.1.EXISTING SYSTEM

In the existing AI Diet Consultant system, you have to hire a dietitian in order to
get advice. Hiring a nutrition doctor will not only waste your time and efforts for
calling them, going to them and so on but also cost you very high as their charges
per month are very high. The moment will also arrives when they will not
available for you and you have to search for some other dietitian urgently. In this
system, a fixed time period is defined for the repetitive scanning of the files in
the system. After a specified period, the system calculates checksum for each and
every file in the system, irrespective of whether it was accessed. Then the new
checksum values are compared with the old or reference checksum values so as
to determine if the file in the system is modified or not. For example, in the earlier
dietitian has to collect user details for diet. Approving those user details takes lot
of time. Dietitian and user have to consult each other directly if any information
is needed. If any new user come for diet schedule, dietitian and his staff has to
search the user details and they have to find the dietitian schedule for that
particular diet. Here searching for eligible diet takes lots of time. And sometimes
some users’ details may be missed.

▪ According to current health survey in India there are more than 70% of
people suffer from one or the other disease.

▪ This is because they don’t know how much they should eat

▪ People avoid going to nutritionists or diet planner because of their high


fees

8
▪ Unaware of amount of fat required by body. In the past framework diet
graphs are generally produced utilizing moulding calculations and information
mining which builds up the utilization of information base and purely relying
upon the data set which prompts entering of information over and over and
furthermore it doesn't zero in on ailment Existing framework considers the clients
stature weight and gives an eating regimen diagram without taking his/her day by
day schedule medical issue kinds of food they can eat into account which was a
significant issue.

AI area gives an edge of creating a legitimate eating routine arrangement


which needs framework as the space isn't the equivalent. In the current AI Diet
Consultant framework, you need to enlist a dietitian to get exhortation. Recruiting
a sustenance specialist won't just burn through your time and endeavours for
calling them, going to them, etc. yet additionally cost you exceptionally high as
their charges every month are high. The second will likewise shows up when they
won't accessible for you and you need to look for some other dietitian direly. In
this framework, a fixed time-frame is characterized for the dreary filtering of the
records in the framework. After predetermined period, the framework figures
checksum for every single record in the framework, regardless of whether it was
gotten to. At that point the new checksum esteems are contrasted and the old or
reference checksum esteems to decide whether the record in the framework is
changed.

Employing a sustenance specialist will not just burn through your time and
endeavours for conversing with them, going to them, etc. yet additionally cost
you high as their charges every month are very high. The second will likewise
show up when they won't accessible for you and you need to look for some other
dietitian critically. In this framework, a fixed time-frame is characterized for the
redundant checking of the records in the framework. After a predefined period,
the framework figures checksum for every single record in the framework,

9
independent of whether it was gotten to. At that point the new checksum esteems
are contrasted and the old or reference checksum esteems in order to decide
whether the record in the framework is adjusted or not. For instance, in the prior
dietitian needs to gather client subtle ties for diet. Favouring those client subtleties
takes part of time. Dietitian and client need to counsel each other
straightforwardly if any data is required.

▪ Dietitians can use this system to make sure what they recommend
patients.

▪ This system can be very well used in medical colleges for teaching and
practicing purposes so that student can learn from it.

▪ This system can also be utilized in gym particularly for calculating the
customers' calories and diet plans.

▪ Individual can also use this software especially for themselves in home.

3.1.1 DISADVANTAGES OF THE EXISTING SYSTEM

▪ The android mobile user will not be able to insert or view details if the
server goes down. Thus there is disadvantage of single point failure.

3.2.PROPOSED SYSTEM

The first landing page incorporates administrations, offices, about us, get in
contact, and so on. After that client can specifically login, the client can fill data
like Name, Address, Email Id, Password, and so forth. BMI result will be as a
workout proposal and sustenance recommendation will be acquired from
BMR.BMI more than 25 are overweight, BMI in the middle of 18.5 and 25 are
sound weight and those with a BMI more than 30 are viewed as corpulent. In the

10
event that the client's BMI is under 18.5 then he got a recommendation about
weight pick up and on the off chance that it is more than 25 he got a weight
reduction proposal. The proposed system is fully computerized, which tries to
remove the drawbacks of the existing system. In this proposed system of artificial
intelligence diet consultant, using the technique of artificial intelligence, you will
get access to all the facilities via this application, which is actually provided by a
human dietitian. In the figure 2.3 given below you can see the main advantage of
using this standalone web application is that the time required by the people to
travel to the dietitian will be reduced and also it reduces the cost of hiring
dietitians for some particular purpose. Also, this web application offers more than
one diet plan also, for some particular kind of functionalities of human bodies.
All the users have some common services like changing password, updating
details, searching for details, checking the details, mailing to administrator, and
reading the material uploaded by admin if the user is a student. Administrator has
to do the services like adding events, achievements and he can reply to the emails
sent by users. Some of the proposed points are given below:

▪ It calculates your BMI and tells you which diet to follow.

▪ Diet plan varies from person to person and by age.

▪ It is easy to use because of its simple interface.

3.2.1 ADVANTAGES OF THE PROPOSED SYSTEM

▪ The application also eliminates the travelling cost in visiting a dietician.

▪ The usage of this application greatly reduces the time required to get the
best diet plan as it is standalone application and there is no danger of one point
failure

11
3.3.REQUIREMENTS SPECIFICATION

3.3.1.Hardware requirements

▪ Processor : Any Processor above 500 MHz

▪ RAM : 512Mb

▪ Hard Disk : 10 GB

▪ Input device : Standard Keyboard and Mouse

▪ Output device : VGA and High Resolution Monitor

3.3.2.Software requirements

▪ Operating system: Windows 10.

▪ Front End: Visual Studio code

▪ Data Base: MySQL Server.

▪ Database Connectivity: ODBC Sources (with SQL Server).

3.4Technologies used

3.4.1 ARTIFICIAL INTELLIGENCE

People bounce from diet to diet like it’s nothing from the Paleo diet to the
Ketogenic diet. News even has an article on Best Diets Overall. One day diets are
said to fix all of your health issues but the next, they’re said to be deadly. Not
only is there a contradiction with diets, but foods like eggs, coffee, and wine go
back and forth between being labelled as healthy versus unhealthy. Customers are
12
probably wondering when the results are going to be consistent so they can find
that one diet that will finally work for them. But, in reality, our bodies are unique
so food affects us on an individual level.

Benefits of Artificial Intelligence:

▪ Automates the processes.

▪ Enhance creative tasks.

▪ Provides precision.

▪ Reduces human error.

▪ Reduces time spent on data analysis.

▪ Predictive maintenance.

Risks and barriers of AI:

▪ Data availability

▪ Lack of qualified professionals.

▪ The cost and implementation time of AI projects.

3.4. LANGUAGE SPECIFICATION

3.4.2 PYTHON

Python is a high-level, interpreted, general-purpose programming language. Its


design philosophy emphasizes code readability with the use of significant
indentation. Python is dynamically-typed and garbage-collected. It supports
multiple programming paradigms,
including structured (particularly procedural), object-oriented and functional
programming. It is often described as a "batteries included" language due to its
comprehensive standard library.

13
Python can serve as a scripting language for web applications with Web Servers
Gateway Interface, a standard API has evolved to facilitate these
applications. Web frameworks like Django, Pylons, Pyramid, Turbo
Gears, web2py, Tornado, Flask, Bottle, and Zope support developers in the
design and maintenance of complex applications. Pyjs and IronPython can be
used to develop the client-side of Ajax-based applications. SQLAlchemy can be
used as a data mapper to a relational database. Twisted is a framework to program
communications between computers, and is used (for example) by Dropbox.

Libraries such as NumPy, SciPy, and Matplotlib allow the effective use of
Python in scientific computing, with specialized libraries such
as Biopython and Astropy providing domain-specific functionality. SageMath is
a computer algebra system with a notebook interface programmable in Python:
its library covers many aspects of mathematics,
including algebra, combinatorics, numerical mathematics, number theory,
and calculus. OpenCV has Python bindings with a rich set of features
for computer vision and image processing.

Python is commonly used in artificial intelligence projects and machine learning


projects with the help of libraries like TensorFlow, Keras, Pytorch, and Scikit-
learn.[197][198][199][200] As a scripting language with a modular architecture, simple
syntax, and rich text processing tools, Python is often used for natural language
processing.

Python can also be used to create games, with libraries such as Pygame, which
can make 2D games.

Python has been successfully embedded in many software products as a scripting


language, including in finite element method software such as Abaqus, 3D
parametric modeler like FreeCAD, 3D animation packages such as 3ds
Max, Blender, Cinema
4D, Lightwave, Houdini, Maya, modo, MotionBuilder, Softimage, the visual

14
effects compositor Nuke, 2D imaging programs
like GIMP, Inkscape, Scribus and Paint Shop Pro, and musical
notation programs like scorewriter and capella. GNU Debugger uses Python as
a pretty printer to show complex structures such as C++
containers. Esri promotes Python as the best choice for writing scripts
in ArcGIS. It has also been used in several video games, and has been adopted as
first of the three available programming languages in Google App Engine, the
other two being Java and Go.

Many operating systems include Python as a standard component. It ships with


most Linux distributions, AmigaOS 4 (using Python 2.7), FreeBSD (as a
package), NetBSD, OpenBSD (as a package) and macOS and can be used from
the command line (terminal). Many Linux distributions use installers written in
Python: Ubuntu uses the Ubiquity installer, while Red Hat Linux and Fedora
Linux use the Anaconda installer. Gentoo Linux uses Python in its package
management system, Portage.

Python is used extensively in the information security industry, including in


exploit development.

15
3.4.3 Visual Studio Code

Visual Studio Code is a source-code editor that can be used with a variety of
programming languages, including Java, Javascript , Go, Node.js, Python, C++
and Fortran. It is based on the Electron framework, which is used to

develop Node.js Web applications that run on the Blink layout engine. Visual
Studio Code employs the same editor component (codenamed "Monaco") used
in Azure DevOps (formerly called Visual Studio Online and Visual Studio
Team Services).

Out of the box, Visual Studio Code includes basic support for most common
programming languages. This basic support includes syntax
highlighting, bracket matching, code folding, and configurable snippets. Visual
Studio Code also ships with IntelliSense for JavaScript,
TypeScript, JSON, CSS, and HTML, as well as debugging support for Node.js.
Support for additional languages can be provided by freely available extensions
on the VS Code Marketplace.

Visual Studio Code Insiders logo

Instead of a project system, it allows users to open one or more directories,


which can then be saved in workspaces for future reuse. This allows it to
operate as a language-agnostic code editor for any language. It supports many
programming languages and a set of features that differs per language.
Unwanted files and folders can be excluded from the project tree via the
settings. Many Visual Studio Code features are not exposed through menus or
the user interface but can be accessed via the command palette.

Visual Studio Code can be extended via extensions, available through a central
repository. This includes additions to the editor and language support. A notable

16
feature is the ability to create extensions that add support for
new languages, themes, and debuggers, perform static code analysis, and
add code linters using the Language Server Protocol.

Source control is a built-in feature of Visual Studio Code. It has a dedicated tab
inside of the menu bar where you can access version control settings and view
changes made to the current project. To use the feature you must link Visual
Studio Code to any supported version control system (Git, Apache
Subversion, Perforce, etc.). This allows you to create repositories as well as to
make push and pull requests directly from the Visual Studio Code program.

Visual Studio Code includes multiple extensions for FTP, allowing the software
to be used as a free alternative for web development. Code can be synced
between the editor and the server, without downloading any extra software.

Visual Studio Code allows users to set the code page in which the active
document is saved, the newline character, and the programming language of the
active document. This allows it to be used on any platform, in any locale, and
for any given programming language.

Visual Studio Code collects usage data and sends it to Microsoft, although this
can be disabled. Due to the open-source nature of the application, the telemetry
code is accessible to the public, who can see exactly what is collected.

17
CHAPTER 4

SYSTEM DESIGN

DESIGN

4.1 DESIGN GOALS

To enable secure outsourcing of file under the model, our mechanism


design should achieve the following security and performance guarantees:

4.1.1 INPUT/OUTPUT PRIVACY

No sensitive information from the user’s private data can be derived by the
database server during performing and transfer the data.

4.1.2 EFFICIENCY

The local computations done by user should be substantially less than that
is within the GUI itself. The computation burden on the database server
should be within the comparable time complexity of existing algorithms
for plans and exercises avoiding false data.

4.2 SYSTEM ARCHITECTURE

The main objective is to tell about the flow of the system as to how the data is
stored and loaded in a sequence. People who do not go to gym but intentionally
want to because of various reasons and find it difficulty related to issues in health.
But sometimes this system comes into hand whenever needed and to utilize this
technology thereby getting benefited from it since it simple and easy to use
because of the fact that GUI and the personal assistance monitored by AI and to
provide good review to the user. The proposed system is fully computerized,

18
which removes all the drawbacks of existing system. In this proposed system of
Artificial Intelligence Dietician, you will get access to all the facilities via this
application, which is actually provided by a human dietitian. The main advantage
of using this standalone application is that the time required by the people to travel
to the dietitian will be reduced and also it reduces the cost of hiring dietitians for
some particular purpose. Also, this application offers more than one diet plan
also, for some particular kind of functionalities of human bodies. The users have
some common services like changing password, updating details, searching for
details, checking the details, mailing to administrator, and reading the material
uploaded by admin if the user is a student. Administrator has to do the services
like adding events, achievements and he can reply to the mails sent by users. He
can upload materials, search for diet details, and he has the right to approve the
same. They can give feedback about the system such that admin can make
changes according to demands of the user. It also provides a healthy food chart
even for the people who do not want to work out or do exercises, follow it and
stay healthy.

19
Figure 4.1 System architecture of AI dietician system

20
4.3. FLOW CHART

Figure 4.2 Flowchart for AI dietician system

21
4.4 ACTIVITY DIAGRAM

The user gives input details like gender, age, height, and mode of activity of the
worker and calculate BMI to determine whether a person is healthy or not. After
calculating the BMI diet plan is recommended which corresponds to the BMI
calculated and inputs given by the user and it is stored in the database .

22
4.5. SEQUENCE DIAGRAM

The sequence diagram of AI dietician system interacts in a sequential manner like


it gets user profiles and process the inputs given by the user which are the details
to calculate the BMI. After getting the details the BMI is calculated and the
information is stored in the database

23
CHAPTER 5

MODULE DESCRIPTION

MODULE

5.1 Diet module

In this module the diet plan is generated whenever the user fills the analysis form.
The diet plan generated is stored so that the user can refer to that in the future as
well. In this module the details like gender, age, height, weight and mode of
activity of the person and determine the diet of the persons according to the inputs
given by the user.

ALGORITHM USED

5.2 EXPERT SYSTEM

The field of expert systems is the most important applied area of Artificial
Intelligence. An expert system (ES) is a knowledge based system that employs
knowledge about its application domain and uses an inference (reason) procedure
to solve problems that would otherwise require human competence or expertise.
Expert systems gain their knowledge from the expert who has knowledge about
a narrow domain stored in the expert systems knowledge base.

Figure 5.2. Expert system

24
Components of expert system are:-

Expert: Experts provide the necessary information on which the system is built.
Their experience and knowledge regarding the subject contributes to a credible
system. Multiple experts are generally needed for large systems.

Knowledge engineer: The knowledge engineer has two tasks. The engineer
should be able to gather and analyse the knowledge from the expert. Intelligence,
tact, empathy, and proficiency in specific techniques of knowledge acquisition
are all required from a knowledge engineer. Knowledge can be acquired via
interviews with varying degrees of structure, analysis of protocols, observing
experts at work and analysing it.

Knowledge Base: The knowledge base of an expert system consists of both


factual and heuristic knowledge. Notions must be represented in the Knowledge
Base as actions to be taken under circumstances, causality, time, dependencies,
goals, and other concepts.

Inference Engine: Facts of a specific case are combined with the knowledge
contained in the Knowledge Base for a recommendation. The orders in which the
production rules are applied are controlled by the inference engine, in a rule-based
expert system.

User Interface: This is where the user is asked to enter all the information, and
this is the source of input that can be used by the Inference Engine.

Benefits of Expert Systems

 An Expert System can complete its part of the tasks much faster than a human
expert.

25
 The error rate of successful systems is low, sometimes much lower than the
human error rate for the same task.

 Expert System makes consistent recommendations.

 Expert Systems are a convenient vehicle for bringing to the point of application
difficult-to-use sources of knowledge.

 Expert Systems can capture the scarce expertise of a uniquely qualified expert.

Limitations of Expert Systems

 Limitations of the technology

 Problems with knowledge acquisition

5.2.1 Modified RETE Algorithm

The RETE algorithm is a pattern matching algorithm designed by Dr Charles L.


Forgy of Carnegie Mellon University. RETE is a Latin word which means net. It
is a very efficient algorithm for matching facts against the patterns in rules.
Understanding of the RETE algorithm will make it easier to understand as to why
writing rules In one way is much more efficient[1]. The RETE network is a direct
acyclic graph that consists of nodes representing patterns in the conditions of the
rules. The nodes behave like filters; they test the incoming token and send only
those that have passed the test. The RETE network consists of two parts: alpha
network and beta network. Alpha network consists of nodes known as alpha
nodes. Each alpha node consists of one input that defines intra-elements. Beta
nodes are components of Beta network where two inputs are taken from each
node so as to define inter-element conditions. A token is created from the
assertion of each fact. Initially the tokens enter the root node, for each token type,
26
the network then split a branch. A copy of the token is received by each kind node
and it then performs a SELECT operation to select similar tokens. Alpha nodes
receive a copy of token node from the kind node. On receiving the token, the
alpha nodes perform a PROJECT operation and from that token components are
extracted that match with pattern variables. The conditions are basically evaluated
by the alpha nodes. The possible cross product for a rule is then determined by
the Beta node. Then, finally rules containing action will be executed. The RETE
network begins with a root node called as the RETE Node. A major drawback of
RETE is that it is limited to only one root node and the entire process is based on
only one parameter. We will be making use of three parameters and these
parameters will play a crucial role in determining the diet. Age, Body Mass Index
and Body fat of the user will be taken into consideration. Upon calculation of
these, assigned rules will be fired and a diet will be selected from our knowledge
base. This diet will then be modified taking into consideration the preferences
and medical conditions of the user. The user will also be provided with the option
of searching for alternatives.

Example: IF weight 66 and Height>5.4 or Height

27
5.2.2 Modified RETE algorithm

This diagram consists of root node which has two attributes weight and height
respectively. The heights and weight values are assigned as alpha nodes and the

heights are assigned as the beta nodes. By using the resultant of height and weight
we can determine the diet of an individual by using the modified RETE algorithm

28
CONCLUSION

The project was developed using Python technology. This system with AI
integrated can be used for the people who cannot go the gym or doing workouts
in home in order to stay fit and healthy. AI Dietician may allow the user to
know about his/her actual diet information like how much user had calories in
their body on this basis system displays workout and food suggestions. This
software package is a strong enough to withstand regressive facility for the
Handicapped Peoples. This software reduces the time span and cost for expert
advices for diet. This site is exceptionally valuable to wellbeing cares and
dietician. This product diminishes the time compass and cost for master advices
for eating routine. The basic function of the application is to provide user with a
simple way to perform BMI calculation operations on user’s pc without
compromising his/her diet plans. Food chart is also available in which it lists all
the necessary foods and meals along with all the nutritional’s entities such as
carbohydrates, protein, vitamins, minerals etc., where one need to maintain
proper health and lifestyle. Sometimes people often loose their interest when
they find out nothing can be done in terms of health as in, getting older, looking
fat or lean but then this project can bring people to know how one as to be
curious about healthy lifestyle. When people grow older, the immune systems
cannot that strong when compared to people who are younger. By this using this
application, at least they can make their will stronger for themselves and help
them know we are all part of a healthy and a fit community. The system is a
useful tool for educating users on nutritional related topics with the help of large
and reliable database created with help of expert dieticians. Many people
consult a dietician when in need of a proper diet to go with their exercises.
Since, our proposal will help the people with the diet; they will not need to visit
dieticians. Our diets will be provided by professional dieticians thus eliminating
any or all fears the users have regarding our diet. The users will be getting diet
delivered to their screens for them which will save time as well as money as the
services provided by our project will be free of cost, unlike other options on the
market currently. The end-user application will be built on an Android platform
and web platform with a simple and efficient human-device interface. Our
application is using artificial intelligence algorithm called RETE algorithm so
each and every user will get a personalised diet according to their need and
preferences.

29
APPENDIX
SAMPLE CODE

Main.py
from tkinter import *

from random import randint

a = Tk()

a.title('The dietician')

def BMR():

protein = ['Yogurt(1 cup)','Cooked meat(3 Oz)','Cooked fish(4 Oz)','1 whole


egg + 4 egg whites','Tofu(5 Oz)']

fruit = ['Berries(80 Oz)','Apple','Orange','Banana','Dried


Fruits(Handfull)','Fruit Juice(125ml)']

vegetable = ['Any vegetable(80g)']

grains = ['Cooked Grain(150g)','Whole Grain Bread(1 slice)','Half Large


Potato(75g)','Oats(250g)','2 corn tortillas']

ps = ['Soy nuts(i Oz)','Low fat milk(250ml)','Hummus(4 Tbsp)','Cottage


cheese (125g)','Flavored yogurt(125g)']

taste_en = ['2 TSP (10 ml) olive oil','2 TBSP (30g) reduced-calorie salad
dressin','1/4 medium avocado','Small handful of nuts','1/2 ounce grated
Parmesan cheese','1 TBSP (20g) jam, jelly, honey, syrup, sugar']

30
w = v3.get()

h = v4.get()

age = v5.get()

act = str(Lb.get(ACTIVE))

gender = Lb2.get(ACTIVE)

if gender == 'Male':

cal = float()

cal = 88.362 + (13.397*float(w)) + (4.799*float(h)) - (5.677*float(age))

print (cal)

elif gender == 'Female':

cal = float()

cal = 447.593 + (9.247*float(w)) + (3.098*float(h)) - (4.330*float(age))

if act == 'Sedentary (little or no exercise)':

cal = cal*1.2

elif act == 'Lightly active (1-3 days/week)':

cal = cal*1.375

elif act == 'Moderately active (3-5 days/week)':

cal = cal*1.55

31
elif act == 'Very active (6-7 days/week)':

cal = cal*1.725

elif act == 'Super active (twice/day)':

cal = cal*1.9

print (cal)

if cal<1500:

fin = StringVar()

l6 = Label(a, textvariable=fin, relief=RAISED )

fin.set("Breakfast: "+protein[randint(0, 5)]+" + "+fruit[randint(0, 5)])

l6.grid(row=0,column=3)

fin2 = StringVar()

l8 = Label(a, textvariable=fin2, relief=RAISED )

fin2.set("Lunch: "+protein[randint(0, 5)]+" + "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)])

l8.grid(row=1,column=3)

fin3 = StringVar()

32
l9 = Label(a, textvariable=fin3, relief=RAISED )

fin3.set("Snack: "+ps[randint(0, 4)]+" + "+vegetable[0])

l9.grid(row=2,column=3)

fin4 = StringVar()

l10 = Label(a, textvariable=fin4, relief=RAISED )

fin4.set("Dinner: "+protein[randint(0, 5)]+" + 2 "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)])

l10.grid(row=3,column=3)

fin5 = StringVar()

l11 = Label(a, textvariable=fin5, relief=RAISED )

fin5.set("Snack: "+fruit[randint(0, 5)])

l11.grid(row=4,column=3)

elif cal<1800:

fin = IntVar()

l6 = Label(a, textvariable=fin, relief=RAISED )

fin.set("Breakfast: "+protein[randint(0, 5)]+" + "+fruit[randint(0, 5)])

l6.grid(row=0,column=3)

fin2 = StringVar()

33
l8 = Label(a, textvariable=fin2, relief=RAISED )

fin2.set("Lunch: "+protein[randint(0, 5)]+" + "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)]+" +
"+fruit[randint(0, 5)])

l8.grid(row=1,column=3)

fin3 = StringVar()

l9 = Label(a, textvariable=fin3, relief=RAISED )

fin3.set("Snack: "+ps[randint(0, 4)]+" + "+vegetable[0])

l9.grid(row=2,column=3)

fin4 = StringVar()

l10 = Label(a, textvariable=fin4, relief=RAISED )

fin4.set("Dinner: 2 "+protein[randint(0, 5)]+" + "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)])

l10.grid(row=3,column=3)

fin5 = StringVar()

l11 = Label(a, textvariable=fin5, relief=RAISED )

fin5.set("Snack: "+fruit[randint(0, 5)])

l11.grid(row=4,column=3)

34
elif cal<2200:

fin = StringVar()

l6 = Label(a, textvariable=fin, relief=RAISED )

fin.set("Breakfast: "+protein[randint(0, 5)]+" + "+fruit[randint(0, 5)])

l6.grid(row=0,column=3)

fin2 = StringVar()

l8 = Label(a, textvariable=fin2, relief=RAISED )

fin2.set("Lunch: "+protein[randint(0, 5)]+" + "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)]+" +
"+fruit[randint(0, 5)])

l8.grid(row=1,column=3)

fin3 = StringVar()

l9 = Label(a, textvariable=fin3, relief=RAISED )

fin3.set("Snack: "+ps[randint(0, 4)]+" + "+vegetable[0])

l9.grid(row=2,column=3)

fin4 = StringVar()

l10 = Label(a, textvariable=fin4, relief=RAISED )

fin4.set("Dinner: 2 "+protein[randint(0, 5)]+" + 2 "+vegetable[0]+" +


Leafy Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)])

35
l10.grid(row=3,column=3)

fin5 = StringVar()

l11 = Label(a, textvariable=fin5, relief=RAISED )

fin5.set("Snack: "+fruit[randint(0, 5)])

l11.grid(row=4,column=3)

elif cal>=2200:

fin = StringVar()

l6 = Label(a, textvariable=fin, relief=RAISED )

fin.set("Breakfast: 2 "+protein[randint(0, 5)]+" + "+fruit[randint(0, 5)]+" +


"+grains[randint(0,4)])

l6.grid(row=0,column=3)

fin2 = StringVar()

l8 = Label(a, textvariable=fin2, relief=RAISED )

fin2.set("Lunch: "+protein[randint(0, 5)]+" + "+vegetable[0]+" + Leafy


Greens"+grains[randint(0,4)]+" + "+taste_en[randint(0,5)]+" +
"+fruit[randint(0, 5)])

l8.grid(row=1,column=3)

fin3 = StringVar()

36
l9 = Label(a, textvariable=fin3, relief=RAISED )

fin3.set("Snack: "+ps[randint(0, 4)]+" + "+vegetable[0])

l9.grid(row=2,column=3)

fin4 = StringVar()

l10 = Label(a, textvariable=fin4, relief=RAISED )

fin4.set("Dinner: 2 "+protein[randint(0, 5)]+" + 2 "+vegetable[0]+" +


Leafy Greens + 2 "+grains[randint(0,4)]+" + 2 "+taste_en[randint(0,5)])

l10.grid(row=3,column=3)

fin5 = StringVar()

l11 = Label(a, textvariable=fin5, relief=RAISED )

fin5.set("Snack: "+fruit[randint(0, 5)])

l11.grid(row=4,column=3)

'''

v1 = IntVar()

c1 = Checkbutton(a, text = 'Male', variable = v1)

c1.grid(row=0,column=1)

v2 = IntVar()

c2 = Checkbutton(a, text = 'Female', variable = v2)

37
c2.grid(row=0,column=2)

'''

l1 = Label(a, text='Weight')

l2 = Label(a, text='Height(in cms)')

l3 = Label(a, text='Age ')

l4 = Label(a, text = 'Gender', bg = 'white')

l5 = Label(a, text = 'Activity', bg = 'white')

l7 = Label(a, text = '')

v3=StringVar()

v4=StringVar()

v5=StringVar()

e3 = Entry(a, textvariable=v3, width=30)

e4 = Entry(a, textvariable=v4, width=30)

e5 = Entry(a, textvariable=v5, width=30)

Lb = Listbox(a, height=6, width=30)

Lb.insert(1, 'Sedentary (little or no exercise)')

Lb.insert(2, 'Lightly active (1-3 days/week)')

Lb.insert(3, 'Moderately active (3-5 days/week)')

38
Lb.insert(4, 'Very active (6-7 days/week)')

Lb.insert(5, 'Super active (twice/day)')

Lb2 = Listbox(a, height=2, width=30)

Lb2.insert(1, 'Male')

Lb2.insert(2, 'Female')

var = Lb.get(ACTIVE)

print (var)

l5 = Label(a, text = '')

l5.grid(row=5,column=0)

b1 = Button(a, text = 'Submit', width=25, command = BMR)

l1.grid(row=1,column=0)

l2.grid(row=2,column=0)

l3.grid(row=3,column=0)

l4.grid(row=0,column=0)

l5.grid(row=4,column=0)

l7.grid(row=0,column=2)

e3.grid(row=1, column=1)

39
e4.grid(row=2, column=1)

e5.grid(row=3, column=1)

Lb.grid(row=4, column = 1)

Lb2.grid(row=0, column = 1)

b1.grid(row=6,columns=3)

a.mainloop()

40
APPENDIX 2
SCREENSHOTS

SEDENTARY WORKER

LIGHTLY ACTIVE WORKER

41
MODERATELY ACTIVE WORKER

VERY ACTIVE WORKER

42
SUPER ACTIVE

43
REFERENCES

[1] Hitesh Pruthi, Hardik Parvadiya, Varun Rawool, Joel Philip 1b.e student,
dept. of information technology engg Mumbai ,faculty, dept. of information
technology engg. Mumbai.
[2] Prajakata Dada Saheb Jadhav, Apurva Madan Sinnarkar,
Snehavaideswaran&Prof. Bharati.M. Narute Department of Electronics and
Telecommunication Engineering, modern education society’s college of
engineering Pune, India.
[3] Artificial Intelligence Dietician Yash Vashishtha, Sweety Thapa,
1b.Tech(CSE), 2b.Tech(CSE), Department of Computer Science and
Engineering, Uttaranchal University, Dehradun, India.
[4] (IRJET) Artificial Intelligence Dietician Aman Mukadam, Samruddh
Choudhari, Hamid pasha, Prof.Medhakulkarn Mumbai university, Samruddh
choudhari Mumbai university, Hamid pasha Mumbai university, Professor
Medhakulkarni, dept. of information technology, Maharashtra, India
[5] S. V. Chavan, S. S. Sambare and A. Joshi, "Diet recommendation based on
Prakriti and season using Fuzzy ontology and Type2 Fuzzy Logic," 2016
International Conference on Computing Communication Control and
automation (ICCUBEA), Pune, 2016, pp. 1-6.
[6] P. Yang, Y. Yang and N. Wang, "IRETE: An improved RETE multi-entity
match algorithm," 2011 International Conference on Electronics,
Communications and Control (ICECC), Zhejiang, 2011, pp. 4363-4366.
[7] Duisenbayeva, L. Atymtayeva and I. Beisembetov, "Using Fuzzy logic
concepts in creating the decision making expert system for cardiovascular
diseases (CVD)," 2016 IEEE 10th International Conference on Application of
Information and Communication Technologies (AICT), Baku, 2016.
[8] Nilakshi Jain , Dhananjay R Kalbande “Network Security Analyzer:
Detection and Prevention of Web Attacks”, published in International
Conference on Information and Communication Technology for Intelligent
Systems 2015 Springer ( ICTIS), 28-29 November 2015. Volume 50 of the
series Smart Innovation, Systems and Technologies pp 497-505.
[9] Nilakshi Jain , Dhananjay R Kalbande “Computer Forensic Tool using
History and Feedback Approach”, published in 2015 4th International
Conference on Reliability, Infocom Technologies and Optimization (IEEE-

44
ICRITO 2015) Amity University Delhi (Noida) 2-4 September 2015. DOI
10.1109/ICRITO.2015.7359315 Pages 1-5 Print ISBN: 978-1-4673-7230-5.
URL http://ieeexplore.ieee.org/document/7359315/?reload=true
[10] Nilakshi Jain , Dhananjay R Kalbande “Digital Forensic Framework using
Feedback and Case History Keeper” published in International Conference on
Communication, Information & Computing Technology (IEEE- ICCICT 2015)
SPIT Mumbai 16-17 Jan 2015. Print ISBN: 978-1-4799-5521-3 DOI:

45

You might also like