Eating and Drinking Recognition in Free-Living Conditions for Triggering Smart Reminders
Abstract
:1. Introduction
- Introduction of a new dataset to assist the creation of eating and drinking recognition algorithms, focused on capturing the diversity of wrist/hand movements inherent to free-living conditions utilization;
- Assessment of the impact of eating and drinking simultaneous recognition through a semi-hierarchical approach, based on two binary classifiers rather than a single multi-class classifier;
- Assessment of the impact of adding several eating and drinking-related restrictions in a post-processing layer, acting on top of the classification output;
- Proposal of a new application for the algorithm of dynamic segmentation of data streams proposed by [11], and a variation of that same algorithm which improved drinking recognition sensitivity when compared to the standard approach of that work.
2. Background
2.1. Distinguishing Eating and Drinking Activities from other ADL
2.2. Eating Recognition
2.3. Drinking Recognition
3. Methodology
3.1. Dataset Acquisition
3.1.1. Dataset 1: Perfectly Segmented Activities
3.1.2. Dataset 2: Continuous Sequence of Activities
3.1.3. Dataset 3: Eating and Drinking by Seniors
3.1.4. Validation Sets
3.2. Data Preprocessing and Segmentation
3.3. Feature Extraction and Selection
3.4. Class Balancing Methods and Classification
3.5. Experiments Description
3.5.1. Sensor Selection
3.5.2. Binary vs. Multi-Class Classification
3.5.3. Semi-Hierarchical Approach and Branch Optimization
- Probability of eating depending on the daily hour (E1): There are some common practices concerning the relation between eating habits and time of day in western culture countries, which make it overall possible to assume that during some specific times of the day the probability of performing a meal increases and during some other times it can be very low. In this sense, the probability that a user is eating by time of day was estimated by means of the sum of three Gaussian distributions (one for each main meal), each one centered at a reasonable time of the day for that meal to happen and with a standard deviation of 1.5 h. Figure 3 illustrates the outcome of this process. Gaussian distributions were centered at 8 a.m., 12:30 p.m. and 8 p.m., corresponding to breakfast, lunch and dinner, respectively. The probability at each time of day for a meal to happen was then used to filter eating predictions by means of Equation (1), where is the probability of the prediction returned by the classifier for the i-th 10 s window, is the meal probability estimation by time that corresponds to that same window, and N is the number of previous window-associated probabilities considered to smooth the output (in this case, ). If , then an is eating label was assigned.
- Minimum duration of a meal (E2): Statistics indicate that the OECD country which spends fewer time per day eating (UK) spends 1 h, on average, in this process [36]. This means that, even if four meals take place (breakfast, lunch, afternoon snack, dinner), these would last for 15 min on average, which could support the hypothesis that eating periods that last for less than a 5 to 10 min would not correspond to a meal period and, thus, would not qualify as meaningful in the context of this work. Following these ideas, a 5 min threshold was set, i.e., eating periods shorter than 5 min would not be considered. This threshold is also coherent with the purpose of issuing medication-related reminders, since triggering them 5 min into a meal would optimize the trade-off between time opportunity and guaranteeing that a meal is taking place, in order not to mislead the user.
- Energy peaks before meals (E3): The hypothesis of a third restriction was based on the work of [7], in which meals were considered to be preceded and succeeded by energy peaks of the acceleration signal from the wrist of the user. In fact, this assumption is supported by daily evidences. Hand movements are usually slow and small during a meal, but before it takes place it is necessary to prepare it, grab some tools or wash hands, and, after it, several other movements should also occur (e.g., cleaning the dishes). The eating activity would, therefore, happen during a “valley” in the energy of the acceleration signal, preceded and succeeded by energy peaks. In the present case, this concept was used as a preventive measure to avoid false positives, by only considering that a meal is taking place if it was preceded by said peak. Energy computation was implemented as in [7].
3.5.4. Validation
4. Results
4.1. Sensor Selection
4.2. Binary vs. Multi-Class Classification
4.3. Semi-Hierarchical Approach and Branch Optimization
Post-Processing Layer Restrictions Assessment
4.4. Validation
5. Discussion of Results
6. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Anderez, D.O.; Appiah, K.; Lotfi, A.; Langesiepen, C. A hierarchical approach towards activity recognition. In Proceedings of the 10th International Conference on Pervasive Technologies Related to Assistive Environments. ACM, Rhodes, Greece, 21–23 June 2017; pp. 269–274. [Google Scholar]
- O’brien, T.; Troutman-Jordan, M.; Hathaway, D.; Armstrong, S.; Moore, M. Acceptability of wristband activity trackers among community dwelling older adults. Geriatr. Nurs. 2015, 36, S21–S25. [Google Scholar] [CrossRef] [PubMed]
- Holzinger, A.; Searle, G.; Prückner, S.; Steinbach-Nordmann, S.; Kleinberger, T.; Hirt, E.; Temnitzer, J. Perceived usefulness among elderly people: Experiences and lessons learned during the evaluation of a wrist device. In Proceedings of the 2010 4th International Conference on Pervasive Computing Technologies for Healthcare (PervasiveHealth). IEEE, Munich, Germany, 22–25 March 2010; pp. 1–5. [Google Scholar]
- Rasche, P.; Wille, M.; Theis, S.; Schäefer, K.; Schlick, C.M.; Mertens, A. Activity tracker and elderly. In Proceedings of the 2015 IEEE International Conference on Computer and Information Technology; Ubiquitous Computing and Communications; Dependable, Autonomic and Secure Computing; Pervasive Intelligence and Computing (CIT/IUCC/DASC/PICOM), Liverpool, UK, 26–28 October 2015; pp. 1411–1416. [Google Scholar]
- Figo, D.; Diniz, P.C.; Ferreira, D.R.; Cardoso, J.M. Preprocessing techniques for context recognition from accelerometer data. Pers. Ubiquitous Comput. 2010, 14, 645–662. [Google Scholar] [CrossRef]
- Thomaz, E.; Essa, I.; Abowd, G.D. A practical approach for recognizing eating moments with wrist-mounted inertial sensing. In Proceedings of the 2015 ACM International Joint Conference on Pervasive and Ubiquitous Computing. ACM, Osaka, Japan, 7–11 September 2015; pp. 1029–1040. [Google Scholar]
- Dong, Y.; Scisco, J.; Wilson, M.; Muth, E.; Hoover, A. Detecting periods of eating during free-living by tracking wrist motion. IEEE J. Biomed. Health Inform. 2014, 18, 1253–1260. [Google Scholar] [CrossRef] [PubMed]
- Fontana, J.M.; Farooq, M.; Sazonov, E. Automatic ingestion monitor: A novel wearable device for monitoring of ingestive behavior. IEEE Trans. Biomed. Eng. 2014, 61, 1772–1779. [Google Scholar] [CrossRef] [PubMed]
- Bedri, A.; Li, R.; Haynes, M.; Kosaraju, R.P.; Grover, I.; Prioleau, T.; Beh, M.Y.; Goel, M.; Starner, T.; Abowd, G. EarBit: Using wearable sensors to detect eating episodes in unconstrained environments. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol. 2017, 1, 37. [Google Scholar] [CrossRef] [PubMed]
- Amft, O.; Bannach, D.; Pirkl, G.; Kreil, M.; Lukowicz, P. Towards wearable sensing-based assessment of fluid intake. In Proceedings of the PerCom Workshops, Mannheim, Germany, 29 March–2 April 2010; pp. 298–303. [Google Scholar]
- Kozina, S.; Lustrek, M.; Gams, M. Dynamic signal segmentation for activity recognition. In Proceedings of the International Joint Conference on Artificial Intelligence, Barcelona, Spain, 16–22 July 2011; Volume 1622, p. 1522. [Google Scholar]
- Shoaib, M.; Bosch, S.; Incel, O.D.; Scholten, H.; Havinga, P.J. Complex human activity recognition using smartphone and wrist-worn motion sensors. Sensors 2016, 16, 426. [Google Scholar] [CrossRef] [PubMed]
- Ramos-Garcia, R.I.; Muth, E.R.; Gowdy, J.N.; Hoover, A.W. Improving the recognition of eating gestures using intergesture sequential dependencies. IEEE J. Biomed. Health Inform. 2015, 19, 825–831. [Google Scholar] [CrossRef] [PubMed]
- Cardinaux, F.; Bhowmik, D.; Abhayaratne, C.; Hawley, M.S. Video based technology for ambient assisted living: A review of the literature. J. Ambient Intell. Smart Environ. 2011, 3, 253–269. [Google Scholar] [Green Version]
- Bao, L.; Intille, S.S. Activity recognition from user-annotated acceleration data. In Proceedings of International Conference on Pervasive Computing; Springer: Berlin/Heidelberg, Germany, 2004; pp. 1–17. [Google Scholar]
- Zhu, C. Hand Gesture and Activity Recognition in Assisted Living through Wearable Sensing and Computing. Ph.D. Thesis, Faculty of the Graduate College of Oklahoma State University, Stillwater, OK, USA, 2011. [Google Scholar]
- Chernbumroong, S.; Cang, S.; Atkins, A.; Yu, H. Elderly activities recognition and classification for applications in assisted living. Expert Syst. Appl. 2013, 40, 1662–1674. [Google Scholar] [CrossRef]
- Varkey, J.P.; Pompili, D.; Walls, T.A. Human motion recognition using a wireless sensor-based wearable system. Pers. Ubiquitous Comput. 2012, 16, 897–910. [Google Scholar] [CrossRef]
- Thomaz, E. Automatic Eating Detection in Real-World Settings with Commodity Sensing. Ph.D. Thesis, Georgia Institute of Technology, Atlanta, GA, USA, May 2016. [Google Scholar]
- Amft, O.; Junker, H.; Troster, G. Detection of eating and drinking arm gestures using inertial body-worn sensors. In Proceedings of the 9th IEEE International Symposium on Wearable Computers (ISWC’05), Osaka, Japan, 18–21 October 2005; pp. 160–163. [Google Scholar]
- Amft, O.; Tröster, G. Recognition of dietary activity events using on-body sensors. Artif. Intell. Med. 2008, 42, 121–136. [Google Scholar] [CrossRef] [Green Version]
- Junker, H.; Amft, O.; Lukowicz, P.; Tröster, G. Gesture spotting with body-worn inertial sensors to detect user activities. Pattern Recognit. 2008, 41, 2010–2024. [Google Scholar] [CrossRef]
- Lukowicz, P.; Ward, J.A.; Junker, H.; Stäger, M.; Tröster, G.; Atrash, A.; Starner, T. Recognizing workshop activity using body worn microphones and accelerometers. In Proceedings of the International Conference on Pervasive Computing; Springer: Berlin/Heidelberg, Germany, 2004; pp. 18–32. [Google Scholar]
- Lee, C.; Xu, Y. Online, interactive learning of gestures for human/robot interfaces. In Proceedings of the IEEE International Conference on Robotics and Automation, Minneapolis, MN, USA, 22–28 April 1996; Volume 4, pp. 2982–2987. [Google Scholar]
- Gomes, D.; Sousa, I. Real-Time drink trigger detection in free-living conditions using inertial sensors. Sensors 2019, 19. [Google Scholar] [CrossRef] [PubMed]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Fraunhofer Portugal AICOS. A Day with Pandlets; Technical Report; Fraunhofer Portugal: Porto, Portugal, 2016. [Google Scholar]
- Charmant, J. Kinovea, version 0.8.15; 2012; Available online: https://www.kinovea.org/ (accessed on 21 June 2019).
- Shen, Y.; Muth, E.; Hoover, A. Recognizing eating gestures using context dependent hidden Markov models. In Proceedings of the IEEE First International Conference on Connected Health: Applications, Systems and Engineering Technologies (CHASE), Washington, DC, USA, 27–29 June 2016; pp. 248–253. [Google Scholar]
- Hanai, Y.; Nishimura, J.; Kuroda, T. Haar-like filtering for human activity recognition using 3d accelerometer. In Proceedings of the IEEE 13th Digital Signal Processing Workshop and 5th IEEE Signal Processing Education Workshop, Marco Island, FL, USA, 4–7 January 2009; pp. 675–678. [Google Scholar]
- Breiman, L.; Friedman, J.; Olshen, R.; Stone, C. Classification and Regression Trees; Routledge: London, UK, 1984. [Google Scholar]
- Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic minority over-sampling technique. J. Artif. Intell. Res. 2002, 16, 321–357. [Google Scholar] [CrossRef]
- Wilson, D.L. Asymptotic properties of nearest neighbor rules using edited data. IEEE Trans. Syst. Man Cybern. 1972, 2, 408–421. [Google Scholar] [CrossRef]
- Batista, G.E.; Prati, R.C.; Monard, M.C. Balancing strategies and class overlapping. In Proceedings of International Symposium on Intelligent Data Analysis; Springer: Berlin/Heidelberg, Germany, 2005; pp. 24–35. [Google Scholar]
- More, A. Survey of resampling techniques for improving classification performance in unbalanced datasets. arXiv 2016, arXiv:1608.06048. [Google Scholar]
- Statista, T.S.P. Time Spent Eating and Drinking by Men and Women in OECD Countries 2016|Statistic, 2016. Available online: https://www.statista.com/statistics/521972/time-spent-eating-drinking-countries/ (accessed on 12 July 2017).
Work | Summary of Proceedings | |
---|---|---|
[15] | Recognized activities | Walking, walking carrying items, sitting & relaxing, working on computer, standing still, eating or drinking, watching TV, reading, running, bicycling, stretching, strength-training, scrubbing, vacuuming, folding laundry, lying down & relaxing, brushing teeth, climbing stairs, riding elevator and riding escalator |
Sensors | Accelerometers | |
Features | Mean, energy, frequency-domain entropy, and correlation | |
Classifiers | Decision tree C4.5 | |
Eating recognition metrics | Accuracy: 89% | |
[16] | Recognized activities | Sitting, sit-to-stand, stand-to-sit, standing, walking, typing on keyboard, using the mouse, flipping a page, cooking, eating |
Sensors | Accelerometers and location tracker | |
Features | Mean and variance of the 3D acceleration | |
Classifiers | Dynamic Bayesian Network | |
Eating recognition metrics | Accuracy: 80% | |
[17] | Recognized activities | Brushing teeth, dressing/undressing, eating, sweeping, sleeping, ironing, walking, washing dishes, watching TV |
Sensors | Accelerometer, thermometer and altimeter | |
Features | Mean, minimum, maximum, standard deviation, variance, range, root-mean-square, correlation, difference, main axis, spectral energy, spectral entropy, key coefficient | |
Classifiers | Support Vector Machines | |
Eating recognition metrics | Accuracy: 93% | |
[12] | Recognized activities | Standing, jogging, sitting, biking, writing, walking, walking upstairs, walking downstairs, drinking coffee, talking, smoking, eating |
Sensors | Accelerometer, gyroscope and linear acceleration sensor | |
Features | Mean, standard deviation, minimum, maximum, semi-quantile, median, sum of the first ten FFT coefficients | |
Classifiers | Naive Bayes, k-Nearest Neighbors, Decision Tree | |
Eating recognition metrics | F1-score: up to 87% |
Sensor Type | No. Sensors | Features | Classifier | Performance Metrics | |
---|---|---|---|---|---|
[7] | Inertial | 1 | Manipulation, linear acceleration, amount of wrist roll motion, regularity of wrist roll motion | Naive Bayes | Accuracy (weighted): 81% |
[8] | Multimodal | 2 | MAV, RMS, maximum, median, entropy, zero crossings, no. peaks, average range, wavelength, no. slope sign changes, energy of the frequency spectrum, energy spectrum, entropy spectrum, fractal dimension, peak frequency, standard deviation, and other features derived from the aforementioned | ANN | Accuracy: 90% |
[6] | Inertial | 1 | Mean, Variance, Skewness, Kurtosis, RMS | Random Forest | F1-scores: 71–76% |
[9] | Inertial | 2 | RMS, variance, entropy, peak power, power spectral density, zero crossing, variance of zero crossing, peak frequency, number of auto-correlation peaks, prominent peaks, weak peaks, maximum auto-correlation value, first peak | Random Forest | Accuracy: 93%; F1-score: 80% |
DATASET 1 | ||||
Activity | Description | No. Subjects | Planned Time/Subject (s) | Total Acquisition Time (s) |
Eat | With spoon With fork and knife With hands, sitting With hands, standing | 9 11 11 11 | 120 120 60 60 | 4055 |
Drink | Grab mug, sip, put mug back Get water bottle from a bag, long sip, put it back Grab cup, sip, put cup back Drink while standing | 11 9 11 9 | 90 90 90 90 | 3727 |
Other | Make a phone call Comb hair Walk Scratch face Working with keyboard and mouse Texting Writing with a pen | 11 10 11 11 11 11 11 | 60 60 60 30 60 30 60 | 4114 |
DATASET 2 | ||||
ID | Sequence of Activities | Approx. Total Duration (s) | Approx. Eating Duration (s) | Approx. Drinking Duration (s) |
1 | Walk Prepare meal Have breakfast Drink tea while watching TV Brush teeth Comb hair Apply facial cream | 1609 | 288 | 175 (20 events) |
2 | Walk Have dinner Drink from a cup Have a conversation Make a phone call Play with smartphone | 2425 | 1748 | 13 (2 events) |
3 | Eat dessert with a spoon Descend stairs Walk Drink water from a bottle Walk Ascend stairs Brush teeth Comb hair | 521 | 398 | 7 (1 event) |
4 | Descend stairs Walk Play table football Stand in a line Walk with a tray Have lunch Walk | 3859 | 1038 | 0 |
5 | Wash dishes Drink water from a bottle Prepare a meal Have lunch Work with mouse and keyboard Drink tea from a mug while working with a computer | 2620 | 608 | 105 (14 events) |
DATASET 3 | ||||
Activity | Description | No. Seniors | Total Acquisition Time (s) | |
Eat | Having lunch Having an afternoon snack | 6 2 | 9278 666 | |
Drink | Simulate grabbing a cup/bottle, sipping and putting the object back | 16 | 236 |
Wrists | Sensors | Classifiers * | ||||||
---|---|---|---|---|---|---|---|---|
D | B | A | G | NN | NB | DT | MLP | HMM |
X | X | 0.65 | 0.64 | 0.56 | 0.66 | 0.73 | ||
X | X | 0.56 | 0.48 | 0.47 | 0.56 | 0.59 | ||
X | X | X | 0.72 | 0.66 | 0.61 | 0.75 | 0.75 | |
X | X | 0.70 | 0.68 | 0.58 | 0.68 | 0.69 | ||
X | X | 0.62 | 0.51 | 0.46 | 0.64 | 0.59 | ||
X | X | X | 0.75 | 0.64 | 0.57 | 0.74 | 0.73 |
MLP | HMM | Random Forest | |
---|---|---|---|
AUC | 0.77 (+/− 0.21) | 0.75 (+/− 0.22) | 0.84 (+/− 0.12) |
Activity | Segmentation + Post-Processing | Sensitivity | Specificity | FP/h |
---|---|---|---|---|
Eat | FW FW + E1 FW + E2 FW + E3 FW + E1 + E2 * | 0.95 0.84 0.93 0.23 0.73 | 0.42 0.81 0.56 0.81 0.93 | 34.47 11.13 25.80 10.93 4.27 |
Drink | DW DFW DFW + D1 * | 0.57 0.63 0.63 | 0.99 0.98 0.99 | 5.33 6.13 5.06 |
EATING * | |||||||
Confusion Matrix | Performance Metrics | ||||||
Eat | Not eat | Total | Precision | Recall | F1-score | ||
Eat Not eat | 25 14 | 11 904 | 36 933 | 0.64 0.99 | 0.69 0.98 | 0.67 0.99 | |
Total/Avg | 39 | 915 | 969 | 0.97 | 0.97 | 0.97 | |
DRINKING * | |||||||
Confusion Matrix | Performance Metrics | ||||||
Drink | Not drink | Total | Precision | Recall | F1-score | ||
Drink Not drink | 26 10 | 14 5689 | 40 5699 | 0.72 1.00 | 0.65 1.00 | 0.68 1.00 | |
Total/Avg | 36 | 5703 | 5739 | 1.00 | 1.00 | 1.00 | |
OVERALL * | |||||||
Confusion Matrix | Performance Metrics | ||||||
Eat | Drink | Other | Total | Precision | Recall | F1-score | |
Eat Drink Other | 150 5 79 | 0 24 10 | 66 11 5380 | 216 40 5469 | 0.64 0.71 0.99 | 0.69 0.60 0.98 | 0.67 0.65 0.98 |
Total/Avg | 234 | 34 | 5457 | 5725 | 0.97 | 0.97 | 0.97 |
Precision | Recall | F1-Score | No. Samples | |
---|---|---|---|---|
Eat | 0.39 | 0.77 | 0.52 | 552 |
Drink | 0.37 | 0.62 | 0.46 | 81 |
Other | 0.99 | 0.93 | 0.96 | 10737 |
Total/Avg | 0.95 | 0.92 | 0.93 | 11370 |
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gomes, D.; Mendes-Moreira, J.; Sousa, I.; Silva, J. Eating and Drinking Recognition in Free-Living Conditions for Triggering Smart Reminders. Sensors 2019, 19, 2803. https://doi.org/10.3390/s19122803
Gomes D, Mendes-Moreira J, Sousa I, Silva J. Eating and Drinking Recognition in Free-Living Conditions for Triggering Smart Reminders. Sensors. 2019; 19(12):2803. https://doi.org/10.3390/s19122803
Chicago/Turabian StyleGomes, Diana, João Mendes-Moreira, Inês Sousa, and Joana Silva. 2019. "Eating and Drinking Recognition in Free-Living Conditions for Triggering Smart Reminders" Sensors 19, no. 12: 2803. https://doi.org/10.3390/s19122803