\counterwithin{table}{section}
\counterwithin{equation}{section}

\section{Normalization Methods for Windowed Model}

Early experiments for this work also examined the effect of various normalization methods for the raw wrist motion data on the windowed eating model~\cite{sharma2020} performance. Normalization methods tested included $z$-score standardization, min-max normalization, quantile normalization, and mean normalization. Normalization was performed per-axis. Additionally, variants of $z$-score standardization were tested including global standardization and per-file standardization. Because of the widely varying distribution of values and some extreme outliers, alternative minimum and maximum values were used for min-max normalization and mean normalization. The histograms shown in figure \ref{fig:appendix-histograms} on page \pageref{fig:appendix-histograms} give insight into how the modified values for the means and standard deviations were chosen. The exact values chosen are shown with the results in table \ref{tab:normalization-training-results}.

The equation for calculating each new value $x^{\prime}$ with $z$-score standardization is shown in equation \ref{eqn:z-score}, where $x$ is the original value and $\mu$ and $\sigma$ are the mean and standard deviation of the original values respectively. Similarly, equation \ref{eqn:min-max-norm} shows the equation for min-max normalization where min and max are the minimum and maximum of the original values respectively. Equation \ref{eqn:mean-norm} displays the formula for computing mean normalized values. And lastly, quantile normalization is a way of making two distributions have identical statistical properties. The \verb|QuantileTransformer| function from the \verb|preprocessing| module of the \verb|sklearn| library was used to accomplish this in this experiment.
\begin{equation}
\label{eqn:z-score}
x^{\prime} = \frac{x - \mu}{\sigma}
\end{equation}
\begin{equation}
\label{eqn:min-max-norm}
x^{\prime} = \frac{x - \text{min}}{\text{max} - \text{min}}
\end{equation}
\begin{equation}
\label{eqn:mean-norm}
x^{\prime} = \frac{x - \mu}{\text{max} - \text{min}}
\end{equation}
The best training accuracy with each method and the loss at the end of training is shown in table \ref{tab:normalization-training-results}. These specific methods and values were chosen based on other experiments to find the best values for each normalization method. Overall, global $z$-score standardization yielded the best training accuracy and lowest training loss.

It is important to recognize that these are \textit{training} metrics and this is a limitation of this preliminary investigation. Only select normalization methods were evaluated completely. The time and episode evaluation metrics computed for these select few normalization methods showed a standard deviation of only around 1\%. As a result of this limited experiment, $z$-score standardization was chosen as the the default normalization method.

\begin{table}
\centering
\renewcommand\arraystretch{1.5}
\begin{tabular}{|l|c|c|c|}
\hline
\rowcolor[HTML]{EFEFEF} 
\textbf{Method}                    & \textbf{\begin{tabular}[c]{@{}c@{}}Best Training\\ Accuracy\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Best Training\\ Epoch\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Training Loss\\ After 30 Epochs\end{tabular}} \\ \hline
Global standardization             & 82.6\%                                                                    & 28                                                                     & 0.42                                                                             \\ \hline
File standardization               & 82.5\%                                                                    & 29                                                                     & 0.43                                                                             \\ \hline
Quantile normalization (n = 10000) & 81.7\%                                                                    & 29                                                                     & 0.43                                                                             \\ \hline
Mean normalization ($\pm$0.15, $\pm$50)    & 81.5\%                                                                    & 29                                                                     & 0.44                                                                             \\ \hline
Min-max normalization ($\pm$0.15, $\pm$20) & 77.7\%                                                                    & 30                                                                     & 0.49                                                                             \\ \hline
\end{tabular}
\caption{Training results for various normalization methods. Numbers with $\pm$ indicate minimum and maximum values used for accelerometer and gyroscope axes in order of appearance.}
\label{tab:normalization-training-results}
\end{table}

\begin{figure}
\centering
\begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/x_hist.eps}
  \end{subfigure}
  \begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/yaw_hist.eps}
  \end{subfigure}
  \\[10pt]
    \begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/y_hist.eps}
  \end{subfigure}
    \begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/pitch_hist.eps}
  \end{subfigure}
  \\[10pt]
\begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/z_hist.eps}
  \end{subfigure}
  \begin{subfigure}{0.475\textwidth}
    	\includegraphics[width=\textwidth]{img/roll_hist.eps}
  \end{subfigure}
\caption{Histograms of all values for each of the 6 axes of wrist motion data after acceleration trend filter was applied, $N = 100$.}
\label{fig:appendix-histograms}
\end{figure}
