Classification and prediction of genetic and non genetic obesity using Health/Fitness trackers sensor data in context Wireless Body Area Network –



Classification and prediction of genetic and non genetic obesity using Health/Fitness trackers sensor data in context Wireless Body Area Network –

0 0


smart_health_io


On Github leopard152015 / smart_health_io

Classification and prediction of genetic and non genetic obesity using Health/Fitness trackers sensor data in context Wireless Body Area Network

## Error in eval(expr, envir, enclos): object 'opts_chunk' not found

Contents of presentation

  • Introduction
  • Wireless Body Area Network
  • Health trackers
  • Comments (GoBe, AngelSensor, Jawbone UP24/UP3)
  • Questions after meeting
  • Factors & Parameters

Introduction

This paper proposes a concept/system that collects sensor data from a health tracker or some health trackers in order to classify and to predict different types of obesity, discreetly and non-invasively via a machine learning approach. Using health tracker data collected from several volunteers, we will train a machine learning model that could define different obesity features and may work with a smartphone application to predict the user’s physical state, obesity level and motivate them.

Obessity (body mass index - BMI > 29.9 kg/m2) is a dangerous, worldwide problem. For example, let's take a look on map of New-York: choose Diabete or Obesity.

Wireless Body Area Network

Wireless Body Area Network (WBAN) has emerged as a new technology for e-healthcare that allows the data of a patient’s vital body parameters and movements to be collected by small wearable or implantable sensors and communicated using short-range wireless communication techniques. Modern smartphones and health trackerss now contain a more diverse collection of sensors than ever before, and people are warming up to them. In January 2014, approximately 46 million US smartphone owners were reported to have used health and fit-ness applications 1. Currently, sports and fitness are the predominant domains of WBAN-based health applications. However, applications in disease management and health care are becoming increasingly prevalent.

Health trackers

## Loading required package: rJava
## Loading required package: xlsxjars
## <iframe src="example.html" width="1200"" height="560"> </iframe>

Download xlsx file here

Click on name of health tracker for to go to corresponding site Internet

Comments

There are a number of wearable fitness trackers out there. How can we know which one is the best?

Below, we take a look at four different trackers:

GoBe and AngelSensor are Startups.

Jawbone UP24/UP3 are two of the most popular fitness trackers in the world.

All of these gadgets have two things in common:

- They use sensors to determine things about your body, including your heart rate, breathing, steps taken, and calories burned.

- They connect to computer applications to show you the results pulled from the sensors and to help you track your progress.

There are other things to consider as well, such as data extraction (SDK, API), price, set of sensors, intuitive application interface design, capability to motivate.

GoBe

GoBe is a bracelet which measure the wearer’s heart rate, calories burned, sleep, and stress levels. That’s all conceivable, given what the Jawbone UP3 and other body trackers already measure.

But it is interesting by its “patented flow technology”. Click here to learn more about this technology.

According to it, GoBe promises to something a little more sensational: Automatically tracking the calories of everything the wearer eats, through his or her skin.

The automatic calorie-tracking, which GoBe claims to do by reading glucose levels in cells, would revolutionize dieting—even the best calorie-counting apps today rely on manual food logging.

The premise seems to be lofty, in fact. Let’s say GoBe does measure glucose levels without piercing the skin, as it claims to do. That would be a godsend to diabetics, who, as it stands, must regularly prick their fingers to test blood sugar. The less-invasive technology is probably coming soon, Michelle MacDonald ( a clinical dietician at the National Jewish Health hospital in Denver) told ( read full text) PandoDaily:

but when it does it will be the size of a shoebox ... It will come from a big lab, will be huge news and make a lot of money.

But on top of that, blood glucose is only a rough measure of total energy intake. Eat a tablespoon of olive oil, and you’ve consumed 119 calories, but your blood sugar would barely rise. A very thin slice of white bread, meanwhile, would send blood sugar soaring and only yields 40 calories.

Developer API will be available later. Now data extraction is not posible.

Test-dreve AngelSensor M1

AngelSensor M1 is an open source fitness tracker that provides a lot of health data. This is more prototype than final device, some functions like blood oxygen or sleep quality are not ready yet, it will be available later with firmware update. No site to store data – data is sent to mobile application. Temperature measurements are inaccurate -2 – 3 C than usual, but reflect well temperature changes. The same with heart rate parameter. Over 20% of steps are missed, but there is a possibility to read raw data directly to implement other algorithms for step calculation later. So this is a prototype that mostly works, but a dedicated application or API is needed to provide all implemented parameters. It has not only 3-axis accelerometer but alse a gyroscope. Concerning usability of current applications - not all parameters monitoring and no history viewing capability in the current apps version. It is in alfa-version for Android and has more features for iOS. But the project is in active development. Also it provides SDK for developers - quite good for customisation and creation of our owns applications.

Test-drive Jawbone UP 24

In my informal testing (during several months) Jawbone UP 24 handles burned calories and steps count quite well (sometimes there are +/- 10 % of steps).It provides REST API to collect list of parameters: steps, distance, burned calories, sleep (see below parameters for new UP 3 version). Sleep duration is measured well (but by accelerometer i.e. number of hours in horizontal position), so sleep quality is not accurate, but anyway it attempts to give you additional information such as how heavy or light users sleep was, and how long waking periods were. And this is all that current version provides. In 3.0 version there is also heart rate parameter. Concerning usability of current applications - it is user-frendly and also allows users to log food consumption to help with their dietary goals.

The user can set the device to vibrate under certain circumstances. A good option might be to have it vibrate after users haven’t moved for a certain period of time.

Example: Getting data from Jawbone API

Let's look at the approache of data gathering that Jawbone API proposes

This is full list of possible scopes for Jawbone U3:

basic_read extended_read location_read friends_read mood_read/write move_read/write sleep_read/write meal_read/write weight_read/write cardiac_read/write generic_event_read/write

Code example

library(httr)
library(rCharts)

Sys.setenv( JAWBONE_CONSUMER_KEY = "MY_KEY",
            JAWBONE1_CONSUMER_SECRET = "MY_SECRET")

# Read in existing data from a file or from the API ( if the file does not exist).

filename <- "data/jawbone.txt"

if ( file.exists( filename ) ){
  load ( filename )
} else {
  jawbone <- oauth_endpoint( "token", "auth", "token", base_url =        "https://jawbone.com/auth/oauth2" )
  jawbone.api.key <- Sys.getenv( c( "JAWBONE_CONSUMER_KEY" ) )
  jawbone.app <- oauth_app( "jawbone1", jawbone.api.key )

  jawbone.token <- oauth2.0_token( jawbone, jawbone.app, 
                                c( "basic_read", "extended_read", "location_read", 
                                  "friends_read", "mood_read", "move_read", 
                                  "sleep_read", "meal_read", "weight_read", 
                                  "generic_event_read" ) )

# make request of steps
  request.url <- c( "https://jawbone.com/nudge/api/v.1.1/users/@me/moves" ) 
  req <- GET( request.url, config(token = jawbone.token ) )
  stop_for_status( req )
  moves.data <- content( req )
  save( moves.data, sleeps.data,  file = filename )

# Create a simple data frame with date and total number of steps taken
  steps.df <- data.frame( date = as.Date( character() ), 
                         steps = integer(),
                         stringsAsFactors = FALSE )
  for ( m in moves.data$data$items[1:moves.data$data$size] ){
    steps.df <- rbind(steps.df, data.frame(date = as.Date(as.character(m$date), format = c("%Y%m%d")), steps = m$details$steps, stringsAsFactors = FALSE ) )
  }
  print(steps.df)
  plot(steps.df)
}

Questions after meeting

Whether there is a requirement to Real-Time necessity? If yes - it would be better to use StartUp device.

Are there special health parameters for patients of BBS that need be measured?

Is there any time for application development?

Factors & Parameters

The set of causes of obesity is complex, with numerous interrelated factors of genetics, neuroscience, physiology, and biochemistry, as well as environmental, cultural, and socio-economic factors. These have been clustered as in the image of the next slide. This image is derived from Tackling Obesities: Future Choices – Obesity System Atlas published by the former Department of Innovation Universities and Skills and is used under the Open Government Licence.

Where from top left: Social psychology (yellow), Individual psychology (orange), Physical activity environment (dark brown), Individual physical activity (light brown), Physiology (blue), Food consumption (light green), Food production (dark green).

Grouping the factors

Click here to see a larger.

Group of biological characteristics:

  • Age;

  • Sex;

  • BMI (Body Mass Index);

  • WHR (Waist to Hip Ratio);

  • Weight gain until the age of 2 years;

  • Health Current Parameters( heart rate, blood pressure, blood oxygen saturation, galvanic skin response, cholesterol (LDL/HDL ratio, TC), etc. );

  • Hormones;

  • Viruses;

  • Genetic factors involved in the obesity genesis (endogenous individual factors);

  • Metabolic factors implied in the development of the diseasee.

Group of behavioral characteristics:

  • Activity: steps, distance - per day;

  • Kind of sport activity per day;

  • Energy factors: calories burned, calories intake (proteins, glucides/carbohydrates, fats) - per day;

  • Sedentary period of life – per day;

  • Consumption of alcohol;

  • Smoking;

  • Etc.

Group of social characteristics:

  • Size of family;

  • Circle of friends;

  • Etc.

Group of environment characteristics:

  • Numbers of accessible green areas;

  • Numbers of accessible supermarkets;

  • Etc.

Group of psycho-social characteristics:

  • Stigmatization in relation to mental health symptoms, body image;

  • Low self-esteem;

  • Etc.

Group of exogenous characteristics:

  • Geographic location;

  • Demographic dynamics;

  • Etc.

Data Exploration

This report perform an analysis of Obesity comparing obese and non obese individuals. For make analysis of parameters we have the dataset, where we were given data on various physiological characteristic features: BMI, WHR values, LDL/HDL ratio, the genotypic data of MC4R and also data on the gender and age of the person under study.We'll figure out how each of these physiological and genetic factors affect obesity.

## Loading required package: ggplot2
## Use suppressPackageStartupMessages() to eliminate package startup
## messages.

BMI vs ST and WHR vs ST (subject type: obese or non-obese)

## The following objects are masked from Data (pos = 3):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## `stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.

BMI is basically the response (It is an effect of obesity). Degree of obesity can be measured by BMI of that person.

## The following objects are masked from Data (pos = 3):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 4):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## `stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.

The high WHR is indicative of abdominal obesity and the general perception is that obese individuals ( in terms of BMI) are more likely to have abdominal obesity (in terms of WHR).

NA

Fasting Blood Glucose (FBS) vs ST and Cholesterol (LDL/HDL) vs ST

## The following objects are masked from Data (pos = 3):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 4):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 5):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## `stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.

Note that FBG for the obese people has greater variation compared to non-obese individuals, specially fatter tails, however the mean value of the FBG seems to remain the same for both the obese and the non-obese groups.

## The following objects are masked from Data (pos = 3):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 4):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 5):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 6):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## `stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.

One of the main reasons behind obesity is the accumulation of the extra LDL (low density lipoprotein) which is also termed as “bad fat” and the reduction in levels for the body HDL (high density lipoprotein) content, also termed as “good fat”. LDL/HDL ratio is also extremely high for obese persons compared to the non-obese persons.

NA

BMI-WHR vs MC4R

BMI-WHR vs MC4R(G/A)

## Package 'sm', version 2.2-5.4: type help(sm) for summary information
## The following objects are masked from Data (pos = 4):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 5):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 6):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 7):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 8):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## Loading required package: rgl
## Loading required package: rpanel
## Loading required package: tcltk
## Package `rpanel', version 1.1-3: type help(rpanel) for summary information

BMI-WHR vs MC4R(G/G)

## The following objects are masked from Data (pos = 6):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 8):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 9):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 10):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 11):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 12):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR

Note that for the G/G genotype, the peak (mode) in the (BMI,WHR) density plot is at higher values of BMI and WHR. This implies that the gene G/G may be responsible for increasing the BMI and WHR, making the person more susceptible to becoming obese.

## The following objects are masked from Data (pos = 4):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 8):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 10):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 11):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 12):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 13):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR
## The following objects are masked from Data (pos = 14):
## 
##     Age, BMI, DGAT, FBG, gender, HDL, LDL, LDL.HDL.RATIO, MC4R,
##     Subject.type, T C, TC.HDL.RATIO, TG.HDL.RATIO, TGL, VLDL, WHR

Fasting Blood Glucose (FBS) vs Age

Waist to Hip Ratio (WHR) vs BMI and Age

WHR vs BMI

WHR vs Age

NA