Calorie Measurement: Predicting the Nutrient Content of Food using image Analysis

 

Thamarai1, Nivetha2, P.M. Durai Raj Vincent3, S.S. Manivannan4

1, 2M.S (Software Engineering), SITE, VIT University, Vellore

3,4Associate Professor, SITE, VIT University, Vellore.

*Corresponding Author E-mail: thamse13@gmai.l.com

 

ABSTRACT:

People have started giving preference to their health, type of food, workouts in order to keep them away from health problems. Nowadays Obesity has a serious health issue in adults. Obesity is mainly caused due to improper consumption of food. They can be reduced by measuring the intake of food of an individual. This paper gives a brief description of measuring the calorie value of a food which is consumed by the individual. The system first takes the image of the food. From the given food image the feature like color, shape and texture are extracted by using different algorithms. The Bag of features method is used to extract the features and recognize the type of food. The calorie value is measured using the nutrient table. Our system uses the image processing toolbox in mat lab.

 

KEYWORDS: Calorie Measurement, Food Image Processing, Feature Extraction, Food Recognition, Bag Of Features.

 

 


INTRODUCTION:

In today’s world one of the major health issues is caused due to obesity. It is becoming a serious health issue in both adults and children. Obesity is mainly is caused due to various reasons, but the main cause is improper intake of food. In order to avoid obesity daily intake of food should be noted manually, which is not possible always. There have been various technologies used in treating obesity and other health issue. One of the simple methods is to measure the food calorie through image analysis. This paper shows how the calorie value can be measured through Image processing from the food image. Bag of Features method is used to recognize different types of food, fruits and vegetable.

 

In the proposed system only some features like size and colour features have been extracted, but in system more image conversion operations have been done like converting the colour image into gray scale image, binary image, inverted binary image, filtered image, Noise removal, colour and texture segmentation. By this process the various features are extracted for the different images we select from the folder. The segmentation process involves mainly in segmenting the colour and texture of different food. The system shows the estimated feature values from the segmentation process.

 

The other part of the paper is organized as follows: Section II shows the literature survey which briefly explains about the different research paper done by different authors, while section III presents the brief explanation of proposed system with their advantage and drawbacks.

 

This is followed by the Section IV which shows the architectural diagram and explanation of each step. Section V includes the various algorithm used for recognition and segmentation, which is followed by reference papers which has been helpful for the completion of this paper and project. Finally, Section VI gives the conclusion part and about the future work.

 

LITERATURE SURVEY:

The proposed system is involved in measuring the calorie from of the food image. The system[1] can measure the calorie and nutrition value based on the type of food image through image analysis, here a special calibration technique has been used to record food before and after intake of food. A simple system [2]which is used for measuring food portion size uses a camera and light emitting diode. Experiment result shows that by using this technique the portion of the food can be accurately calculated.

 

The system is based on image processing and shape recognition using the nutrition table and density table [3]. The system is used for the medical purpose. The system also gives the food nutrition and energy intake of an individual. There are two types to segment food image using the connected components, in the first step the color image is grey scale and then to thresholding [4], so that it converts into binary and inverted binary image.

 

The most important component used for the food recognition is nutrient fact database [5]. The nutrition values of food are stored in these tables which is available from world health organization. These tables help us to calculate the calorie value quickly without the help of internet or experts.

 

A primary description part of the paper is described [6], apart the system the proposed system has extended it by giving more accurate values for estimating portion of food volume. The system also works for the food portion of irregular shapes and by giving a plate of food image as input to the user.

 

Classification is the process of identifying food items using recognition method based on the segmentation of food image and feature extraction. Bag of features is used for classification of food items. [7], all the food images are trained and tested based on the feature extraction.

 

A new technique called active contours has proposed in [8] to detect the boundaries of the object. This method is suitable for the image with strong boundaries. This model works best when the food items are separated from each other.

 

A paper uses the recognition phase. The input image will be matched with the trained image. The training images with the minimum distance will be selected, and finally based on the detection result and size the calorie value of food and fruit can be calculated [9].

Computer vision system has been used widely for the food classification, [10]. Bag of features is one the common used computer vision system used in food recognition for the purpose classification in this paper.

 

Food cue incentive is high in normal-weight and obese during fasting.. Sensitization to food cues in the environment is the key role in the maintenance of obesity [11] National Health and Nutrition Examination Survey (NHANES) caloric intake data is analysed and the dietary measurement protocols are mentioned [12]

 

Characteristics of the foods mentioned in [13] are energy-dense and high-fat foods have significantly lower 'ratios of expected satiety.

 

This screener tool is used to monitor the patients' diets. Persons who score poorly can be referred for more extensive evaluation by low-cost paper-and-pencil methods. [14]

 

Low BMI, indicating PCM is found to negatively influence quality of life in this study [15] which is used to prevent PCM

 

PROPOSED WORK:

The proposed system calculates more features values than other systems, including color, texture, sizes and shape feature extraction process. Using these four features the system increases the accuracy of the system compared with the system using less features for feature extraction. A special method called active counter is used for the texture segmentation of food images. The result of this active counter is a 2-D array, which has the same size of the given input food images. The following Architecture diagram shows all the stages. The First stage is Image conversion operations and then finding the food image. The image conversion operations like grayscale image, binary image, inverted binary image, color segmentation, texture segmentation, edge detection and filtered image. In the segmentation step, the given input image will extract various segments of food portion from the food image. Segmentation is one of the important steps in processing the image and hence the color and texture segmentation tools are widely used. The Color Segmentation is used to segment the image based on the color. Texture Segmentation is used to detect the different shape of the image.

 

Next step is the Food Portion Recognition. The various food features extraction is performed for the input image. The feature values which are extracted will be sent to the classification step where, using the Bag of Features (BOG), the portion will be identified. So the various types of food are identified and the calorie value is detected based on the input image. The system also identifies what object image is that and displays the message based on the image.

 

The Third stage is Food Portion Volume Measurement. It is calculating the area and volume of food content. Then the Fourth stage Calorie and Nutrient Measurement. It is using calculating the Nutritional table and Density table.

 

Finally, is the Calorie Detection process. The calorie value for different types of food is identified based on the nutrient table and the density table. These tables are stored in the workspace in matlab. The area and volume of the food are first identified and it looks up the table value for the different food and fruit image. Finally the nutrient value for food image is displayed and the non-food item also identified. It helps the patients and dieticians to keep record of the calorie value before and after meal. So it helps them to maintain a healthy diet and intake of proper nutrient content of food.

 

ARCHITECTUREDIAGRAM

 

1. Input Image:

The input image is taken from the folder based on the users interest in selecting the different food image.

 

2. Image Segmentation:

The image is loaded from the file, the corresponding image is segmented like color segmentation, texture segmentation, shape detection, filter image.

Color Segmentation: This segmentation is used to segment the image based on the color.

Texture Segmentation: This segmentation is used to detect the different shape of the image.

Edge Detection: Here, Canny edge detection is used for detecting edges.

Filter Image: The image is filtered using median filter, range filter to remove noise from the image.

Contrast Enhanced: This process shows the histogram of the image using contrast enhanced.

Binary Image: The threshold value are calculated using these binary functions for different image.

 

3. Image Recognition:

The image is recognized by Pattern recognition system. It is used to recognize the food based on the feature extracted from the segmentation process. The dataset of each food is stored in the workspace. Based on the dataset the trained values and testing values are obtained. Image recognition is done through pattern recognition tool in neural network. The input image and target image are given and the image is trained to get the performance value, trained value and confusion matrix. The confusion matrix gives the accurate value of trained, validation, and test value. The various types of food and fruit are identified and the calorie value is detected based on the input image. If the input image is not food, the system also identifies what object image is that and displays the message based on the image.

 

4. Classification:

The next step is the classification, where the identified food image is processed to identify the calorie and density value of the respected food. The process used here for clustering is the BOF (Bag of Features) method. Bag of Features is used as an algorithm which assigns the labels to the image based on the threshold value. It is a classification step which is based on the Computer vision toolbox.

 

In Bag of Features, first we have to categorize the image from the folder which is suitable for classification. Then we have to get the features of every image from the folder. After that the optimization problem for matching is solved and the constructs for the classification function is also done It will provide more accurate results based on the table value stored.

 

5. Calorie Detection:

The calorie value for different types of food is identified based on the nutrient table and the density table. These tables are stored in the workspace in mat lab. The area and volume of the food are first identified and the it look up the table value for the different food and fruit image. Finally the nutrient value for food image is displayed and the non-food item also identified. It helps the patients and dieticians to keep record of the calorie value before and after meal. So it helps them to maintain a healthy diet and intake of proper nutrient content of food.

 

 

 

 

 

SAMPLES:

SAMPLE INPUT IMAGE:

Fig.1 The input image is first loaded from the file.

 

SAMPLE OUTPUT IMAGES:

EDGE DETECTION:

Edge Detection is one of the image conversion operation where edges are detected from a particular image based on the given input image. The edge detection may vary from image to image. In order to do edge detection may methods like Canny, Sobel edge detection methods are used.

 

The output of the given input image for edge detection is shown below in fig.2

 

Fig.2 Image after Edge Detection

 

COLOR SEGMENTATION IMAGE:

The color segmentation is done by converting the lab form color image method. The input image is first converted into grayscale image for easy conversion of image and then makecform method is applied to the rows and columns of the grayscale input image. The output image of the given input image for color segmentation is shown below in fig.3

 

Fig.3 after Color Segmentation

 

FILTERED IMAGE:

One of the most important operation in image processing is filtering the image. The filtered image is done by applying makecform to the grayscale image and the lab color method is used as done in color segmentation, but a special function called range filter is used for the filtering the image.

 

Fig.4 Filtered Image

FIGURES:

OUTLOOK:

Fig.5 Input a food for Nutrition Analysis

 

MEASURING THE COLORIE VALUE OF FOOD :

Fig.6 Calorie value of Apple

 

RESULTS ANALYSIS:

Some of the features to be added in detecting some of the mixed foods. The system uses active counter for the segmentation process. This type of segmentation suitable is suitable for segmenting the single food image rather than the mixed type of food image.

 

The proposed system works well for the image conversion operations like filtered image, edge detection image, color and texture segmentation image, binary and inverted binary image using their own functions and methods.

 

The various type of food images are taken as input from different folders. The images are trained. The trained image should match up with the original image. Even though a single image is taken as input all the image in the folder should be trained. It takes the values obtained from the feature extraction and then the type of food image is recognized.

 

The calorie values are stored in the excel sheet along with protein, fat and nutrient value in the table. By clicking on the radio button of the desired food image, the calorie values are displayed. The calorie values are even displayed without even training the image, by just looking at the given input image. The outlook of the result and the result of the calorie are shown in Fig.5 and Fig, 6.

 

CONCLUSIONAND FUTURE WORK:

The paper concludes all the methods and technique used for image conversion operations, segmentation and recognition process and for measuring the calorie value. The calorie values are measured by referring to the nutrient and calorie values stored in the excel sheet. The system mainly deals with the image processing toolbox in mat lab. In image processing toolbox, the most commonly used technique called active counter is used for segmentation and computer vision toolbox for the recognition process.

 

The future work deals with measuring the calorie value for not only the solid type of food, but also liquid type of food such as juice, soup etc. In addition to detect the separate the particular image from the mixed food, if possible.

 

REFERENCES:

1.     Obesity and overweight, World Health Organization (WHO), Fact Sheet, Geneva, Switzerland. 2017.

2.     World Health Statistics, World Health Organization (WHO), Fact Sheet, Geneva, Switzerland. 2012

3.      G.A. Bray and C. Bouchard, Handbook of Obesity, 2nd Edition, Baton Rouge, Pennington Biomedical Research Center, LA, USA:, 2004.

4.     J. Wenyan, Z. Ruizhen, Y. Ning, J. D. Fernstrom, M. H. Fernstrom, R. J. Sclabassi, et al., “A food portion size measurement system for image based dietary assessment,” in Proc. IEEE 35thBioeng. Conf., Apr.2009 .pp:3-5.

5.     R. Almaghrabi, G. Villalobos, P. Pouladzadeh, and S. Shirmohammadi, “A novel method for measuring nutrition intake based on food image,” in IEEE Int. Insrum. Meas. Technol. Conf., Graz, Austria, 2012.

6.     B. Kartikeyan and A. Sarkar, “An identification approach for 2-Dautoregressive models in describing textures,” CVGIP, Graph. Models Image Process., 1993 ;53(2)

7.     Michael I. Goran, Measurement Issues Related to studies of childhood obesity American Academy of Pediatrics center, 1998.

8.     Jeffrey I. Gordon, Washington University School of Medicine, Long term calorie restriction is highly effective in reducing risks. St. Louis, 2004.

9.     Lynne R. Wilkens, James Lee, Nutritional Epidemiology, 2005.

10.   Rosalyn E. Weller, Edwin W. cook, Donald B. Twieg, Widespread reward-system activation in obse women in response to pictures of high-calorie foods, Available, 2008.

11.   E H Castellanos, Charboneau , MS Dietrich, International Journal of Obesity, 2009.

12.   Archer E, Hand GA, Blair SN(2013) validity of U.S. Nutritional Surveillance: National Health and Nutrition examination Survey Caloric Energy Intake Data , 1971-2010.

13.   Jeffrey M. Brunstrom, Nicholas G. Shakeshaft, Nicholas E. Scott-Samuel, measuring ‘expected satiety’ in a range of common foods, 2008.

14.   Gladys Block MD, PhD, hristina Gillespie, rnest H Rosenbaum MD,A rapid food screener to assess fat and fruit and vegetable intake, may 2000.

15.   Neva L. Crogan, Alice Pasvgel, The Influence of protein-calorie malnutrition on quality of life, 2002.

 

 

 

 

 

 

 

 

 

 

Received on 07.09.2017         Modified on 30.10.2017

Accepted on 09.11.2017      © RJPT All right reserved

Research J. Pharm. and Tech. 2018; 11(3): 959-963.

DOI: 10.5958/0974-360X.2018.00179.8