## 3 Proprioceptive Sensing
### Feature Selection  
In a classification problem, plenty of features can be thought of and used for training. Features can be raw data signals, or a combination of raw signals, signal statistics and so on. However, only a small amount of the available feature set may be actually relevant to address the classification problem. The selection of the \"most significant features\" can be tackled in different ways, i.e., as an optimization or a search problem [34]. Those techniques can find a local or global optimum feature set but could be also computationally expensive. The method proposed in this work has a low computational cost, since the number of its iterations equals the total number of features in the initial feature space. For the purpose of this work the initial feature space is made up of 15 features and 4 statistics per feature, for a total number of 60 statistical features. The feature selection method needs as input the labelled initial feature space, the value of a validity index (VI) associated with each statistical feature and a classifier to be iteratively trained. The VIs employed in this research were the _WB_ index and the _PC_ index. The classification algorithm is a linear Support Vector Machine (SVM), one of the most adopted techniques for terrain classification problem [18], which guarantees good results with a lower computational effort compared with other techniques such as Convolutional Neural Networks [35]. The feature selection algorithm is described by the following pseudo-code:  
1. **INPUT**: initial feature set (_Ifs_), VI vector associated with features _VIv_
2. **arrange**_IFs_ features in decreasing order of _VIv_
3. **initialize**_(F1 score)\({}_{i-1}\)_ = 60%, **initialize** reduced feature set (_RFs_) as an empty set
4. **for**_i_ **from** 1 to (_number of features_)
5. **add** the \(i\) feature from _IFs_ to the _RFs_
6. **train**_n_ times the classifier, **compute** average (_F1 score)\({}_{i}\)
7. **if**_(F1 score)\({}_{i}-\)_(F1 score)\({}_{i-1}\)_ \(\leq\)_(F1 threshold)_
8. **remove**_i_ feature from _RFs_
9. **end if**
10. **update**_(F1 score)\({}_{i}\)_ = (F1 score)\({}_{i-1}\)
11. **end for**
12. **OUTPUT**: _RFs_  
At each iteration step, a feature is added to the training set and the algorithm verifies if this new feature leads to a significant increase in the classifier performance. The metric used to quantify the classifier performance is the F1 score. In this work the F1 score percentage improvement threshold  
Figure 4: _PC_ index values for each feature (F1 to F15), for each statistic (S1 to S4, respectively, mean, variance, skewness and kurtosis) and for terrain (**a**) and slippage (**b**) classifier. for a feature to be accepted has been set to 0.5%. The training phase is repeated three times for each feature (\(n=3\)) and an average F1 score of the three trained classifiers is computed. The output of the algorithm is a reduced feature set, including the only features that bring a significant improvement in the classifier performance. The algorithm has been tested both with the PC index and the reciprocal of \(WB\) index (\(WB^{-1}\)), which allows the first selected features to be potentially the most suitable for the classifier. Figure 5 shows the algorithm results in terms of F1 score for each iteration and for the terrain (above) and slippage (below) classifier. If the performance increase, the new feature is added to the \"optimal\" or reduced feature set (RFs). It is apparent how the most relevant features are found in the first half of the iterations, where both PC and \(WB^{-1}\) have higher values. This figure shows that the chosen validity indices are effective for the selection of relevant features. Tables 4 and 5 show the F1 score and the number of selected features for the terrain classifier and for different feature selection methods. \(PC\) and \(WB\) indicate the feature selection method that uses the singular VI, as described before.