\chapter*{Abstract}
This thesis considers the problem of detecting when a person is eating during everyday life by examining daily patterns of wrist motion with recurrent neural networks. Our novelty is analyzing an entire day of data to classify and segment meals with a model we call the ``daily pattern classifier''. Previous research has only analyzed short windows on the order of seconds or minutes long that miss larger day-to-day patterns. The goal of this work is to utilize daily contextual indicators to improve eating episode detection and reduce false detections that occur throughout the day.

The wrist motion data used in this work was from the Clemson All-Day (CAD) dataset collected in previous work~\cite{cad2020}. This dataset consists of 354 day-length recordings of wrist motion data from 351 participants for a total of 1,063 meals and 4,680 hours. Previous work used a sliding window approach and a convolutional neural network classifier to process this data and generate a continuous probability of eating, or $P$($E$), from a day-length recording~\cite{sharma2020}. We call this model the ``windowed eating classifier''. The day-level classifier proposed in this work operates on the $P$($E$) sequences, also called ``daily samples''. In order to train and evaluate the daily pattern classifier, we required a larger set of daily samples than the number of recordings in the dataset. For data augmentation, the windowed eating classifier was used repeatedly to generate a sizable set of daily samples for this purpose. Genuine noise from the volatility of the model differentiated samples from the same actual recording. To reduce the necessary model complexity and generation time, the daily samples were downsampled before further processing. After downsampling, the daily samples and the corresponding ground truth eating events were saved together to files for subsequent training and evaluation with the daily pattern classifier. 

The daily pattern classifier proposed in this work utilizes a recurrent neural network (RNN) architecture. This was advantageous due to the memory attributes, masking abilities, and time series applications of RNNs. Training this model required all inputs to be the same length. Since the daily samples varied in duration, they were all padded to the same size. These padded values were later masked out in the model, so they did not affect training. The daily pattern classifier was trained and evaluated using 5-fold cross validation. Before metrics were measured, a single-value thresholding algorithm was used for post-processing the output of the daily pattern classifier. Lastly, both time and episode evaluation metrics were measured to determine how well the classifier categorized individual timesteps as well as entire eating episodes respectively. 

In our results, the daily pattern classifier significantly filtered background noise, which improved the separation between strong meal peaks and other noise in the $P$($E$) signal. Our approach achieved an eating episode true positive rate (TPR) of 85\% with 0.8 false positives per true positive (FP/TP). This was a 4\% decrease in episode TPR, but a 53\% improvement in FP/TP when compared to the windowed eating classifier in previous work~\cite{sharma2020}. The time weighted accuracy of our approach was 85\%, which is 5\% higher than the windowed eating classifier indicating better overall datum-by-datum classification of eating and non-eating. In conclusion, we found evidence that a recurrent neural network can learn day-level contextual patterns and utilize them for better eating episode detection. 
