CHAPTER 2 THEORETICAL FOUNDATION 2_2015_CS_0005.pdfNutritionix Nutritionix is an online service that...
Transcript of CHAPTER 2 THEORETICAL FOUNDATION 2_2015_CS_0005.pdfNutritionix Nutritionix is an online service that...
6
CHAPTER 2
THEORETICAL FOUNDATION
This chapter will provide the theoretical explanation of aspects those are included in
the development process of the thesis.
2.1. Food and Dietary
In order to achieve a healthy life, people must maintain a good balance of the foods
they eat. This balanced food plan is well known as the eatwell plate and good to be
applied for all people whether they have healthy weight or overweight [5]. People
often think
Figure 2. 1 Eatwell Plate
that if they are not overweight, they do not need to control their meal plan so they
can eat as much as they want and often unhealthy food that would impact to an
unhealthy eating habit. In order to reach a healthy dietary plan, one must follow the
eatwell plate and maintain their eating habit so his body will receive all nutrition
needed in an ideal proportion,
7
2.1.1. Food’s Nutrition Fact
Food’s nutrition fact is a collection of information that tells consumer the detail
of a product. On a packaged food such as canned food or boxed cereals and
snacks, the nutrition fact label could be found printed on the packaging. With
the nutrition facts, people will know what do they consumed and also the ideal
portion for each serving so it can help people to control their meal and diet plan.
Here is an example of nutrition fact label [6]:
Figure 2. 2 Food Nutrition Fact Example
However, there are many foods those don’t have the nutrition facts label on it,
especially when we are buying a cooked food or fast food in the restaurants or
food market. Actually, a restaurant must have the information about the nutrition
facts of the foods they serve. However, for many well-known restaurants,
especially those have their chain store all over the world and own a lot of
franchise store, there are online databases those have the listing of the menus
and calories of the foods they served.
8
With all of these data available, people actually could track down what do they
eat, create a memo to remind them and at the end of the day, they can know how
much calories and nutrition do they consume at that day. This data could be a
reference for them to balance their life with other activities such as sport to
maintain their body in a healthy condition.
2.1.1.1. Nutritionix Nutritionix is an online service that provides a food nutrition database that
can be accessed from the website or using their API. Using their service, we
can search for any food and get the nutrition information about that particular
food. The search result is complete with calories, carbohydrates, protein and
other basic food nutritional information.
2.1.2. Obesity
Obesity, as defined by NHS is a term used to describe an overweight person
with a lot of body fat [7]. In this society nowadays, obesity is a common
problem that approximately affect one of every four adults and one in every five
children aged around 10. At present, obesity is very common because people are
living in a world where everything could be done at ease without requiring them
to move their body. With the technology getting more advances, television
programs and video games are the most popular entertainment. This condition
makes people lazy to do activities such as sports and finally they become couch
potato while on the other hand, people consume more and more foods.
In order to prevent obesity, we must know whether one is in a healthy weight
range or not. Body Mass Index (BMI) weight calculator is the most common
tool to be used. The BMI calculator is a measurement tool that will count an
index showing if a person is in a healthy weight range or not.
These formula and range of index are the parameters used to calculate the BMI
[8]:
• Formula: BMI = weight (kg) / [height (m)]2
• BMI Results:
9
o BMI < 18.5 – Underweight
o 18.5 < BMI < 24.9 – Normal
o 25.0 < BMI < 29.9 – Overweight
o 30.0 < BMI – Obese
With these index, people could know in what area are their body weight
healthiness so they could maintain their weight in order to gain a more healthy
body.
2.1.3. Diet
As defined by oxford dictionary [9], diet is a special course of food to which a
person restricts themselves, either to lose weight or for medical reasons. Based on
the definition, it could be clearly seen that diet is a solution for overweight and
obese people to live more healthily and achieve a good body weight proportion.
However, most people get the wrong idea of going on diet so, when they go on
diet, they only minimize the amount of foods those they eat and not follow the
foods those eatwell plate recommend. This kind of diet is not recommended.
A good diet should be a healthy and balanced diet. In this healthy diet, people
should eat more fruit and vegetables, plenty of carbohydrates such as bread, rice
and pasta, some protein from meat, fish, eggs, etc and some milk and dairy foods
[10]. People must reduce their sugar and fat consumption so their body will get
balanced nutrition. This healthy diet, not only reducing people’s weight but as
well, help people to lower risk of heart disease, stroke and cancers.
2.1.4. Basal Metabolic Rate
Basal Metabolic Rate is the most popular way for people to help them
determining their daily calories needs in order to do a proper diet [11]. Using the
BMR formula, people need to input their details into account; they are body
weight and height, age, gender and exercise level. The result of this calculation
will let you know your daily calories intake needed to maintain your weight.
With the number from the BMR calculation, people can calculate their daily
calories needed to lose weight and maintain a healthy diet. On a normal rate, one
Pound of fat equals 3500 calories, which means that by reducing 500 calories /
10
day, one can lose one Pound or around 0.5 Kilogram weight a week. However,
people often reduce their calories below the healthy limit. In order to start a
healthy diet, a person must know that for a man, it require minimum calorie intake
of 1800 while for women, their body need at least 1200 calories per day [11].
By maintaining a healthy meal plan and following the daily calorie budget, people
can maintain a healthy diet and progressing to lose weight.
2.2. The Internet
In this era, everything in this world is connected through the cyber world and thanks
to the Internet; now everyone can share and retrieve information at their fingertips.
Internet is a collection of connected computer network that consists of
interconnected network based on standardized communication protocols (TCP/IP).
The idea of Internet was first come in 1962, in order to backup the US nation’s
telephone system in case of attack. After years of research, in 1969 the ARPAnet
delivered the first Internet message using node-to-node communication between
UCLA and Stanford University [12].
2.2.1. Utilization and Rapid Growth
World Wide Web, introduced by Tim Berners Lee in 1991 [12], often known as
WWW or W3 is a system built by interlinked hypertext documents those can be
accessed via the Internet. The idea of WWW is to introduce Internet as a place
where information can be retrieved by everyone instead just for sending files.
Since the WWW was founded, people can utilize the Internet to communicate and
exchange information easily via the website.
2.2.2. Social Media According to Oxford Dictionary, Social Media is “Websites and applications that
enable user to create and share content or to do participate in social networking.”
[13] Recently, the social media has been a massive trend in the society. It has
become a place where anyone could come together and share anything from their
thought, picture, video and other multimedia content. As the result of the freedom
to create any content, many people also utilize the social media to enhance their
business such as by creating a page about their business.
11
2.2.2.1. Social Networking As defined before, social media is the media where people can communicate
with others from the contents those they uploaded. Although people often
consider social media and social networking are the same term, social
networking is a different term. The main difference between social networking
and social media is how people interact with others. While in social media the
user will create a one to many interactions. In social networking, the idea is
about creating a two-way interaction and relationship with the other user in an
online environment [14].
Recently, as the technology becoming more advance, there comes online
services such as Facebook and Twitter those are a whole package platform
which provide the features of social media and user communication style
adapted from the social networking as well. These kinds of sites and services
are what we said the integration of social media and social networking.
2.2.2.1.1. Facebook
Facebook is known as the most popular social media and social networking
sites. Founded in 2004 in the United States, Mark Zuckerberg initially
create this service exclusive for students in Harvard University and later
expanded gradually until finally it is available for worldwide [15]. This
online application has been a giant in the cyber world providing social
networking service for anyone all over the world with a condition to be at
least 13 years old.
2.2.2.1.2. Twitter
Twitter, founded in 2006 by Jack Dorsey and Biz Stone as a service that
provides microblogging activities [16]. Using its service, user can post
anything publicly or privately at the limit of 140-characters per tweet.
Twitter also provides a messaging service, which is called as Direct
Message service.
12
2.2.2.2. Social Media Functions
As discussed before, there are different kinds of services those provide social
media and social networking. However, different social media usually have
different function that makes them unique and distinguishing from the others.
There are some different types of the cyber social services such as micro-
blogging, photo sharing, music and video streaming and others.
2.2.2.2.1. Photo Sharing
According to Collins Popular English Dictionary, photo sharing is the
publishing of user’s digital photos online, thus enabling the user to share
them with others (publicly or privately) [17]. Based on its definition, photo
sharing is similar to micro blogging but, while micro blogging content focus
on text, the photo sharing focus on the digital image sharing.
2.2.2.2.2. Instagram
Instagram is one of the most popular online photo and video sharing social
networking service. This service mostly used by people that own a
smartphone and like to share their picture anytime and anywhere. Instagram
also provide digital content editing features such as photo filter to make it
easier for the user transforming the look and feel of the photo or video to
make it more interesting.
2.3. Wireless Mobile Device
As stated in the oxford dictionary, mobile device is a portable computing device such
as a smartphone or tablet computer while wireless means using radio, microwaves,
etc. (as opposed to wires or cables) to transmit signals [18]. From both definitions,
wireless mobile device can be defined as a portable computing devices those connect
to network without using wires or cables.
13
Figure 2. 3 World First Mobile Device
Looking to the history, the first wireless mobile device is the SCR 194 and 195. It is
a portable radio AM radios produced by the U.S Army Signal Corps at 1938 [19].
From the looks, the SCR 194 and 195 is similar to a big telephone and has an
antenna to retrieve the radio signal.
2.3.1. Mobile Phone
The first mobile phone brought to the public was Motorola’s DynaTAC at 1983.
This publicly available mobile phone works on AMPS network and priced at
$4000 [20].
Figure 2. 4 Motorola DynaTAC
Over the past decades, the development of the wireless mobile devices has been
very fast and the change is very big. Every year, company tries to evolve their
mobile device and adding features to the mobile device. At the 1990s, the colored
screen mobile phone was coming as a breakthrough and near the end of 90s,
Nokia with its product 7110 came as the first mobile phone featuring Wireless
Application Protocol that could be used for accessing web over a mobile network
[20].
14
2.3.1.1. Feature Phone
Ever since year 2000, the mobile phone industry keeps making innovation and
adding many features such as predictive text and camera. These mobile phones
are considered as feature phone. The difference between the feature phone and
smartphone is here, the features those the phone has are fixed and not
extendable. Even though the latest feature phone may offers a lot of built in
applications, they generally do not have the online marketplace where people
can download applications to their phone nowadays [21].
2.3.1.2. Smartphone
As the technology grows rapidly, in 2007 the mobile phone met another
revolution, which is a mobile phone with an Operating Systems as advanced as
a desktop. Pioneered by iPhone, the smartphone has a whole new concept with
the capability of a computer and equipped with several sensors to enhanced
user experience [22]. Ever since iPhone, the other manufacturers are competing
t.o create the smartphone. In 2008, HTC signed contract with Google to make
the first android phone available to public in collaboration with Google
Android project [23]. Now in 2014, smartphones are ranging from the cheapest
one until the most expensive flagship making everyone could own a
smartphone that cause people leaves feature phones.
Looking through the evolution of wireless mobile devices, this graph would
explain the changes of mobile devices from time to time.
15
Figure 2. 5 Evolution of Mobile Devices
Since the year of 2000, the use of mobile phone especially in developing nations
has increased 1700% [24]. The increasing number of users is because companies
are pouring much effort into building a cheap mobile phone to widen the range
of their market.
2.3.2. Mobile Operating Systems
Long after the evolution, the mobile phone is now a portable computer that is
even more powerful than the old desktop computer. Packed with powerful
hardware, the mobile phone now is equipped with an operating system to bring
the most advanced features those were only available on computers back then. For
16
the developers, mobile operating systems also creating a new platform where they
can develop application by utilizing the features carried out by the smartphone.
At the moment, the most popular mobile operating systems are Apple iOS and
Google’s Android OS. While iOS is a closed platform OS, Android is an open
source project that allow developers to modified and develop their project based
on the android.
2.3.2.1. iOS
iOS, firstly named iPhone Operating System, is an OS developed by Apple for
the first iPhone. The name of iPhone Operating System changed into iOS to
reflect the evolving support for other apple devices, which are iPod, iPhone
and iPad. iOS is known as a platform that provide an application store for the
user of iDevices to download software for their device.
2.3.2.2. Android OS
Android, known as the world most used mobile operating systems [25] is an
open source and Linux-based Operating Systems. The Android, led by Google
was developed by the Open Handset Alliance [26].
Figure 2. 6 Android Smartphone Market Share
From the architecture point of view, Android has stacks of different layers
where each layer consists of several components [27]. The bottom layer of
Android is the kernel layer, which is the Linux Kernel. Although this part
never interacts with developers and end users, this is important since the Linux
17
Kernel provide the function for hardware utilization such as hardware
abstraction, memory and power management.
Figure 2. 7 Android Architecture Layer
Over the Linux Kernel, there stand Android Native Libraries layer and
Runtime layer. In the native library layer, it provides a set of function for
handing different types of data such as SQLite database and media framework
for audio and video playback. On the same level as the libraries, Android
Runtime layer that includes a set of core Java libraries is located. Inside the
Runtime layer, there stand Dalvik Virtual Machine that is utilized for running
apps based on Java and optimized for low processing power. The DVM
operates the program based on the .dex files, which built from the .class file at
the time of compilation.
On the second top of the android architecture layer, there is Application
Framework layer. Android application interact directly with this block of
architecture when we are using Android functionality which are Activity
Manager, Content Providers, Telephony Managers, Location Manager and
Resource Manager. Here, the framework manages the basic function of the
android smartphone such as telephony management.
18
At the very top of the layer, there located the layer that would mostly interact
with the developers and programmers. This is the Application Layer. In the
application layer of Android OS, user applications and built in applications
such as SMS client, dialer, web browser and games are installed. For
developers, this is an important layer since this is where will their application
located. Since Android OS is an open source operating system, user can do
anything they want with the application such as replacing any existing system
application. However, there is permission that can be set for the application.
This openness toward developers has been Android strength that make many
developers would choose Android as their development platform.
2.3.3. Mobile Application
Mobile application is a computer program that is designed to be used in mobile
devices such as smartphones and tablet computers. Since everything is mobile, the
distribution of the mobile application is very easy making this segment appealing
to the developers. Every month, developers are launching their applications to the
stores regardless of their quality but low quality apps would be removed from the
store if they were below Google’s qualification. This graph shows the numbers of
new applications in Google Play per month [28]
Figure 2. 9 New Android Apps per Month
By mid 2014, the data collected showing there are 1,200,000 applications
available on Google Play and the same numbers as in the Apple Store [28][29].
19
Based on the number of the applications available on the market, it is seen that the
mobile application market has became a great opportunity for startups with low
capital to enter the market and monetize their applications to gain some revenues.
This trend of mobile applications is one of the most important key factors of
mobile devices success.
2.4. Developing Environment
2.4.1. Object Oriented Programming
In the development process of the application, author will use the object
oriented design method so the application will have a modular architecture.
The author choose to use Object Oriented concept since for a large application,
it enhance efficiency and reusability so the application will be easy to be
understood for future research project.
2.4.2. Android
Android Operating System is packed with a lot of features to make the
applications interactive and interesting for the users. The android application is
developed using Java language and the applications will be sold through a store
such as Google Play
2.4.2.1. Android Development Tools
For the development aspects, Android Development Tools is an Integrated
Development Environment based on Eclipse with additional plugin
specializing to build Android Application. With the ADT extension on
Eclipse, developers are able to quickly set up Android projects with
application User Interface that is specialized for Android, able to debug the
projects and also supported to export the .apk files in order to distribute the
application.
2.4.3. Cloud Computing
When talking about data storage, what we used to know was a hard disk or SD
card but now, data could be stored in the Internet, which people often said as
cloud. When we talk about cloud computing, it is related to the online storage.
However, cloud computing is not about the online storage but about the
process of accessing the data stored in the cloud [30].
20
The presence of cloud computing has also leverage the development of mobile
application since now, even indie developers could use cloud services for their
application.
2.4.3.1. Parse
Parse.com is an online service that providing a cloud based backend for
application to enhance a development of an application. Using Parse
service, a developer is able to use database, notifications and data in the
cloud for their application without worrying about complexity in
maintaining the data in the loud.
2.4.4. Computer Vision
Erik G. Learned Miller stated, “Computer vision is the science of endowing
computers or other machines with vision, or the ability to see [31]”. This field
of computer study is focusing on giving computer or other machine a
capability to see, extract, process and analyze relevant information from an
image. With implementing computer vision, a computer is expected to have an
algorithm that could work like human eyes and brain so it could detect objects.
At present, the computer vision is used to support many tasks such as face
recognition for building security, medical analysis, automatic inspections for
machine parts, etc.
2.4.4.1. Open CV
Open CV (Open Source Computer Vision) is a programming functions
library for realtime computer vision. The computer vision supports many
programming languages such as C++, C, Phyton and Java and supports most
of the OS such as Windows, Linux, Android, iOS and Mac OS [32]. Open
CV algorithms can be utilized for many things such as face recognition,
objects identification, classify human actions, etc [33].
21
2.4.4.2. Image Recognition
Image Recognition is one form of Computer Vision utilization in order to
detect an object inside and image. With a certain algorithm, the computer
will process the picture and can find the result of what object is in the
picture.
2.4.4.2.1. Bag of Word Algorithm
Bag of Word algorithm is a popular methodology used to detect an object
inside a picture. This algorithm was first used for text revival in a text
analysis, which later adapted for computer vision application. This
algorithm detect an object inside an image using a visual analogue word
which is based on the vector quantization process by clustering low-level
visual features of local regions such or points such as color, texture and
so forth from an image [34].
Figure 2. 8 Bag of Words Process
The processes involved in the algorithm are [34]:
1. Detecting the regions/points of interest
2. Compute local descriptors over those regions/points
3. Quantize the descriptors into words to form the visual vocabulary
22
4. Find the occurences in the image of each specific word in the
vocabulary for construting the BoW feature
2.4.4.2.2. Camfind API
Camfind is an Application Programming Interface (API) that has an
ability to detect an object inside the image by sending a picture to the
API provider and waiting for the server to return the token that later will
be used to retrieve the result of image search. This algorithm could detect
many objects, also food objects so it could be used in this Thesis project.
This API is utilizing computer vision to detect an object that is sent to the
server. To expand the database and ability of their algorithm, the
company has a data center in the Philippines where there are people who
monitor the image and tagging it with the result of image search so these
results could be added as the search sample and improves the Computer
Vision learning to leverage the API performance [35]. This combination
of Computer Vision and crowdsourcing method explains how Camfind
API work and serves the API users.
23
2.5. Research Methodology
This research will be accomplished by these series of steps:
1. Current problem definition
2. Research for related materials to the research including similar works
3. Analyze similar works and existing solution for development reference
4. Designing the solution
• Determine the services those would be used
• Create the flowchart of the system
• Creating the class diagrams, use case diagrams and data flow diagrams
• Design the database
• Create the paper prototype of the User Interface to simulate User Interaction
• Designing resources for logo, icons and other drawable images for the
application.
5. Development and Implementation
• Develop the application
• Debugging the application on the real devices
• Fixing the bug and continue to develop the next module
6. Testing the solution
7. Evaluating the solution