# A Novel PSO-Based Optimized Lightweight Convolution Neural Network for Movements Recognizing from Multichannel Surface Electromyogram

Authors: Xiu Kan; Dan Yang; Le Cao; Huisheng Shu; Yuanyuan Li; Wei Yao; Xiafeng Zhang
Journal: Complexity
 (2020)

---

## Abstract

As the medium of human-computer interaction, it is crucial to correctly and quickly interpret the motion information of surface electromyography (sEMG). Deep learning can recognize a variety of sEMG actions by end-to-end training. However, most of the existing deep learning approaches have complex structures and numerous parameters, which make the network optimization problem difficult to realize. In this paper, a novel PSO-based optimized lightweight convolution neural network (PLCNN) is designed to improve the accuracy and optimize the model with applications in sEMG signal movement recognition. With the purpose of reducing the structural complexity of the deep neural network, the designed convolution neural network model is mainly composed of three convolution layers and two full connection layers. Meanwhile, the particle swarm optimization (PSO) is used to optimize hyperparameters and improve the autoadaptive ability of the designed sEMG pattern recognition model. To further indicate the potential application, three experiments are designed according to the progressive process of body movements with respect to the Ninapro standard data set. Experiment results demonstrate that the proposed PLCNN recognition method is superior to the four other popular classification methods.


---

## Body

## 1. Introduction

Human-computer interaction is one of the most popular topics in the field of signal processing. Detecting and judging the behavior intention leads to information communication between human and computer. Generally, physiological signals and RGB images are two mainstream pieces of information to capture human activities [1–5]. The recognition of physiological-signals-based body movements is the key to human-computer interaction [6–8], due to the problems of the image, such as occlusion by the environment, inability to be distinguished accurately, and difficulty in being segmented. In particular, as a physiological signal of the human body, sEMG is a complex electrical signal produced by muscle contraction and relaxation, which carries the movement information of corresponding parts. Decoding sEMG to recognize human behavior characteristics is called sEMG pattern recognition [9, 10]. Therefore, the machine is capable of representing the human movement intention; moreover, it is the popular research frontier in the field of human-computer interaction.sEMG pattern recognition consists of the following three parts: signal preprocessing, feature extraction, and feature classification. Signal preprocessing involves filtering, denoising, and detecting active segments, etc. [11]. Feature extraction includes the following four aspects: time domain, frequency domain, time-frequency domain, and nonlinear dynamics; see [12, 13]. The papers [14–17] adopt different improved methods combining time domain and time-frequency domain to extract representative features of EMG. After the sEMG feature is extracted, it is sent to the classifier for training. Generally, traditional machine learning algorithms such as support vector machine (SVM), random forest (RF), and k-nearest neighbour (KNN) are used in previous research. Particularly, sEMG is identified by changing the rejudgment condition of SVM’s misclassification data in [18, 19]. It has been proven that traditional algorithms have achieved better results. However, since the voltage of sEMG is relatively weak (mV level), the voltage is susceptible to noise interference. It is difficult for the features extracted by traditional methods to achieve accurate results for actual requirements. Moreover, traditional methods need to select features and classifiers manually.Compared with the traditional sEMG classification method, the neural network can avoid describing and extracting the features of weak sEMG data. It can learn the features independently and combine the extracted features with classification to improve recognition accuracy [20–24]. In recent years, EMG pattern recognition has been combined with deep learning and neural networks, such as artificial neural network (ANN), convolutional neural network (CNN), and recurrent neural network (RNN), which have been used to recognize sEMG. In the process of sEMG acquisition, the electrodes have different spatial positions. CNN is effective in sEMG acquisition because it can extract the local and global features of sEMG. Fifty-two kinds of sEMG gestures have been recognized for the first time by a simple CNN model that achieves the accuracy of general classical algorithms in [25]. A CNN network model, composed of four convolution layers, four pooling layers, and two fully connected layers, has been used to improve the variability of different testers in hand movements in [26]. Moreover, some improved algorithms based on CNN technique have been investigated to recognize the sEMG gesture during the past few years; see [27, 28].Till now, sEMG research based on CNN has also faced some problems. Firstly, the complexity computation of CNN network with many layers is expensive, which leads to the delay in the interaction between humans and computers. For example, the recognition process speed in [29] is slow even eleven convolution layers are used to extract features. Secondly, it is difficult to manually set hyperparameters and conduct experiments to verify this setting. Most researchers set the network hyperparameters, which affect the accuracy of the model, based on previous experience or just pick them randomly [30]. These artificial settings accumulate the uncertainty of sEMG recognition. Finally, the accuracy of EMG pattern recognition can reach more than 90% when classifying less than ten gestures. On the contrary, the accuracy will be significantly reduced when more than ten gestures are required to be classified. This limits the ability of the model to interpret human motion intention. The result shows that the more the actions of dual-flow network based on CNN [30] are recognized, the less the accuracy of the network is.Following the above discussions, the purpose of this paper is to propose a new hand movement recognition method with applications to the analysis of multichannel sEMG signals. PSO is used to adjust the network hyperparameters, eliminate interference, classify more gesture actions, and improve the accuracy of EMG pattern recognition. The proposed method can even recognize three groups of hand movements in terms of sensitivity, flexibility, and dynamics, which is superior to most of the state-of-the-art methods on the Ninapro standard data set. The main contributions are summarized as follows:(1)
A novel deep learning framework is constructed based on lightweight convolutional neural network (LWCNN). The proposed LWCNN, which just contains 10952 parameters and three convolution layers, is an end-to-end sEMG feature extraction network. It solves the problem of computational complexity and improves the efficiency of human-computer interaction.(2)
The PSO algorithm is exploited to optimize the hyperparameters of LWCNN, which leads to a novel PLCNN classification model. A linear decline strategy is used to redefine the inertia weight to avoid the situation in which PSO falls into local optimum. Meanwhile, the cross-entropy loss function of the network is set as the fitness function to make predicted results close to the real results.(3)
The proposed PLCNN deep learning algorithm is successfully employed to analyze the multichannel sEMG signals in order to verify hand movement recognition. With an appropriate recognition method, the speed and accuracy of hand movement recognition could be much increased. Thus, the efficiency of human-computer interaction can be improved.The remainder of this paper is organized as follows. The proposed framework for sEMG pattern recognition and the designed algorithms are introduced in Section2. Descriptions of data and experimental configuration are introduced in Section 3. The PLCNN method for sEMG pattern recognition is discussed and the experiments results, demonstrating the effectiveness of the developed framework, are provided in Section 4. Finally, conclusions are given in Section 5.


## 2. System Framework and Method

As shown in Figure1, we propose a novel deep learning network for sEMG pattern recognition. The network is suitable for a simple one-dimensional signal, which has low complexity and few parameters. Moreover, the PSO algorithm is used to automatically select the network’s hyperparameters to avoid expensive computation in gesture recognition.Figure 1
The proposed network architecture for sEMG recognition. The original sEMG is sequentially fed to LWCNN for feature extraction to obtain corresponding feature maps, which has been preprocessed by filtering and denoising. The feature map is then flattened into feature vectors to the fully connected layer for preliminary identification. To better represent different gesture feature, the PSO model is adopted finally.


### 2.1. Lightweight Convolution Neural Network (LWCNN) Model

Researchers have found that CNN has important spatial significance for sEMG, because CNN has excellent performance on image and speech processing. In respect of EMG pattern recognition, CNN can extract the spatial correlation features of sEMG signal according to the position of electrodes in space. Feature extraction is integrated into feature classification by local connection and weight sharing, which removes the complexity of traditional recognition methods where feature extraction and data reconstruction are needed. The main network structure of CNN includes four parts: convolution layer, pooling layer, full connection layer, and activation function.The general CNN network structure is too complex, which often leads directly to a slow convergence rate of training. Furthermore, complex structures can cause network overfitting and even reduce the accuracy of EMG pattern recognition. Moreover, due to the structural complexity increased in network structure, it is difficult to optimize the hyperparameters of the model. Therefore, we design a lightweight CNN structure network called LWCNN, which not only includes fewer parameters but also could accelerate training speed. As shown in Table1, the convolution layers’ parameters of LWCNN are significantly less than those of the state-of-the-art methods, which is more conducive to subsequent optimization.Table 1
Various model parameters based on EMG pattern recognition.
AuthorsMethodsNumber of convolution layersConvolution layer parametersManfredo et al. [25]CNN5—Runze et al. [30]Dual-flow net4—Ulysse et al. [29]ConvNet567179Lin et al. [28]EMGNet434311LCNN2154353OursLWCNN310952It can be seen from Figure2 that the designed LWCNN consists of four parts for sEMG pattern recognition, mainly inputting sEMG data, extracting sEMG features, classifying sEMG features, and outputting classification results, where a,b,c are the numbers of filters and d,e,f are filter sizes.(i)
Part 1: the first part is the input module. The preprocessed sEMG signal is inputted with the size of 1×insize, which is convenient for feature extraction in subsequent convolutional layers.(ii)
Part 2: the second part consists of six layers: three convolution layers, two pooling layers, and an activation function. Convolution layers are the most important layers in the whole structure: conv-1, conv-2, and conv-3. Pooling layers are pool-1 and pool-2. The first layer is conv-1, which has a filters of size 1×d. The sEMG is convoluted by multiple filters to obtain the spatial features of the signal. The second layer is the ReLU activation function, which preserves and maps the activated features to increase the nonlinear representation of the network. The third layer is pool-1, which performs an average pooling for the features. It not only reduces the size of features to simplify the complexity of the network, but also extracts the representative features to the corresponding feature map. The fourth layer is conv-2 with b filters of size 1×e. Afterwards, there is a pool-2 layer for the local average. The last layer is conv-3, which contains c filters with the size of 1×f.(iii)
Part 3: the third part consists of a flatten layer, two dropout layers, and two full connection layers called dense-1 and dense-2. This part mainly synthesizes all the extracted sEMG features from the second part and expands them to obtain global information. Moreover, part features are discarded to prevent network overfitting. Finally, the processed features are mapped to the simple label space to prepare for gesture recognition.(iv)
Part 4: the fourth part is the output module, in which the softmax function is used to classify the features of the network. Then, we obtain the predicted results of hand movements as output.Figure 2
Network structure of the LWCNN.Algorithm1 gives the process of LWCNN model training for sEMG signal, where a,b,c,d,e,f,batch size, and learning rate are the network hyperparameters which PSO needs for optimization as shown in Table 2.Algorithm 1: The proposed lightweight convolution neural network.
Input: One dimensional sEMG signalX with the size of 1×insizeOutput:yInitialize learning rate andLossforEpoch=1 to 300 dofork=1 to smaple number ofX/batch sizedoFeature extract:X′←ConvolutionXTraining:y←train LWCNNX′Min (loss):←Loss=−∑j=1Myijlogpij (according to equation (4))Update the variables by gradient: Adam (learning rate, loss)end forkend forEpochObtain the prediction probabilityyTable 2
Hyperparameters setting to be optimized.
Dimensions of each particleHyperparameterInitialization range1a(30, 60)2b(40, 80)3c(80, 120)4d(2, 7)5e(2, 7)6f(2, 7)7Activation function of dense-1ReLU, sigmoid, tanh8Activation function of dense-2ReLU, sigmoid, tanh9Batch size(32, 50)10Learning rate0.1, 0.001


### 2.2. The PSO Optimized LWCNN Model

LWCNN model has a significant effect on the spatial processing of the sEMG signal, but the settings of hyperparameters can directly affect the performance of the model. Manually set hyperparameters not only complicate the work, but also slow down the EMG recognition process. Moreover, when the hyperparameters of LWCNN are optimized manually, the generalization ability of the model is weak.PSO is an iterative optimization algorithm [31, 32]. Its idea comes from the observation of the foraging behavior of birds. The basic idea is that each individual in the population iteratively updates itself according to the initial value. To obtain the optimal result, individuals share information with each other to adjust the population. Due to the advantages of search speed, wide search range, simple structure, and easy implementation, PSO stands out among many optimization algorithms. In this paper, we utilize PSO to adjust the network hyperparameters and automatically find the most suitable deep learning structure for sEMG pattern recognition.PLCNN takes 10 hyperparameters in LWCNN structure as 10 dimensions of each particle in PSO. These hyperparameters include the number of convolution kernels, the size of convolution kernels, activation function, batch size, and learning rate. According to the classic networks such as VGG and ResNet [33, 34], the initial value range of PLCNN is shown in Table 2.Suppose that, in a ten-dimensional space,m particles constitute a population without mass and volume. Each particle is represented by the velocity vector and position vector in space. In the k-th iteration, the l-th particle velocity vector vlk=vl1k,vl2k,…,vl10k, and the position vector xlk=xl1k,xl2k,…,xl10k. Then the l-th particle performs the next update according to its best position in all iterations, where the best position is found by m particles in the population. The best position of it is xlp=xlp1,xlp2,…,xlp10 and the best solution to the population is xg=xg1,xg2,…,xg10. The velocity and position updating formulas of the l-th particle in the k+1-th iteration are(1)vlk+1=wvlk+c1r1xlpk−xlk+c2r2xgk−xlk,(2)xlk+1=xlk+vlk+1,where k is the number of iterations; xlpk is the best position of particle l after the k-th iteration; xgk is the best position of the population of particles l after the k-th iteration; w is the inertial weight; c1,c2 are the learning factors; and r1,r2 are the random numbers over the interval (0, 1).In order to enhance the performance of PSO algorithm and balance the global with the local search of the population, linear decreasing weight (LDW) strategy is adopted to make the inertia weightw change dynamically [35]. When w is large, the global optimization ability is strong, while the local optimization ability is weak; when w is small, the situation is just the opposite. It can effectively prevent the PSO algorithm from falling into the local optimal solution situation. The formula is(3)w=wini−wendGk−gGk+wend,where wini is the initial inertia weight, wend is the final inertia weight, g is the current number of iterations, and Gk is the maximum number of iterations.In this paper, the cross-entropy loss function obtained by PLCNN is used as the fitness function, and the formula is(4)Loss=−∑j=1Myijlogpij,where M is the number of categories classified; yij is the variable 0 or 1 (if the j category is the same as the observation sample i, it is 1; otherwise, it is 0); and pij is the prediction probability that the observation sample i belongs to j category.The pseudocode of PLCNN is given in Algorithm2.Algorithm 2: Pseudocode of EMG pattern recognition based on PLCNN.
Input: One dimensional sEMG signal X with size of 1×insizeOutput: Optimal hyperparameter (particle position xgk under minimum fitness value)Initializexgk according to Table 2fork = 1 to maximum iterations Gkdoforl = 1 to particle number mdoCalculate the fitness value according to equation (4), save particle current position parameter xlkend forlAccording to equation (4): update the best position of each particle xlpk and the best position of population xgkAccording to equations (1) and (2): update the particle velocity vlk+1 and position xlk+1According to equation (3): update inertia weight wend forkObtain the optimal hyperparametersxgkThe specific implementation of the PLCNN model is shown in Figure3. In step 1, we initialize the basic parameters of PSO and set the hyperparameters in Table 1 as the position vector of each particle. In step 2, each particle is passed to LWCNN for iterative training, and the cross-entropy loss function value is used as the fitness function value. In step 3, the individual optimal value xlpk and the population optimal value xgk are updated according to the fitness function value. Step 4 is to judge whether iterations have reached the maximum number. If it meets the requirements, step 6 is executed; otherwise, step 5 is executed. Step 5 is to update the velocity vector, position vector, and inertia weight according to (1)–(3). Then, it returns to step 2. Step 6 is to output the optimization results.Figure 3
The flowchart of PLCNN model.


## 2.1. Lightweight Convolution Neural Network (LWCNN) Model

Researchers have found that CNN has important spatial significance for sEMG, because CNN has excellent performance on image and speech processing. In respect of EMG pattern recognition, CNN can extract the spatial correlation features of sEMG signal according to the position of electrodes in space. Feature extraction is integrated into feature classification by local connection and weight sharing, which removes the complexity of traditional recognition methods where feature extraction and data reconstruction are needed. The main network structure of CNN includes four parts: convolution layer, pooling layer, full connection layer, and activation function.The general CNN network structure is too complex, which often leads directly to a slow convergence rate of training. Furthermore, complex structures can cause network overfitting and even reduce the accuracy of EMG pattern recognition. Moreover, due to the structural complexity increased in network structure, it is difficult to optimize the hyperparameters of the model. Therefore, we design a lightweight CNN structure network called LWCNN, which not only includes fewer parameters but also could accelerate training speed. As shown in Table1, the convolution layers’ parameters of LWCNN are significantly less than those of the state-of-the-art methods, which is more conducive to subsequent optimization.Table 1
Various model parameters based on EMG pattern recognition.
AuthorsMethodsNumber of convolution layersConvolution layer parametersManfredo et al. [25]CNN5—Runze et al. [30]Dual-flow net4—Ulysse et al. [29]ConvNet567179Lin et al. [28]EMGNet434311LCNN2154353OursLWCNN310952It can be seen from Figure2 that the designed LWCNN consists of four parts for sEMG pattern recognition, mainly inputting sEMG data, extracting sEMG features, classifying sEMG features, and outputting classification results, where a,b,c are the numbers of filters and d,e,f are filter sizes.(i)
Part 1: the first part is the input module. The preprocessed sEMG signal is inputted with the size of 1×insize, which is convenient for feature extraction in subsequent convolutional layers.(ii)
Part 2: the second part consists of six layers: three convolution layers, two pooling layers, and an activation function. Convolution layers are the most important layers in the whole structure: conv-1, conv-2, and conv-3. Pooling layers are pool-1 and pool-2. The first layer is conv-1, which has a filters of size 1×d. The sEMG is convoluted by multiple filters to obtain the spatial features of the signal. The second layer is the ReLU activation function, which preserves and maps the activated features to increase the nonlinear representation of the network. The third layer is pool-1, which performs an average pooling for the features. It not only reduces the size of features to simplify the complexity of the network, but also extracts the representative features to the corresponding feature map. The fourth layer is conv-2 with b filters of size 1×e. Afterwards, there is a pool-2 layer for the local average. The last layer is conv-3, which contains c filters with the size of 1×f.(iii)
Part 3: the third part consists of a flatten layer, two dropout layers, and two full connection layers called dense-1 and dense-2. This part mainly synthesizes all the extracted sEMG features from the second part and expands them to obtain global information. Moreover, part features are discarded to prevent network overfitting. Finally, the processed features are mapped to the simple label space to prepare for gesture recognition.(iv)
Part 4: the fourth part is the output module, in which the softmax function is used to classify the features of the network. Then, we obtain the predicted results of hand movements as output.Figure 2
Network structure of the LWCNN.Algorithm1 gives the process of LWCNN model training for sEMG signal, where a,b,c,d,e,f,batch size, and learning rate are the network hyperparameters which PSO needs for optimization as shown in Table 2.Algorithm 1: The proposed lightweight convolution neural network.
Input: One dimensional sEMG signalX with the size of 1×insizeOutput:yInitialize learning rate andLossforEpoch=1 to 300 dofork=1 to smaple number ofX/batch sizedoFeature extract:X′←ConvolutionXTraining:y←train LWCNNX′Min (loss):←Loss=−∑j=1Myijlogpij (according to equation (4))Update the variables by gradient: Adam (learning rate, loss)end forkend forEpochObtain the prediction probabilityyTable 2
Hyperparameters setting to be optimized.
Dimensions of each particleHyperparameterInitialization range1a(30, 60)2b(40, 80)3c(80, 120)4d(2, 7)5e(2, 7)6f(2, 7)7Activation function of dense-1ReLU, sigmoid, tanh8Activation function of dense-2ReLU, sigmoid, tanh9Batch size(32, 50)10Learning rate0.1, 0.001


## 2.2. The PSO Optimized LWCNN Model

LWCNN model has a significant effect on the spatial processing of the sEMG signal, but the settings of hyperparameters can directly affect the performance of the model. Manually set hyperparameters not only complicate the work, but also slow down the EMG recognition process. Moreover, when the hyperparameters of LWCNN are optimized manually, the generalization ability of the model is weak.PSO is an iterative optimization algorithm [31, 32]. Its idea comes from the observation of the foraging behavior of birds. The basic idea is that each individual in the population iteratively updates itself according to the initial value. To obtain the optimal result, individuals share information with each other to adjust the population. Due to the advantages of search speed, wide search range, simple structure, and easy implementation, PSO stands out among many optimization algorithms. In this paper, we utilize PSO to adjust the network hyperparameters and automatically find the most suitable deep learning structure for sEMG pattern recognition.PLCNN takes 10 hyperparameters in LWCNN structure as 10 dimensions of each particle in PSO. These hyperparameters include the number of convolution kernels, the size of convolution kernels, activation function, batch size, and learning rate. According to the classic networks such as VGG and ResNet [33, 34], the initial value range of PLCNN is shown in Table 2.Suppose that, in a ten-dimensional space,m particles constitute a population without mass and volume. Each particle is represented by the velocity vector and position vector in space. In the k-th iteration, the l-th particle velocity vector vlk=vl1k,vl2k,…,vl10k, and the position vector xlk=xl1k,xl2k,…,xl10k. Then the l-th particle performs the next update according to its best position in all iterations, where the best position is found by m particles in the population. The best position of it is xlp=xlp1,xlp2,…,xlp10 and the best solution to the population is xg=xg1,xg2,…,xg10. The velocity and position updating formulas of the l-th particle in the k+1-th iteration are(1)vlk+1=wvlk+c1r1xlpk−xlk+c2r2xgk−xlk,(2)xlk+1=xlk+vlk+1,where k is the number of iterations; xlpk is the best position of particle l after the k-th iteration; xgk is the best position of the population of particles l after the k-th iteration; w is the inertial weight; c1,c2 are the learning factors; and r1,r2 are the random numbers over the interval (0, 1).In order to enhance the performance of PSO algorithm and balance the global with the local search of the population, linear decreasing weight (LDW) strategy is adopted to make the inertia weightw change dynamically [35]. When w is large, the global optimization ability is strong, while the local optimization ability is weak; when w is small, the situation is just the opposite. It can effectively prevent the PSO algorithm from falling into the local optimal solution situation. The formula is(3)w=wini−wendGk−gGk+wend,where wini is the initial inertia weight, wend is the final inertia weight, g is the current number of iterations, and Gk is the maximum number of iterations.In this paper, the cross-entropy loss function obtained by PLCNN is used as the fitness function, and the formula is(4)Loss=−∑j=1Myijlogpij,where M is the number of categories classified; yij is the variable 0 or 1 (if the j category is the same as the observation sample i, it is 1; otherwise, it is 0); and pij is the prediction probability that the observation sample i belongs to j category.The pseudocode of PLCNN is given in Algorithm2.Algorithm 2: Pseudocode of EMG pattern recognition based on PLCNN.
Input: One dimensional sEMG signal X with size of 1×insizeOutput: Optimal hyperparameter (particle position xgk under minimum fitness value)Initializexgk according to Table 2fork = 1 to maximum iterations Gkdoforl = 1 to particle number mdoCalculate the fitness value according to equation (4), save particle current position parameter xlkend forlAccording to equation (4): update the best position of each particle xlpk and the best position of population xgkAccording to equations (1) and (2): update the particle velocity vlk+1 and position xlk+1According to equation (3): update inertia weight wend forkObtain the optimal hyperparametersxgkThe specific implementation of the PLCNN model is shown in Figure3. In step 1, we initialize the basic parameters of PSO and set the hyperparameters in Table 1 as the position vector of each particle. In step 2, each particle is passed to LWCNN for iterative training, and the cross-entropy loss function value is used as the fitness function value. In step 3, the individual optimal value xlpk and the population optimal value xgk are updated according to the fitness function value. Step 4 is to judge whether iterations have reached the maximum number. If it meets the requirements, step 6 is executed; otherwise, step 5 is executed. Step 5 is to update the velocity vector, position vector, and inertia weight according to (1)–(3). Then, it returns to step 2. Step 6 is to output the optimization results.Figure 3
The flowchart of PLCNN model.


## 3. Data and Experimental

### 3.1. Data Acquisition

Our approach is evaluated on the Ninapro Database 1 (DB1), which is an open standard data set of multichannel gesture sEMG signals in Sweden. The data is similar to that acquired in real-life conditions, so it is widely used in sEMG pattern recognition [36, 37]. In DB1, the sEMG data from twenty-seven healthy subjects who performed fifty-two hand movements are recorded.The fifty-two movements are composed of Exercise A, Exercise B, and Exercise C, which are twelve finger movements, seventeen wrist movements, and twenty-three hand grabbing movements, respectively. This motion involves robotics and rehabilitation medicine, covering most of the hand movements encountered in daily life. It represents the sensitivity, flexibility, and dynamics of the hand. Figure4 shows some example fingers, wrists, and grabbing movements.Figure 4
Partial action diagram.During the process of data collection, the subjects are asked to repeat the action of their right hand every three seconds, while each gesture action is repeated ten times with five seconds. Ten Ottobock electrodes are used to collect the data of radial brachial joint, flexor digitorum superficialis, and extensor digitorum superficialis of each subject’s forearm at a sampling frequency of 100 Hz. Then the collected data will go through Hampel filter to eliminate 50 Hz power line interference. More details of the data can be found in the official literature [38].


### 3.2. Preprocessing and Experimental Configuration

We cut out the active sEMG action according to the labels. For each action, the sEMG data of each channel is taken as a sample. We randomly take 90% of the samples as the training set and 10% as the test set. Since the action will not be completely synchronized with the stimulus from the acquisition software with different reaction time and experimental conditions, the generalized likelihood ratio algorithm [39] is used to relabel the data. The relabeled data is added with zero to make up the uniform length and then normalized. The processed signal length insize corresponding to Exercise A, B, and C is 597, 594, and 556, respectively.We set the number of particlesm to 10, the maximum iteration Gk is 30, the learning factor c1 = c2 = 2 in (1), and initial inertia weight wini = 1 in (3). As shown in Figure 5, the population has converged after continuous iteration. Accordingly, the optimal hyperparameters found by the PLCNN are shown in Table 3.Figure 5
The trend graph of fitness value change.Table 3
Optimal hyperparameters setting.
Dimensions of each particleHyperparameterxg301a312b643c1194d55e56f37Activation function of dense-1ReLU8Activation function of dense-2ReLU9Batch size4210Learning rate0.001In addition, as shown in Table4, we compare CNN, LWCNN, and PLCNN to verify the high recognition ability of PLCNN. The network structure of PLCNN is simple, and the hyperparameters are obtained by PSO, while the hyperparameters of LWCNN network are set manually. Compared with these network structures, CNN is more complex, and its hyperparameters are also set manually.Table 4
settings of CNN, LWCNN, and PLCNN.
MethodsNumber of convolution layersNumber of pooling layersHyperparameterCNN51Manual settingLWCNN32Manual settingPLCNN32PSO (see Table3)


## 3.1. Data Acquisition

Our approach is evaluated on the Ninapro Database 1 (DB1), which is an open standard data set of multichannel gesture sEMG signals in Sweden. The data is similar to that acquired in real-life conditions, so it is widely used in sEMG pattern recognition [36, 37]. In DB1, the sEMG data from twenty-seven healthy subjects who performed fifty-two hand movements are recorded.The fifty-two movements are composed of Exercise A, Exercise B, and Exercise C, which are twelve finger movements, seventeen wrist movements, and twenty-three hand grabbing movements, respectively. This motion involves robotics and rehabilitation medicine, covering most of the hand movements encountered in daily life. It represents the sensitivity, flexibility, and dynamics of the hand. Figure4 shows some example fingers, wrists, and grabbing movements.Figure 4
Partial action diagram.During the process of data collection, the subjects are asked to repeat the action of their right hand every three seconds, while each gesture action is repeated ten times with five seconds. Ten Ottobock electrodes are used to collect the data of radial brachial joint, flexor digitorum superficialis, and extensor digitorum superficialis of each subject’s forearm at a sampling frequency of 100 Hz. Then the collected data will go through Hampel filter to eliminate 50 Hz power line interference. More details of the data can be found in the official literature [38].


## 3.2. Preprocessing and Experimental Configuration

We cut out the active sEMG action according to the labels. For each action, the sEMG data of each channel is taken as a sample. We randomly take 90% of the samples as the training set and 10% as the test set. Since the action will not be completely synchronized with the stimulus from the acquisition software with different reaction time and experimental conditions, the generalized likelihood ratio algorithm [39] is used to relabel the data. The relabeled data is added with zero to make up the uniform length and then normalized. The processed signal length insize corresponding to Exercise A, B, and C is 597, 594, and 556, respectively.We set the number of particlesm to 10, the maximum iteration Gk is 30, the learning factor c1 = c2 = 2 in (1), and initial inertia weight wini = 1 in (3). As shown in Figure 5, the population has converged after continuous iteration. Accordingly, the optimal hyperparameters found by the PLCNN are shown in Table 3.Figure 5
The trend graph of fitness value change.Table 3
Optimal hyperparameters setting.
Dimensions of each particleHyperparameterxg301a312b643c1194d55e56f37Activation function of dense-1ReLU8Activation function of dense-2ReLU9Batch size4210Learning rate0.001In addition, as shown in Table4, we compare CNN, LWCNN, and PLCNN to verify the high recognition ability of PLCNN. The network structure of PLCNN is simple, and the hyperparameters are obtained by PSO, while the hyperparameters of LWCNN network are set manually. Compared with these network structures, CNN is more complex, and its hyperparameters are also set manually.Table 4
settings of CNN, LWCNN, and PLCNN.
MethodsNumber of convolution layersNumber of pooling layersHyperparameterCNN51Manual settingLWCNN32Manual settingPLCNN32PSO (see Table3)


## 4. Analysis of Results

Four evaluation indexes, accuracy (5), Kappa coefficient (6), Hamming loss (8), and Jaccard similarity coefficient (9), are used to comprehensively evaluate the performance of different recognition algorithms on DB1 training set.


### 4.1. Accuracy

(5)acc=tp+tntp+tn+fp+fn,where tp is the number of samples correctly classified into the current gesture type, fp is the number of samples that do not belong to the current gesture type but are misclassified into it, tn is the number of samples that belong to the current gesture type but are misclassified into other types, and fn is the number of samples that do not belong to the current gesture type and are misclassified into other types.


### 4.2. Kappa Coefficient

(6)K=acc−pe1−pe,where standard pe is usually expressed as follows:(7)pe=∑i=1Mai⋅biN2,where M is the number of categories classified, ai is the actual number of class i samples, bi is the predicted number of class i samples, and N is the total number of samples. As shown in Table 5, if the parameter KK∈0,1 is larger, the classification accuracy of the model is higher.Table 5
Classification of Kappa coefficient.
K0∼0.20.2∼0.40.4∼0.60.6∼0.80.8∼1.0Consistency levelLowCommonSecondaryHighAlmost the same


### 4.3. Hamming Loss

(8)H=1N∑i=1MXORYi,Pin,where Yi is the true value of type i sample, Pi is the predicted value of the class i sample, XOR0,1=XOR1,0=1, and XOR0,0=XOR1,1=0. Obviously, when the Hamming loss HH∈0,1 is smaller, the difference between predicted and actual is smaller, and the classification ability of the used algorithm is stronger.


### 4.4. Jaccard Similarity Coefficient

(9)J=1N∑i=1MYi∩PiYi∪Pi.For EMG pattern recognition problem, if the Jaccard similarity coefficientJ is larger, the prediction results are more consistent with the actual results, and the performance of model action classification is better.For the traditional machine learning algorithm, the recognition task is generally divided into feature extraction and feature classification. In the experiment, we extract four common EMG signal features: integrated EMG [40], root mean square [41], mean absolute value [42], and waveform length [43]. Then, they are sent to three kinds of feature classifiers: SVM [44], RF [45], and KNN [46]. Moreover, ordinary CNN, LWCNN with manually set hyperparameters, and optimized PLCNN based on deep learning algorithm can directly extract and classify the original EMG signals end-to-end.The performance test for the proposed PLCNN and other five popular recognition algorithms are described by radar chart based on the four evaluation indexes. Figures6–8 show the comparison results on the three exercise sets A, B, and C, respectively. It is obvious that the closer the point to the center, the lower the index value.Figure 6
Performance test for Exercise A.Figure 7
Performance test for Exercise B.Figure 8
Performance test for Exercise C.As can be seen from Figures6–8, the accuracy of the PLCNN model in Exercise A, B, and C reaches 86.67%, 90.06%, and 89.57%, respectively. This means that our model outperforms the other five algorithms by 19%–38%, 12%–17%, and 4%–7%. Among the three traditional machine learning classifiers, RF has the highest accuracy due to its strong resistance to overfitting and excellent stability. It is difficult for SVM to adapt to the multiclassification problem, and KNN has poor fault tolerance for training data. Compared with the traditional algorithms, deep learning models are more representative and recognizable to extract sEMG features.In terms of Kappa coefficient, Jaccard similarity coefficient, and Hamming loss, the performance of the three traditional machine learning algorithms is significantly worse than the neural network algorithms. In particular, the Kappa coefficients of PLCNN on Exercise A, B, and C are 0.8545, 0.8938, and 0.8909, respectively. The Jaccard similarity coefficients are 0.7511, 0.8182, and 0.7869, respectively. Compared with the other five algorithms, these two evaluation indicators of PLCNN are the highest. The Hamming loss of PLCNN is 0.1333, 0.1, and 0.1043, respectively, which is the lowest among all the six algorithms. The results illustrate that the prediction results of PLCNN model are accurate, and its classification is precise.In conclusion, LWCNN and PLCNN can recognize sEMG signals effectively. However, the PLCNN involves PSO to determine the optimal hyperparameters automatically and achieves better performance than LWCNN which adjusts hyperparameters manually.The running time represents the complexity of the algorithm and reflects the speed of sEMG pattern recognition. Table6 shows the average test time of the six algorithms in three exercises and all fifty-two actions. PLCNN takes 5 ms, 7 ms, 9 ms, and 19 ms to recognize twelve, seventeen, twenty-three, and fifty-two actions, respectively. It is faster than the traditional machine learning algorithms, CNN, and LWCNN by 20–400 ms, 3–9 ms, and 1–3 ms. At the same time, the average test time of PLCNN is significantly shorter than that of the paper [25].Table 6
Average test time of six algorithms.
Average test time (ms)SVMRFKNNCNNLWCNNPLCNNExercise A26.005720.004231.00688.00205.00175.0013Exercise B69.014528.006361.013210.00237.00427.0013Exercise C154.034341.009693.020414.003712.00279.9928All954.213899.0221255.059728.007221.004219.0043As one of the effective indexes in evaluating and identifying tasks, the confusion matrix map is widely used in various classification networks. As shown in Figures9–11, in order to further compare the performance of three networks based on deep learning, we take Exercise A as the visual experimental data set and give the corresponding confusion matrix diagram.Figure 9
Confusion matrix of CNN in Exercise A.Figure 10
Confusion matrix of LWCNN in Exercise A.Figure 11
Confusion matrix of PLCNN in Exercise A.As shown in Figures9–11, the ordinary CNN model can achieve high accuracy for the classification of the fifth type of action (ring flexion) since the action amplitude is large and easy to be recognized when the ring finger is bent. LWCNN and PLCNN also have good performance in this kind of action recognition. However, the accuracy of CNN for the remaining eleven movements are not very high, especially in the ninth movement classification; it can only reach 50%, which is 30% lower than LWCNN. LWCNN network structure is simpler than CNN, for which it is not easy to saturate and classify sEMG signals accurately. PLCNN has precise recognition ability that divides five actions correctly in 12 movements, and the accuracy rate of PLCNN is higher than that of LWCNN in the ninth category by 10%.In order to verify the robustness and convergence of the model, the loss value and accuracy of LWCNN and PLCNN are visualized in the process of training and testing. Figures12(a), 13(a), and 14(a) represent the loss change graph of LWCNN and PLCNN on Exercise A, B, and C, respectively. The corresponding loss values are smoothed by the log function. Figures 12(b), 13(b), and 14(b) show the accuracy variation diagram of LWCNN and PLCNN on Exercise A, B, and C, respectively.Figure 12
Loss function trend chart and precision change trend chart for Exercise A: (a) loss tend; (b) accuracy trend.
(a)(b)Figure 13
Loss function trend chart and precision change trend chart for Exercise B: (a) loss tend; (b) accuracy trend.
(a)(b)Figure 14
Loss function trend chart and precision change trend chart for Exercise C: (a) loss tend; (b) accuracy trend.
(a)(b)In the training process, the loss values of LWCNN and PLCNN decrease with iteration increasing and effectively converge, as shown in Figures12(a), 13(a), and 14(a). However, the convergence speed of PLCNN is obviously faster than that of LWCNN, and the global loss value is lower than that of LWCNN. This shows that the optimized hyperparameters of PLCNN model improve the performance of the model and accuracy of the predicted category. Moreover, the loss on the verification set satisfies the same distribution, and the overall loss value is slightly higher than the training process. These effectively prove the good convergence and stability of the model. Figures 12(b), 13(b), and 14(b) illustrate that the accuracy of training and testing increases with a larger number of iterations. Therefore, the trend of accuracy accords with the corresponding loss distribution, which further demonstrates the robustness of PLCNN model and highlights its high recognition ability in sEMG signals.


## 4.1. Accuracy

(5)acc=tp+tntp+tn+fp+fn,where tp is the number of samples correctly classified into the current gesture type, fp is the number of samples that do not belong to the current gesture type but are misclassified into it, tn is the number of samples that belong to the current gesture type but are misclassified into other types, and fn is the number of samples that do not belong to the current gesture type and are misclassified into other types.


## 4.2. Kappa Coefficient

(6)K=acc−pe1−pe,where standard pe is usually expressed as follows:(7)pe=∑i=1Mai⋅biN2,where M is the number of categories classified, ai is the actual number of class i samples, bi is the predicted number of class i samples, and N is the total number of samples. As shown in Table 5, if the parameter KK∈0,1 is larger, the classification accuracy of the model is higher.Table 5
Classification of Kappa coefficient.
K0∼0.20.2∼0.40.4∼0.60.6∼0.80.8∼1.0Consistency levelLowCommonSecondaryHighAlmost the same


## 4.3. Hamming Loss

(8)H=1N∑i=1MXORYi,Pin,where Yi is the true value of type i sample, Pi is the predicted value of the class i sample, XOR0,1=XOR1,0=1, and XOR0,0=XOR1,1=0. Obviously, when the Hamming loss HH∈0,1 is smaller, the difference between predicted and actual is smaller, and the classification ability of the used algorithm is stronger.


## 4.4. Jaccard Similarity Coefficient

(9)J=1N∑i=1MYi∩PiYi∪Pi.For EMG pattern recognition problem, if the Jaccard similarity coefficientJ is larger, the prediction results are more consistent with the actual results, and the performance of model action classification is better.For the traditional machine learning algorithm, the recognition task is generally divided into feature extraction and feature classification. In the experiment, we extract four common EMG signal features: integrated EMG [40], root mean square [41], mean absolute value [42], and waveform length [43]. Then, they are sent to three kinds of feature classifiers: SVM [44], RF [45], and KNN [46]. Moreover, ordinary CNN, LWCNN with manually set hyperparameters, and optimized PLCNN based on deep learning algorithm can directly extract and classify the original EMG signals end-to-end.The performance test for the proposed PLCNN and other five popular recognition algorithms are described by radar chart based on the four evaluation indexes. Figures6–8 show the comparison results on the three exercise sets A, B, and C, respectively. It is obvious that the closer the point to the center, the lower the index value.Figure 6
Performance test for Exercise A.Figure 7
Performance test for Exercise B.Figure 8
Performance test for Exercise C.As can be seen from Figures6–8, the accuracy of the PLCNN model in Exercise A, B, and C reaches 86.67%, 90.06%, and 89.57%, respectively. This means that our model outperforms the other five algorithms by 19%–38%, 12%–17%, and 4%–7%. Among the three traditional machine learning classifiers, RF has the highest accuracy due to its strong resistance to overfitting and excellent stability. It is difficult for SVM to adapt to the multiclassification problem, and KNN has poor fault tolerance for training data. Compared with the traditional algorithms, deep learning models are more representative and recognizable to extract sEMG features.In terms of Kappa coefficient, Jaccard similarity coefficient, and Hamming loss, the performance of the three traditional machine learning algorithms is significantly worse than the neural network algorithms. In particular, the Kappa coefficients of PLCNN on Exercise A, B, and C are 0.8545, 0.8938, and 0.8909, respectively. The Jaccard similarity coefficients are 0.7511, 0.8182, and 0.7869, respectively. Compared with the other five algorithms, these two evaluation indicators of PLCNN are the highest. The Hamming loss of PLCNN is 0.1333, 0.1, and 0.1043, respectively, which is the lowest among all the six algorithms. The results illustrate that the prediction results of PLCNN model are accurate, and its classification is precise.In conclusion, LWCNN and PLCNN can recognize sEMG signals effectively. However, the PLCNN involves PSO to determine the optimal hyperparameters automatically and achieves better performance than LWCNN which adjusts hyperparameters manually.The running time represents the complexity of the algorithm and reflects the speed of sEMG pattern recognition. Table6 shows the average test time of the six algorithms in three exercises and all fifty-two actions. PLCNN takes 5 ms, 7 ms, 9 ms, and 19 ms to recognize twelve, seventeen, twenty-three, and fifty-two actions, respectively. It is faster than the traditional machine learning algorithms, CNN, and LWCNN by 20–400 ms, 3–9 ms, and 1–3 ms. At the same time, the average test time of PLCNN is significantly shorter than that of the paper [25].Table 6
Average test time of six algorithms.
Average test time (ms)SVMRFKNNCNNLWCNNPLCNNExercise A26.005720.004231.00688.00205.00175.0013Exercise B69.014528.006361.013210.00237.00427.0013Exercise C154.034341.009693.020414.003712.00279.9928All954.213899.0221255.059728.007221.004219.0043As one of the effective indexes in evaluating and identifying tasks, the confusion matrix map is widely used in various classification networks. As shown in Figures9–11, in order to further compare the performance of three networks based on deep learning, we take Exercise A as the visual experimental data set and give the corresponding confusion matrix diagram.Figure 9
Confusion matrix of CNN in Exercise A.Figure 10
Confusion matrix of LWCNN in Exercise A.Figure 11
Confusion matrix of PLCNN in Exercise A.As shown in Figures9–11, the ordinary CNN model can achieve high accuracy for the classification of the fifth type of action (ring flexion) since the action amplitude is large and easy to be recognized when the ring finger is bent. LWCNN and PLCNN also have good performance in this kind of action recognition. However, the accuracy of CNN for the remaining eleven movements are not very high, especially in the ninth movement classification; it can only reach 50%, which is 30% lower than LWCNN. LWCNN network structure is simpler than CNN, for which it is not easy to saturate and classify sEMG signals accurately. PLCNN has precise recognition ability that divides five actions correctly in 12 movements, and the accuracy rate of PLCNN is higher than that of LWCNN in the ninth category by 10%.In order to verify the robustness and convergence of the model, the loss value and accuracy of LWCNN and PLCNN are visualized in the process of training and testing. Figures12(a), 13(a), and 14(a) represent the loss change graph of LWCNN and PLCNN on Exercise A, B, and C, respectively. The corresponding loss values are smoothed by the log function. Figures 12(b), 13(b), and 14(b) show the accuracy variation diagram of LWCNN and PLCNN on Exercise A, B, and C, respectively.Figure 12
Loss function trend chart and precision change trend chart for Exercise A: (a) loss tend; (b) accuracy trend.
(a)(b)Figure 13
Loss function trend chart and precision change trend chart for Exercise B: (a) loss tend; (b) accuracy trend.
(a)(b)Figure 14
Loss function trend chart and precision change trend chart for Exercise C: (a) loss tend; (b) accuracy trend.
(a)(b)In the training process, the loss values of LWCNN and PLCNN decrease with iteration increasing and effectively converge, as shown in Figures12(a), 13(a), and 14(a). However, the convergence speed of PLCNN is obviously faster than that of LWCNN, and the global loss value is lower than that of LWCNN. This shows that the optimized hyperparameters of PLCNN model improve the performance of the model and accuracy of the predicted category. Moreover, the loss on the verification set satisfies the same distribution, and the overall loss value is slightly higher than the training process. These effectively prove the good convergence and stability of the model. Figures 12(b), 13(b), and 14(b) illustrate that the accuracy of training and testing increases with a larger number of iterations. Therefore, the trend of accuracy accords with the corresponding loss distribution, which further demonstrates the robustness of PLCNN model and highlights its high recognition ability in sEMG signals.


## 5. Conclusion

In this paper, a novel PLCNN method is proposed to recognize EMG signals quickly and accurately. The whole network is compact and simple, including three convolution layers and two full connection layers to extract and classify sEMG features. The PSO algorithm is exploited to search the autoadaptive hyperparameters, which significantly improve the efficiency of the traditional manual debugging hyperparameters. Moreover, the experiments illustrate that the proposed model reduces manual uncertainty and improves recognition performance. Notice that the proposed method obtains recognition accuracy of 86.67%, 90.06%, and 89.57% for Exercise A, B, and C. It is worth mentioning that the experiments in this paper cover almost all human hand movements under Ninapro Database 1, and the proposed method outperforms the five other state-of-the-art methods in terms of speed and accuracy. In the future, we will investigate other evolutionary algorithms [47–49] and machine learning techniques [50] to further improve the recognition rate and recognition speed, and will take the hardware system design into account to research the EMG pattern recognition problems.



---

*Source: 6642463-2020-12-04.xml*