Optimizing Hand Gesture Pattern Recognition With Differential Evolution Algorithm

Artificial Neural Networks (ANN) have been applied to recognize patterns from surface electromyography (sEMG) signals for specific hand gestures. ANN approach is a promising strategy to control upper limb prostheses once the classification accuracy has been reaching remarkable and confident values. However, ANN have a high computational cost and high time response, which impairs applications in real time. Many efforts seek to optimize ANN to reduce complexity and processing cost. Algorithms like Differential Evolution (DE) are usually applied to multi-parameters optimization due to its simplicity and high efficiency. There are no reports about DE applied to ANN optimization for sEMG pattern recognition. Thus, this paper proposes a hybrid machine learning model (HML) in which the neural network architecture has low complexity, and its classification accuracy is enhanced by the Differential Evolution algorithm. As results, it is proved that the classification accuracy increases with the HML model and a pathway to DE applied to sEMG pattern recognition is


I. INTRODUCTION
Amputation of upper limb has one of the most complex rehabilitation processes due to more than 20 degrees of freedom (DoF) of the human hand [1]. Upper limb prostheses are certainly the first option to restore lost movements. There are several challenges being discussed since the 80's and many efforts have succeeded, like surface electromyography (sEMG) sequential control, which is now the most exploited method to control commercial prostheses. [2]. Nonetheless, these devices are far from reaching the natural way that human hands operate [3].
Despite the advances in computer sciences and signal processing, sEMG control presents problems like crosstalking and low signal-to-noise ratio (SNR), restraining simultaneous or multiple finger control and dexterous position with proportional control. These limitations add cognitive load to the amputee to operate the prostheses because they often need to train specific muscle contraction patterns to activate related movements using sequential control strategies including to press buttons and rotate prosthesis elements [4]. As results, the number of devices abandonment reaches alarming values all over the world and the users usually justify it by the difficult of controllability and the non-intuitive way to use the prosthesis [5].
A possibility to reduce the cognitive load and to turn the prosthesis control into a more intuitive process is the recognition of hand gestures by sEMG electrodes. This approach is based on machine learning (ML) algorithms and allows the control system to detect the movement intention according to the sEMG features related to specific gestures [6]. Moreover, cross-talking, and low SNR effects are reduced when compared to sequential control due to algorithm training and feature extraction. There are several ML classifiers being applied to hand gesture recognition like support vector machine (SVM), linear discriminant analysis (LDA) and artificial neural networks (ANN). However, to classify a great number of gestures, ANN is the standard model once it has feasible parameters to create deep learning models and to process big data [7].
Beyond the advancement of ANN to classify sEMG signals, [8] created the NinaPro database to promote research on hand gesture recognition and to improve classification accuracy by optimization algorithms. Since then, many research groups have been published accurate results. This way, the NinaPro database will be used as main inclusion criterion to summarize the state of the art of ML models and its usability to hand gesture pattern recognition. This criterion is necessary due to huge variability in sEMG data and due to influence of data quality in classification accuracy. Also, the higher the number of movements, the higher the classification complexity.
One attempt to enhance accuracy rates is to increase the number of hidden layers. However, adding hidden layers and neurons increases computational cost and processing time in a way that real-time applications are not feasible [9]. Thereby, there are many efforts to reduce complexity of ANN models without losing efficiency using optimization algorithms. These algorithms are mainly applied to determine hyperparameters and usually employ evolutionary strategies, generating hybrid ML models. Genetic Algorithms are generally used to optimize ANN hyperparameters [10,11] and feature extraction from sEMG signal [12] together with another ML models like SVM [13,14].
Despite promising results from AG, it also faces problems in terms of determining a great number of hyperparameters and high computational cost when compared to other evolutionary strategies like Differential Evolution (DE). It has low complexity, low computational cost and 3 main hyperparameters [15]. DE can be applied to ANN optimization [16], but there are no previous studies about DE and ML models applied to sEMG pattern recognition. Therefore, this paper proposes the application of Differential Evolution to optimize the synaptic weights and bias (Wb) of an ANN to classify sEMG signals.

II. METHODS
between -1 and 1. The values were updated by the training algorithm.
sEMG data from ten able-bodied subjects of the second Ninapro database (DB2) were used in this paper, 8 righthanded and 2 left-handed with no neuromuscular disorders. Ten movements listed in Table 1 were classified together with rest position. Experiments consisted of 6 repetitions for each movement, being each movement 5 seconds last and followed by 3 seconds of rest to avoid muscular fatigue. Four wireless active electrodes from Delsys were positioned respectively on the main activity spots of flexor and extensor digitorum, biceps, triceps and 8 ones were equally spaced around the forearm in correspondence to the radio humeral joint. The sEMG signal was sampled at 2 kHz. Fig. 1. illustrates the movements.

B. Artificial Neural Network (ANN)
From de sEMG signal were extracted windows of 200ms with 50% overlap and the following features: Root-Mean-Square (RMS), Time-Domain statistics (TD), Histogram (HIST) and marginal Discrete Wavelet Transform (mDWT). Data from 10 subjects and 4 features were allocated in an input feature matrix resulting in 372 input neurons for a feedforward backpropagation ANN with 3 tan-sigmoid hidden layers of 20, 30, 20 neurons respectively. Input data were divided into 70% for training, 15% for validation and 15% for testing with randomized selection. ANN output classified features into 11 classes of movements including rest. The decision of number of hidden layers and neurons is still a challenge and will not be object of optimization in this paper. So, the architecture of the ANN was determined by trial-and-error method, avoiding low performance and over fitting. Fig. 2 shows the architecture ANN details. Training algorithm was scaled conjugate gradient backpropagation and performance was analyzed by crossentropy loss function. Stopping criteria were configured to 1000 epochs, zero loss cross-entropy and 10 -6 gradient value.
As initial values, the ANN generated 8481 synaptic Wb

C. Differential Evolution (DE) and Artificial Neural
Network (ANN) Differential Evolution (DE) is a stochastic search method based on evolutionary concepts applied to populations of solutions for a complex problem. It produces new vector populations from an initial population that covers all the search space. Mutation generates new individuals by summation of weighted difference between two vectors to a third one or to a randomized combination of other two vectors. Scale Factor (F) is a real positive number that controls the rate at which the population evolves. Then resulting vectors are combined to others previously defined. This process is named crossover. The combined vectors are then tested in the fitness function and the stopping criteria are verified. If any criterion is attended a new cycle begins but the best vectors are selected to the new generation [17].
In this paper, DE is used to optimize the ANN performance, which means that the algorithm must reaches the global minimum of cross-entropy loss function by simulating the ANN. After running, DE generates optimized synaptic weights and biases which will be set to initial synaptic Wb for ANN training.
Initial population of DE consists of 50 vectors of randomized and normal distributed real values between -1 and 1. Each vector contains 8481 values. Crossover probability was set to 80% and Scale factor (F) was set to 10% for 20, 30 or 50 generations. Fig. 3 shows de block diagram of ANN+DE approach. Wb' is the new population created in each generation. Determination of Number of Generations (NG) is explained in the next session. Special attention must be given to the number of generations, since the tendency of DE algorithm is to provide uniform population during optimization. The higher the number of generations, the more uniform becomes the final population. This behavior is not efficient for initial values of synaptic weights of an ANN because the uniformity impairs the gradient dynamics, and the training algorithm needs more computational cost to update the Wb [17].
Moreover, the penalties applied in DE algorithm to maintain individuals inside the problem domains [-1, 1] generally turn the values out of boundaries into maximum or minimum values, in this case: -1 or 1. Also, the higher the number of generations, the higher the probability to set these values into the final population. Thus, with many biases' values in an initial population, the ANN learning may be skewed. Fig. 4. illustrates the ANN model, but for "a" the Initial Wb is created by the ANN configuration itself and for "b" (DE + ANN) the Optimal Wb is the result from Fig. 3. Thus, two ML models are compared: ANN model and a hybrid model (ED + ANN) for classifying sEMG data from 11 movements of Ninapro database 2 (DB2).

III. RESULTS
Results of DE algorithm will be reported before the comparison between ANN and ANN + DE to explain the decision about the number of generations for the evolutionary algorithm. As aforementioned, the DE operation decreases the variability of the population along the generations. Thus, analysis of the evolution of fitness value is not the only necessary parameter to define the number of generations. Fig.  5 shows the evolution of the fitness function for three numbers of generations: 20 (G20), 30 (G30) and 50 (G50). The fitness value represents the cross-entropy loss. The final value for each Ng is the initial performance value for the ANN training. Analyzing Fig.5 it is possible to assert that 20 and 50 generations have the best performances. Otherwise, to determine which Ng produces the population with better accuracy for the ANN it is needed to test the three possibilities for the neural network. Fig. 6 Brings the performance results for training the ANN with Wb from 20, 30 and 50 generations. By the Fig. 6 it can be assumed that 20 generations provide the best scenario. It is important to note that 20 and 50 generations reached the same fitness value, which means that the ANN training started with the same performance value. Nonetheless, during the ANN training the evolution of performance is more efficient for 20 generations. Other interesting fact is that for 30 generations de Differential Evolution produced the worst fitness result, however for the ANN training the resulting population showed a better performance compared to 50 generation's one.
With the optimized Wb initial population ("b"), it is possible to compare its accuracy in an ANN with the accuracy of a randomized Wb population ("a"). Fig. 7 illustrates results from confusion matrix for the two methods. Fig. 7. Results from confusion matrix for two models. From Fig. 7 is possible to say that the hybrid model increased the mean classification accuracy. Fig. 8. details the classification accuracy for each movement. For ten classes the HM presents better accuracy, except for Class 7, which represents Pointing index movement.

IV. DISCUSSION
Our study showed that Differential Evolution is feasible to optimize the synaptic Wb of an ANN to classify sEMG signals. Results confirm that de HM can increase the accuracy in most of movements. However, there is a need to investigate the influence of different hyperparameters in addition to synaptic weights like number of hidden layers and neurons and training algorithms. The proposed hybrid model ensures that the initial Wb population is optimized. This optimization reduces computational cost to ANN training once the initial performance is equal to the minimum cross-entropy loss reached by DE algorithm. In real life applications the training procedure to learn to use new prostheses is known to be tough and may need several repetitions. To ensure an optimized initial population for synaptic weights and bias may decrease the number of repetitions and the training time including a better classification accuracy [18].
The hybrid model proposed in our work had an overall accuracy of 80.7%. In other study the researchers reached a classification accuracy of 75.32% for all 50 movements for Database 1 (DB1) and 75.27% for Database 2 (DB2) with Random Forests model. For amputated subjects (DB3) the highest average for 50 movements was 46.27% [8]. Beyond the advance of Artificial Neural Networks, research find the classification accuracy for many movements as 78.9% for DB1 and 76.1% for DB2 by a Deep Convolutional Neural Network with 8 hidden layers [19]. Previous study modeled an ANN with 3 hidden layers with 512, 256, 256 fully connected neurons to classify 41 hand and wrist movements and reached overall accuracy of 93.87 ± 1.49 for DB5 and 91.69 ± 4.68% for DB7, with a balanced accuracy of 84.00 ± 3.40 and 84.66 ± 4.78% respectively [20].
Other papers described high accuracy compared to HML model [19,20], however it is important to note that the architecture tested in this work presents very low complexity, with only 3 hidden layers and 70 total hidden neurons. Also, data from only 10 subjects were used. DB2 consists of 40 subjects. The main reason for this choice is to simulate few data scenarios. Authors had optimized Multilayer Perceptron hyperparameters using Genetic Algorithm and reached more than 90 % of accuracy in some classes, but only for 6 movements from a dataset developed exclusively for the work [21].
The hybrid model developed possesses a great number of classes, a simple architecture, and a low complexity optimization algorithm, which indicates promising results. In addition, there are no previous studies using this model in sEMG pattern recognition problem. Certainly, there are several strategies to be tested in order to increase the classification accuracy, like different topologies and other optimization objects. There are different possibilities to change ANN hyperparameters like the number of hidden layers and neurons in each layer, learning rate and training algorithm. Moreover, the extracted features from sEMG signal can be optimized to reduce data dimensionality. There is a large field in sEMG to explore Differential Evolution because the tendency of optimization problems may rely on hybrid, simple and low computational cost algorithms. Moreover, they have great potential for real time application and possibilities to reach promising accuracy results.

V. CONCLUSION
The results confirmed an increase in mean overall classification accuracy using the hybrid model. Only one class reached greater accuracy for ANN model. This study paves the way to Differential Evolution applied to sEMG pattern recognition with simple architecture ANN. Also, there are many hyperparameters to be investigated to enhance hand gesture recognition, mainly the number of hidden layers and neurons in each layer.