## 3 Acquisition of Raw Data
### Data Processing  
The signal generated by the necklace is denoised to remove noisy data and to retain important ingestion events. It is important to clean the sensor signal prior to feature extraction and the development of the statistical model. Prior researchers [9; 14; 17] segmented the ingestion activity into three sequential phases: oral food preparation phase (food is chewed and turned into a viscous bolus), pharyngeal phase (bolus traveling through the pharynx and upper esophageal sphincter), and the esophageal phase (bolus enters the stomach via the esophagus). We combined the esophageal and pharyngeal phases to denote swallowing, and the oral preparation phase to represent chewing. The main objective is to obtain the signals representing the users' eating patterns for different foods. When food enters the mouth, different oral receptors are activated and carry sensory information about material properties to the brain. The most important stimuli are related to food texture (crispness, hardness, dryness, size, and shape) and flavor. The users continuously adjust these stimuli to efficiently break food into a bolus that can easily be swallowed. We have applied an equal weight to both actions: chewing and swallowing. As shown in Figure 4, the series of minor peaks represent chewing patterns and the major peaks with large amplitude represent swallowing patterns. It is observed while ingesting different foods that users exert different amounts of force during each attempt at food breakdown because foods vary in hardness, crispiness, and texture. Thus, the forces exerted to breakdown foods with different levels of hardness generate distinct chewing patterns prior to each swallow. By exploiting the distinct ingestion patterns for foods with different textures, a series of chewing events are combined with a swallowing event, which forms data of ingestion patterns. In contrast to [10; 11], we employ frames to borderline the desired ingestion pattern, ultimately enabling the efficient extraction of the efficient discriminating features. The frames enclosed in rectangular boxes are shown in Figure 4b. The proper window length for the samples and a suitable swallowing position in the frame should be chosen for each frame representation of the raw data, so that the features can be extracted successfully, and an efficient and accurate model can be built. The raw signals represent the chewing and swallowing patterns for different foods. The acquired sensor signal is preprocessed to capture useful information from an event and thus to classify it correctly. Similar to the naive window selection method of [10], our method employs different non-overlapping window lengths to process the raw sensor signals and divide the signals into frames. An optimal window length was selected based on the performance of the classifier. As shown in Figure 5, window lengths of 20 samples (1 s) and 30 samples (1.5 s) are most suitable, based on an accuracy comparison of the models over different windows of samples. Previous research [13] has also indicated that a window length of 1 s (corresponding to 20 samples) is suitable for the correct classification of eating patterns from a piezoelectric sensor. However, we have selected a window length of 1.5 s (30 samples) because of its slightly higher classifier performance. Four to five samples are used to represent a swallowing event, but a suitable count of samples are required to denote the chewing sequence; as the number of samples is important for the representation of the ingestion events and can affect the performance of the model if the number of samples in a window is too large or too small. The window of 30 samples (1.5 s) almost agrees with published data indicating that 500 ms is a sufficient window length to represent chewing strokes [32], and that 20 samples are adequate to represent chewing and swallowing [3; 13] for food classification. The resulting frame for the signal after multiplication is shown in Figure 6a.