# EMG-Driven Shared Control Architecture for Human-Robot Co-Manipulation Tasks +
## 3 Results
### Training and Test of the Classifier  
As outlined in Section 2.3.1, the SVM classifier requires distinct datasets for training and testing. For each of the participants, a training set and a test set are acquired in two separate, sequential sessions conducted on the same day. This approach ensures a fair evaluation of the classifier's performance on unseen data while minimizing variability caused by significant sensor displacement, as the electrodes are not detached between sessions.  
The data acquisition protocol is designed to capture clear and representative signals for the three target classes (_free_, _contraction_, and _up_) by using two different robot behaviors. For the _free_ class, the manipulator is set to a low-impedance, compliant mode, making it lightweight and easy to move. Operators are instructed to guide the end-effector for 5-second intervals in six directions (forward, backward, left, right, up, and down), while keeping their hand relaxed on the handle to avoid unintentional muscle contractions. For the _contraction_ and _up_ classes, the robot is rigid: this behavior is obtained by referring to a standard position controller and is used to gather data regarding the _contraction_ (by tightening the hand on the end-effector handle for 5 s), and _up_ (by pushing the end-effector upwards for 5 s) classes. Each action is followed by a 5-s rest period to prevent muscle fatigue and to create a clear separation between classes. For each training and test acquisition, the low-impedance phase lasted approximately three minutes, while the high-impedance phase lasted about one minute.  
Both the training and test datasets obtained with the aforementioned acquisition procedure are processed by extracting the time domain features listed in Section 2.3.1 using Python for the classifier training. These three features are extracted for each of the four EMG sensors and transformed into a feature vector of 12 elements with an associated label class needed to train the classifier. The SVM model is trained using the hyperparameters in Table 1, and the classifier performance is evaluated using a confusion matrix for multi-class problems and class-wise metrics as _A_ccuracy, _P_recision, _R_ecall, and \(F\)1-score. Specifically, the confusion matrix rows represent the expected class distribution, while the columns represent the predicted distribution by the classifier. The _A_ccuracy, _P_recision, _R_ecall, and \(F\)1-score can be calculated for each class by converting the matrix to a one-vs-all  
Figure 3: The scenario shows the experimental setup in which a human operator performs a co-manipulation task using a Jaco2 manipulator. On the dominant arm of the human operator, four Delsys Trigno Avanti EMG sensors are placed on the biceps and triceps brachii, flexor carpi radialis and extensor carpi unnaris muscles.  
matrix (to compute the performance index for binary classification) and computing the following indexes:  
\[A=\frac{TP}{TP+TN+FP+FN} \tag{16}\] \[P=\frac{TP}{TP+FP}\] (17) \[R=\frac{TP}{TP+FN}\] (18) \[F1=\frac{TP}{TP+\frac{FN+FP}{2}}, \tag{19}\]  
where \(TP\), \(TN\), \(FP\) and \(FN\) are true positives/negatives and false positives/negatives taken from the binary problem confusion matrix, respectively, i.e., true positives and negatives represent the number of times the classifier correctly identified the positive/negative classes, while false positives and negatives are the values that were classified incorrectly. The accuracy measures how many instances were correctly classified, the precision measures the accuracy of the positive predictions, the recall is the ratio of positive instances that are correctly detected, and the F1 score is the harmonic mean of precision and recall. Then, global indexes are computed as the mean value of the performance indexes for each class.  
In the online use of the classifier, the statistical mode of the predicted classes calculated over the last 1.5 s is sent to the finite state machine to increase the robustness in terms of misclassifications.