This section presents and analyzes the results obtained from the multiple stages of the methodology.
5.1. Feature selection
Table 5 shows the characteristics the GA selected from 104 predictors. In total, 55 features were selected and used as inputs in an MLP to classify the data and select the hyperparameters, representing a 47% reduction in features. Achieving a final classification percentage of 93%.
Table 5.
Features selected as the best subset of characteristics for classifying signals.
Table 5.
Features selected as the best subset of characteristics for classifying signals.
| Acronym |
Channel |
| AAC |
1 and 2 |
| IEMG |
All |
| MAV |
1, 2 and 4 |
| MAVSLP |
1 and 4 |
| MMAV1 |
All |
| VAR |
1, 2 and 4 |
| FC |
1, 2 and 4 |
| K |
1,2 and 4 |
| Y3 |
1 |
| MYOP |
1, 3 and 4 |
| AAV |
2 and 4 |
| DASDV |
2 and 4 |
| LOG |
2 and 3 |
| MMAV2 |
2 and 3 |
| SSC |
2 |
| SSI |
2, 3 and 4 |
| STD |
2, 3 and 4 |
| WL |
2, 4 |
| ZC |
2, 3 and 4 |
| MAD |
2, 3 and 4 |
| WAMP |
2, 3 and 4 |
| SE |
3 |
| SK |
3 and 4 |
| RMS |
4 |
| Y4 |
4 |
| Y5 |
4 |
As shown in
Figure 3 initially, the feature selection process had an error rate of 14%. The genetic algorithm improves performance during the first iterations and reduces errors to 11%. However, it stalls at a 10% error for 8 iterations and an 8% error for 12 iterations. This deadlock occurs when existing candidate solutions have already explored most of the search space and new feature combinations that significantly improve performance are not found. At this point, the genetic algorithm get stuck in a local minimum. This deadlock is overcome by implementing the mutate operation. In this case, it is possible that during the 10% error plateau period, some mutation introduced in a later iteration led to exploring a new combination of features that improved performance. This new solution could have been selected and propagated in the following generations, finally allowing it to reach a classification value of 93%.
Figure 3.
Reduction of the classification error due to the selection of features through GA.
Figure 3.
Reduction of the classification error due to the selection of features through GA.
In order to ensure that the feature selection process is carried out correctly and that only predictors that allow a high classification were selected, a sensitivity analysis was carried out. In
Figure 4, the bar graph is shown where the percentages of decrease or increase in precision are observed concerning the classification obtained at the end of the character selection stage, which was 93%.
Figure 4.
Sensitivity analysis of classification reduction percentages by predictor.
Figure 4.
Sensitivity analysis of classification reduction percentages by predictor.
It is observed that feature number 18, which corresponds to the mean absolute value type 1 of channel 2, has the lowest percentage decrease in classification when eliminated. On the other hand, the characteristics with the most significant contribution are the absolute value of the fifth moment channel 4, integrated EMG channel 1, and modified mean value type 1 channel 1. When comparing the characteristics that present a more significant contribution against those of lesser contribution, it is seen that type 1 modified mean value appears in both limits. The difference occurs in the channel from which the characteristic is extracted. Therefore, the exact predictor can have more or less importance in the classification depending on the muscle from which it is extracted.
5.2. Hyperparameter selection
As shown in
Figure 5 in the GWO implementation process, there is an error rate of 14% with the initial values proposed for the hyperparameters. This indicates that the initial solutions have yet to find the best set for the problem since, prior to the selection of hyperparameters, there is a classification percentage of 93%, and it is sought that the efficiency after the hyperparameter adjustment process is more significant or equal to the previous phase.
In iteration 4, a reduction in error to 7% is observed. The proposed solutions have found a hyperparameter configuration that improves model performance and reduces error. During subsequent iterations, they continue to adjust their positions and explore the search space for better solutions. As observed during iterations 5 to 20, a deadlock is generated. However, later it is observed that the error drops to 3%, which indicates that the GWO has managed to overcome this impasse and find a solution that considerably improves the classification.
A possible reason why the GWO managed to get out of the deadlock and reduce the error may be related to the intensification and diversification of the search. During the first few iterations, the GWO may have been in an intensification phase, focusing on exploiting promising regions of the search space based on the positions of the pack leaders. However, after a while, the GWO may have moved into a diversification phase, where the gray wolves explored new regions of the search space, allowing them to find a better solution and reduce the error to 3%.
Figure 5.
Reduction of the error due to the selection of hyperparameters by GWO.
Figure 5.
Reduction of the error due to the selection of hyperparameters by GWO.
Table 6 shows the values obtained for the MLP hyperparameters using GWO, achieving a classification in the validation stage of 97%. When comparing the values implemented in the feature layer, it stands out that the number of hidden layers was reduced from 4 to 2. On the other hand, the total number of neurons was reduced from 600 to 409. However, epochs increased from 10 to 33 after hyperparameter selection. This indicates that the model required more opportunities to adjust the weights and improve its performance on the training data set. Similarly, the mini-batch size has been increased from 20 to 58, indicating that it needs more information during each training stage to adjust the weights.
Finally, the learning rate increased from 0.0001 to 0.002237, which showed that the neural network learned faster during training. The results indicate that the selection of hyperparameters improved the efficiency of the model by reducing its complexity without compromising its classification ability.
Table 6.
Hyperparameters selected as the best subset for classifying signals given by GWO.
Table 6.
Hyperparameters selected as the best subset for classifying signals given by GWO.
| Name |
value |
| Hidden neurons layer 1 |
204 |
| Hidden neurons layer 2 |
205 |
| Epochs |
33 |
| Mini-batch size |
58 |
| Learning rate |
0.00223750 |
Figure 6 shows the error reduction in selecting hyperparameters by PSO. The best initial proposal achieves a 13% error. After this, there is a stage where the error percentage is kept constant until iteration 6. From there, the error is reduced to 8%. Once this error is reached, it remains constant until iteration 27. Once iteration 28 enters, an error of 7% is achieved, representing only a 1% improvement. This 1% improvement is not a significant increase and could be attributed to slight variations in MLP training weights.
Figure 6.
Reduction of the error due to the selection of hyperparameters by PSO.
Figure 6.
Reduction of the error due to the selection of hyperparameters by PSO.
On the other hand,
Table 7 shows the calculated values of the MLP hyperparameters through PSO; the precision achieved is less than that achieved by GWO, being 93%. Despite them, a 50% reduction in hidden layers is also achieved, and it manages to maintain the precision percentage obtained in the feature selection stage with fewer neurons than those achieved by GWO, being 359. However, similarly to the values obtained by GWO, epochs increased to 38. Similarly, the mini-batch size was increased from 50. Finally, the learning rate increased from 0.0001 to 0.0010184. This smaller amount of information used for training and the smaller learning steps, and the smaller number of neurons justifies the 4% decrease in the classification.
Table 7.
Hyperparameters selected as the best subset for classifying signals given by PSO.
Table 7.
Hyperparameters selected as the best subset for classifying signals given by PSO.
| Name |
value |
| Hidden neurons layer 1 |
155 |
| Hidden neurons layer 2 |
204 |
| Epochs |
38 |
| Mini-batch size |
46 |
| Learning rate |
0.0010184 |
When comparing
Figure 5 and
Figure 6, it is observed that both start with error values close to 15%, and after the first iterations, it has an improvement close to 50%, achieving an error close to 8%. Hence both algorithms have a period of stagnation from which GWO get superior by getting a second improvement of 50% achieving errors of 3%. On the other hand, even though visually PSO managed to get out of stagnation, it only managed to reduce the error to 1%, which does not represent a significant improvement and can be attributed to variations within the MLP parameters such as weights and not to the selection of hyperparameters.
5.3. Validation
After selecting characteristics and hyperparameters, the rest of the ten that comprise the database were used to validate the results obtained since this information had never been used before.
Figure 7 shows the graphs of the error in the training stage (60% of the data corresponding to 9 of 10 people, equivalent to 600 data to be classified), the test stage (40% of the data corresponding to 9 out of 10 people, equivalent to 200 data to classify) and validation stage that corresponds to data from the tenth person (equivalent to 100 data). It is noted that the data to be classified is formed from the number of people ×, the number of movements × the number of repetitions.
Figure 7.
The error in training, testing, and validating a model using a) GWO hyperparameters and b) PSO hyperparameter.
Figure 7.
The error in training, testing, and validating a model using a) GWO hyperparameters and b) PSO hyperparameter.
Additionally, these graphs allow us to verify the overfitting in the model. The training, test, and validation errors were plotted in each epoch. If the training error decreases while the test and validation errors increase, this suggests the presence of overfitting. However, the results indicated that the errors decreased evenly across the three stages, suggesting that the model generalize and classify accurately without overfitting. In addition, the percentage for the hyperparameter values given by GWO only decreased by approximately 4% for new input data, reaching 93% accuracy. While for PSO, 3% was lost in the classification, achieving a final average close to 90%.