# Gesture Recognition of Sign Language Alphabet Using a Magnetic Positioning System
## 2 Materials and Methods
### Machine Learning Algorithm
#### 2.3.1 Support Vector Machine  
Our goal was to develop a machine learning model capable of recognizing the 24 static letters from the ASL alphabet. The letters J and Z are not considered, since they are associated with dynamic gestures. The model takes as input the coordinates of finger joints obtained by using the magnetic positioning system, as described in detail in Sections 2.1 and 2.2. The output of the model is the class that best represents the input vector, and each letter is assigned to one class. Among all the machine learning algorithms suitable for classification purposes, we decided to use Support Vector Machine (SVM). Before choosing SVM, we considered a set of classification algorithms including k-nearest neighbors, logistic regression and others, but the one that gave us the best results was SVM with Gaussian kernel.  
SVM is a supervised machine learning binary classifier that aims to find the parameters of the hyperplane that best separates the data into two classes [45]. To train the SVM, an optimization problem is solved. Specifically, given a training set of \(n\) samples \((\mathbf{x}_{i},y_{i})\) with \(i=1,\ldots,n\), where \(\mathbf{x}_{i}\) is in general a multi-dimensional input vector and \(y_{i}\) is a scalar, which can be either \(-1\) or \(1\), the optimization problem can be formulated as follows [46]  
\[\operatorname*{arg\,min}_{(\beta,\beta_{0})}\left(\frac{1}{n}\sum_{i=1}^{n} \max\{0,1-y_{i}(\mathbf{\beta}^{T}\varphi(\mathbf{x}_{i})+\beta_{0})\}+\lambda\|\mathbf{ \beta}\|_{2}^{2}\right), \tag{7}\]  
where \((\mathbf{\beta},\beta_{0})\) is the set of parameters that identifies the hyperplane: in a \(k\)-dimensional space, \(\mathbf{\beta}\) is a \(k\)-dimensional vector and \(\beta_{0}\) is a scalar that represents the intercept. The symbol \(\|\cdot\|_{2}\) denotes the \(L2\)-norm operator and \(\lambda\) is a tuning parameter. The regularization term \(\lambda\|\mathbf{\beta}\|_{2}^{2}\) forces the solution to be unique and avoids overfitting on training data. The nonlinear mapping function \(\varphi(\cdot)\) is defined by using the Gaussian kernel \(K(\mathbf{x}_{i},\mathbf{x}_{j})\triangleq\varphi^{T}(\mathbf{x}_{i})\varphi(\mathbf{x}_{j})= e^{-\|\mathbf{x}_{i}-\mathbf{x}_{j}\|^{2}/2\theta^{2}}\), where \(\delta\) is a tuning parameter [47; 48; 49]. The optimization problem Equation (7) is convex; therefore, it can be efficiently solved using a numerical solver.  
The SVM is not intended for binary classification only. Even if the initial formulation was intended for binary classification, every classifier that performs binary classification can be extended to multiclass classification by using one of the approaches between One versus One (OvO) or One versus All (OvA). If \(c\) is the number of classes, with OvA, the multiclass problem is reduced to \(c\) binary problems, one for every class: each class is compared to all the others put together. Classification of a new vector is performed by applying the vector to the \(c\) classifiers and by assigning it to the most likely class. The problem is that there are cases where multiclass linearly separable points are not linearly separable with an OvA approach. In these cases, the OvO approach can be used. This approach consists of building a collection of \(c(c-1)/2\) binary classifiers, one for each non-ordered pair of classes. Classification of a new sample is performed with a majority mechanism: decisions of all the binary classifiers are evaluated and the sample is assigned to the class that wins the most. In case of a tie, the class is chosen at random. If a set of multiclass data are linearly separable, the OvO approach can always be used. As far as computational cost is concerned, OvO requires a significantly higher number of classifiers, but each classifier is trained with samples that come only from two classes. In this paper, we used an OvO approach.