## 2 Dataset and Proposed Model
### Method for Correction of Sensor Orientation  
Correction of orientation is required in EMG-based hand gesture recognition systems because a rotation of the sensor causes a shift in the sequence of features fed to a classifier. This shift can cause a significant reduction of the recognition accuracy. To illustrate this problem, let us assume that we have a very simple recognition system composed of only two modules: feature extraction and classification (Figure 6). This system takes as input EMGs of \(n\in\mathbb{Z}^{+}\) channels, where each channel is denoted by \(CH_{i}\), with \(i=1,2,...,n\), and returns a label \(y\) corresponding to the gesture performed. The feature extractor maps an EMG to a feature vector \(\mathbf{x}=(x_{1},x_{2},...,x_{n})\in\mathbb{R}^{n}\), where \(x_{i}=f(CH_{i})\), with \(i=1,2,...,n\). The classifier \(g\) returns a label \(y=g(x_{1},x_{2},...,x_{n})\). Note that the result of the classifier depends on the sequence with which the features are arranged in the vector \(\mathbf{x}\). If the EMG sensor is rotated, then \(x_{i}=f(CH_{j})\), with \(i,j=1,2,...,n\) and \(i\
eq j\), except for rotations of \(\pm 360\) degrees, thus causing a shift in the sequence of features fed to the classifier, a shift which in turn reduces the accuracy of the recognition system. Now, we describe the proposed algorithm for the correction of orientation. The aim of this algorithm is to correct, by software, the rotation of the EMG sensor by arranging its channels with respect to the channel with the highest energy, using a set of synchronization gestures. By default, we assume that the sequence in which the pods of the EMG sensor are arranged is \(S=0,1,...,7\). Given a set of synchronization gestures \(G_{sync}=\{\mathbf{E}_{1},\mathbf{E}_{2},...,\mathbf{E}_{m}\}\), where \(\mathbf{E}_{i}\in[-1,+1]^{k\times 8}\), with \(k\in\mathbb{Z}^{+}\) and \(i=1,2,...,m\), and the sequence \(S\), the algorithm for the correction of orientation consists of the following steps: \begin{table}
\begin{tabular}{c c c} \hline \hline
**Module** & **Hyper-Parameter** & **Value** \\ \hline Data acquisition & window size & 66 points \\ \hline Data acquisition & stride & 66 points \\ \hline Data acquisition & sub-windows length & 11 points \\ \hline Data acquisition & num sub-windows & 6 \\ \hline Pre-processing & low-pass filter order & 2 \\ \hline Pre-processing & low-pass filter cutoff frequency & 1 Hz \\ \hline Feature extraction & number of features & 68 \\ \hline Classification & ANN input & 68 units \\ \hline Classification & ANN hidden layer & 500 units, RELU \\ \hline Classification & ANN output layer & 6 classes, softmax \\ \hline Classification & Training algorithm &
\begin{tabular}{c} Conjugate Gradient descent \\ \(\lambda=10^{-5}\), 500 epochs \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of the hyper-parameters in the proposed hand gesture recognition model. Figure 6: Illustration of the importance of correction of sensor orientationFor each EMG \(\mathbf{E}_{i}\in G_{sync}\):  
1. Compute the envelope \(\widetilde{\mathbf{E}}_{i}\) of the EMG \(\mathbf{E}_{i}\). For this task, we first rectify the EMG by computing its absolute value and then filter the rectified EMG using a second-order Butterworth low-pass filter \(\Psi\), with a cutoff frequency of 10 Hz, thus obtaining the signal \(\widetilde{\mathbf{E}}_{i}=\Psi(abs(\mathbf{E}_{i}))\), where \(\widetilde{\mathbf{E}}_{i}\in[-1,+1]^{k\times 8}\) 2. Compute the vector of energies \(\mathbf{e}_{i}~{}=~{}(e_{i,1},e_{i,2},...,e_{i,8})\) for \(\widetilde{\mathbf{E}}_{i}\), where \(e_{i,j}\) denotes the energy of the \(j\)-th channel (i.e., column) of the signal \(\widetilde{\mathbf{E}}_{i}\), with \(j=1,2,...,8\). The value of \(e_{i,j}\) is computed by trapezoidal numerical integration of the squared values of the \(j\)-th column of \(\widetilde{\mathbf{E}}_{i}\). 3.