## 3 Acquisition of Raw Data
### Data Processing
The frame boundaries are indicated by two adjacent dashed red vertical lines. We then apply drop-out technique over all the frames or segments of the signal to search for informative frames containing the swallowing peak and to remove the noisy frames. Frames are selected or dropped out based on the swallowing peak. Frames containing the swallowing event peak are moved backward or forward to capture the preceding sequence of chewing events through which the food was transformed into a bolus. Food in the form of a viscous bolus is the final state prior to swallow stage. It has been observed that users do not enter extra food into mouth until swallowing the bolus; thus, chewing and swallowing events of the same intake cycle are associated with same food category. Thus, the frames contain 23 chewing samples (pre-swallow samples) and six post-swallow samples in order to cover the complete intake cycle. The noisy and uninformative frames are discarded, as depicted by the dropped-out section in Figure 6a. [PERSON] et al. used a long sample window for data representation and spectrogram generation [11], but failed to extract distinct statistical features for food classification. The data processing technique of our algorithm is compared with theirs in Figure 6. As discussed in Section 6.1, their algorithm is much less accurate than ours for food classification because the authors selected a long pattern of chewing, which obscured solid swallows, especially. Moreover, they applied STFT to the collected data, which further complicated the data and led to the extraction of indistinct statistical features. The authors built a predictive model based on those inefficient features. However, they did capture swallowing peaks well, which may be advantageous to people with eating disorders. Figure 5: This figure demonstrates the impact of the window length over the classifiers’ performance. The 30-sample (1.5-s) window is most suitable as evaluated on the performance of the classifiers. We have positioned the swallow at the 4/5 of the frame length because this allows the window to cover the prior chewing pattern along with each succeeding swallow, in contrast to other positions of swallowing in the window. When swallowing is positioned elsewhere in the window, the waveforms of other processes are included, such as breathing, which always follows swallowing [33]. For both 20- and 30-sample frames, the best classification performance is achieved when swallowing is positioned towards the end of the frame. The general trend in Table 2 illustrates that the recognition performances of k-NN, random forest, and SVM increase when more chewing samples are included in the frame. This indicates that the chewing portion includes important information for classification. Therefore, in this assessment, we have obtained the best performance by using the random forest for a 30-sample frame with swallowing positioned at the 4/5 of the frame length. Frames of 30 samples perform slightly better than frames of 20 samples. Thus, we have chosen 30-sample frames after exploring both 20- and 30-sample frames with different swallowing positions in order to find the optimal raw signal for effective feature extraction. The results are given in Table 2.  
As shown in Figure 4, the waveform after swallowing becomes flat during the breathing or silent phase, which is undetectable by the employed piezoelectric sensor, and lowers the accuracy of the system if it is included in the sample window (i.e., when the position of swallowing in the window is changed). Swallow positioning at the end of the window, in addition to performing well also agrees with the generalization assumption of [7], in which each swallow was combined with the preceding chewing pattern to form one intake