Git Product home page Git Product logo

calorieestimation's Introduction

Deep Learning-Based Food Calorie Estimation Method in Dietary Assessment[arXiv]

Background


Obesity is a medical condition in which excess body fat has accumulated to the extent that it may have a negative effect on health.  Obesity treatment requires the patients to eat healthy food and decrease the amount of daily calorie intake. For those patients, it is helpful that calories can be estimated from photos.

Many methods based on computer vision have been created to estimate calories.

This project is used to estimate calories.To estimate calories, it requires the userto take a top view and a side view of the food before eatingwith his/her smart phone. Each images used to estimate mustinclude One Yuan coin. For the top view, we use the deeplearning algorithms to recognize the types of food and applyimage segmentation to identify the food’s contour in thephotos. So as the side view. then, the volumes of each foodis calculated based on the calibration objects in the images.In the end, the calorie of each food is obtained by searchingdensity table and nutrition table. In order to get better results, we choose to use Faster Region-based Convolutional NeuralNetworks (Faster R-CNN) to detect objects and GrabCut as segmentation algorithms.

Food Calorie Estimation Method


The flowchart of our food calorie estimation method is shown in the figure. Our method includes 5 steps: image acquisition, object detection, image segmentation volume estimation and calorie estimation. The inputs are a top view and a side view of the food; each view includes a calibration object which is used to estimate scale factor. Food(s) and calibration object are detected by object detection method called Faster R-CNN and each food’s counter is obtained by applying GrabCut algorithm. After that, we estimate each food's volume and calorie.

Requirement:software


1.Requirements for Fater R-CNN in Matlab;
2.Opencv;
3.CUDA.

Requirement:hardware


1.Requirements for Fater R-CNN in Matlab;
2.GPU with more than 2GB memeory(If you only want to test, a GPU with only 2GB memory is acceptable).

File contents


Due to this project's code is mainly baesd on the Faster R-CNN, we only introduct those code we wrote.
1.density.xls : foods' density table;
2.faster_rcnn_rec.m: this file is used to estimate calorie;
3.grabcut_mex.cpp : this file is written by C and is used to calculate volume. Grabcut function in opencv is used;
4.opencv_mex.m : compiling grabcut_mex.cpp; if your environment is different from us, modifying this file and recompiling it.
5.ECUSTFD_ORIGIN_IMAGE_TEST.m : used for volume estimation in ECUSTFD with original image size;
6.ECUSTFD_TEST.m : used for volume estimation in resized ECUSTFD;

Experiment Environment


This project is tested on W7x64 with GTX1070.

Resources


We use ECUSTFD to train and test Faster R-CNN. ECUSTFD is a free public food image dataset. ECUSTFD is available at github or BaiduYun.
  If you just want to test Faster R-CNN. You can download the weighted network at this website.  

calorieestimation's People

Contributors

liang-yc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.