Gesture recognition method based on entropy features and improved PSO-SVM
The support vector machine parameters are optimized by variational mode decomposition and particle swarm optimization algorithm, and the entropy features of surface electromyography signals are extracted. This solves the robustness and accuracy problems of traditional feature extraction methods for gesture classification models, and achieves higher classification accuracy and robustness.
Patent Information
- Application Number
- CN202510636118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-23
AI Technical Summary
In the existing technology, the robustness and accuracy of the surface electromyography signal gesture classification model are affected by the traditional time domain and frequency domain feature extraction methods, resulting in a decrease in classification accuracy and robustness.
The variational mode decomposition method is used to extract the entropy features of surface electromyography signals, and the particle swarm optimization algorithm is used to optimize the support vector machine parameters to construct a gesture classification model.
The classification accuracy and robustness of the gesture classification model are improved, the ability to capture gesture image information is enhanced, and the global search capability is enhanced by dynamically adjusting the inertia weight and adaptive acceleration constant strategy.
Smart Images

Figure CN120687916A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of neuroscience and information technology, and in particular to a gesture recognition method based on entropy features and an improved PSO-SVM. Background Art
[0002] Surface electromyography (sEMG) is widely used in rehabilitation therapy, intelligent prostheses and exoskeletons. Gesture recognition methods are mainly divided into two categories: visual recognition and biosignal recognition. Surface electromyography (sEMG) is suitable for the control of prostheses and exoskeletons due to its high sensitivity, real-time nature and high accuracy. Compared with visual recognition, surface electromyography (sEMG) is more stable in complex environments and is not affected by light and background noise. Some researchers have applied surface electromyography (sEMG) to exoskeleton systems to help people with disabilities achieve more natural motion control, thereby improving their independence and quality of daily life. By real-time monitoring of changes in surface electromyography (sEMG) signals, the user's intentions can be accurately captured and converted into motion commands for the exoskeleton system, greatly improving the adaptability and functionality of prostheses and exoskeletons.
[0003] With the continuous development of machine learning algorithms, machine learning algorithms have become an important method for gesture classification using surface electromyography signals. In recent years, many researchers have introduced machine learning algorithms into the surface electromyography signal gesture classification task; some researchers have constructed a dual-branch network to recognize 5 gestures with a recognition rate of 86.95%; some researchers have proposed an incremental learning framework based on densely connected convolutional networks (DenseNet) with a recognition rate of 88.6%; some researchers have proposed an enhanced algorithm combined with muscle fatigue feature fusion with a recognition rate of 94.5%; in the process of gesture classification, feature extraction is usually performed in the time domain, frequency domain and time-frequency domain. However, these feature values are often affected by multiple factors during the classification process, which leads to a decrease in the accuracy and robustness of the classification model. In order to solve the above technical problems, this application proposes a gesture recognition method based on entropy features and improved PSO-SVM. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies in the above-mentioned prior art and provide a gesture recognition method based on entropy features and improved PSO-SVM. The entropy features of surface electromyographic signals are extracted by variational mode decomposition method, and the support vector machine parameters are optimized by particle swarm optimization algorithm to construct a gesture classification model. This method effectively solves the influence of traditional time domain and frequency domain feature extraction methods on the robustness of gesture classification models, and improves classification accuracy and robustness.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is: a gesture recognition method based on entropy features and improved PSO-SVM, comprising the following steps: step S1: collecting surface electromyography signals of multiple gestures and preprocessing them; step S2: using variational mode decomposition method to perform multi-scale decomposition of surface electromyography signals and extract entropy features; step S3: using correlation analysis, random forest and Lasso method to reduce the dimension of entropy features to obtain reduced dimension feature data; step S4: using a gesture classification model to classify the reduced dimension feature data to realize gesture recognition.
[0006] Preferably, the pretreatment includes:
[0007] Step S101: Filtering the surface electromyography signal using a fourth-order Butterworth bandpass filter and a 50 Hz notch filter;
[0008] Step S102: Segment the surface electromyography signal of step S101 using a sliding window to extract the action segments and perform feature analysis.
[0009] Preferably, the variational mode decomposition comprises the following steps:
[0010] Step S201: Decompose the original surface electromyographic signal into K IMFs. Assuming that each IMF has a central frequency, construct a minimization objective function to achieve signal decomposition, as shown in formula (1):
[0011]
[0012] Where: u k (t) is the kth IMF; w k is the center frequency of the kth IMF; H is the Hibert transform, which is used to calculate the analytical representation of the signal; j is the imaginary unit; ||·|| is the calculation of the norm, which measures the energy of the signal;
[0013] Step S202: In order to ensure the rationality of the signal decomposition in step S201, a reconstruction error is introduced in formula (1) to ensure that the sum of the decomposed IMFs can reconstruct the original surface electromyographic signal, as shown in formula (2). On the basis of formula (1), a bandwidth limitation is introduced to facilitate limiting the bandwidth of each IMF, as shown in formula (3):
[0014]
[0015] In formula (3), α is the penalty factor, which controls the strictness of the bandwidth;
[0016] Step S203: In order to solve the optimal solution of formula (2) and formula (3), the augmented Lagrangian multiplier is introduced to obtain the augmented Lagrangian function, as shown in formula (4):
[0017]
[0018] Where: λ(t) is the Lagrange multiplier;
[0019] Step S204: Based on the augmented Lagrangian function of step S203, the alternating direction multiplier method is used to solve it. First, the IMF and center frequency are randomly initialized, and the initial Lagrangian multiplier λ(t) and the penalty factor α are set. Then, each IMF and center frequency is updated by minimizing the augmented Lagrangian function, as shown in Equations (5) and (6):
[0020]
[0021] Step S205: Continuously update the Lagrange multiplier based on the current IMF and the original surface electromyography signal, as shown in formula (7):
[0022]
[0023] If the Lagrange multiplier λ(t) satisfies the convergence condition, the iteration stops.
[0024] Preferably, the entropy features include approximate entropy features, energy entropy features, substitution entropy features, sample entropy features, singular spectral entropy features and spectral entropy features.
[0025] Preferably, the dimensionality reduction processing of entropy features using correlation analysis, random forest and Lasso method comprises the following steps:
[0026] Step S301: The correlation analysis performs feature selection through the Pearson coefficient, as shown in formula (14):
[0027]
[0028] Where: r represents the Pearson correlation coefficient; x i represents the eigenvalue of the i-th sample; y i Represents the target variable value of the i-th sample; Represents the sample eigenvalue x i The average value of Represents the sample target variable value y i The average value of
[0029] Step S302: The random forest implements feature selection by constructing multiple decision trees and synthesizing prediction results;
[0030] Step S303: The Lasso regression correlation analysis implements feature selection by constraining the weight coefficient. Eigenvalues with a weight coefficient of 0 are considered unimportant and are eliminated. The objective function is shown in formula (15):
[0031]
[0032] Where: y i is the target variable; x ij is the jth feature of the i-th sample; b j is the jth feature weight coefficient; l is the regularization parameter;
[0033] Step S304: Count the number of times each feature is selected in steps S301 to S303 through a voting mechanism, sort the features by the number of selections, and determine the optimal feature set.
[0034] Preferably, the gesture classification model is constructed by a support vector machine, comprising the following steps:
[0035] Step S401: Introduce slack variable ε i , construct the objective function as shown in formula (16):
[0036]
[0037] Where: w kl is the weight vector between category k and category l; C is the penalty coefficient;
[0038] Step S402: To ensure that each sample can be correctly classified in the binary classification model, a slack variable is used to construct a constraint condition, as shown in formula (17):
[0039]
[0040] Where: is the weight vector between category k and category l; b kl is the bias term between category k and category l; is the label in the binary classification model between the kth and lth categories of the i-th sample; ε i is a slack variable; φ(x i ) is the feature mapping function, which transforms the sample x in the original input space i Mapping to a higher-dimensional feature space;
[0041] Step S403: Introduce the Lagrange multiplier method to construct a binary classification model decision function, as shown in formula (18):
[0042]
[0043] Where: is the Lagrange multiplier in the binary classification model between the i-th sample category k and category l; is the label in the binary classification model between the i-th sample category k and category l; K(x,xi ) is the Gaussian kernel function; b kl is the bias term between category k and category l;
[0044] Step S404: For each binary classification model f kl (x), the output is a real value. In order to convert the real value into a category label, the sign function sign(x) is used, as shown in formula (19):
[0045]
[0046] Step S405: To determine the final category, the outputs of all binary classification models are summarized. For each category k, the number of votes in all binary classification models is counted, as shown in formula (20):
[0047] vote=∑ l≠k sign(f kl (x)) (20)
[0048] Step S406: Arrange the above formula to obtain a decision function, as shown in formula (21):
[0049]
[0050] Preferably, the classification accuracy of the gesture classification model is achieved by a particle swarm optimization algorithm. An improved particle swarm optimization algorithm is obtained based on the particle velocity update formula and position update formula. The improved particle swarm optimization algorithm can find the optimal parameter penalty coefficient C and kernel function γ in the optimal parameter space, thereby improving the accuracy of the gesture classification model.
[0051] The particle velocity update formula is shown in formula (22):
[0052] v i (t+1)=w·v i (t)+c1·r1·(p best -x i (t))+c2·r2·(g best -x i (t)) (22)
[0053] Where: c1, c2 are acceleration constants; r1, r2 are two random numbers; w is the inertia weight; p best is the best position found during the search for each particle; g best The best position found for all particles in the entire population; x i (t) is the particle position at time t, v i (t) represents the particle velocity at time t;
[0054] The particle position update formula is shown in formula (23):
[0055] x i (t+1)=x i (t)+v i (t+1) (23)
[0056] Preferably, the plurality of gestures include thumbs up, number six, number seven, fist, right-rotated palm and middle two fingers.
[0057] Compared with the prior art, the present invention has the following advantages:
[0058] 1. The present invention extracts the entropy features of surface electromyographic signals through the variational mode decomposition method, and optimizes the support vector machine parameters in combination with the particle swarm optimization algorithm to construct a gesture classification model. This effectively solves the impact of traditional time domain and frequency domain feature extraction methods on the robustness of the gesture classification model, and improves the classification accuracy and robustness.
[0059] 2. The entropy feature used in the present invention can effectively capture the information distribution characteristics in gesture images, and the improved PSO algorithm enhances the global search capability and parameter optimization effect by dynamically adjusting the inertia weight and adaptive acceleration constant strategies.
[0060] The present invention is further described in detail below through the accompanying drawings and examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a schematic diagram of hand gestures collected by the present invention;
[0062] Figure 2 This is the framework of the surface electromyography signal gesture recognition method of the present invention;
[0063] Figure 3 This is a signal comparison diagram before and after filtering of the surface electromyography signal of the present invention;
[0064] Figure 4 This is a variational mode decomposition IMF sample graph of the present invention;
[0065] Figure 5 This is a schematic diagram of the multi-classification support vector machine of the present invention;
[0066] Figure 6 It is the principle diagram of the particle swarm optimization algorithm of the present invention;
[0067] Figure 7 This is a comparison chart of the performance of the models of the present invention;
[0068] Figure 8 The confusion matrix diagrams of the four models are shown in Figure 2. DETAILED DESCRIPTION
[0069] The present invention discloses a gesture recognition method based on entropy features and improved PSO-SVM. A self-made data set is used. The surface electromyography signals of six gestures are collected through a dual-conductor electromyography sensor. The studied gestures include thumbs up, number six, number seven, fist clenching, right palm rotation and middle two fingers. Ten healthy volunteers (5 males and 5 females; age range: 21-24 years old) were recruited for the experiment. All volunteers voluntarily participated in the experiment and signed an informed consent form after fully understanding the experimental plan and purpose. The collected gestures are as follows: Figure 1 shown.
[0070] During the test, the two electrodes of the electromyography sensor are placed on the two muscles of the subject's left arm. The subject needs to keep his body upright with his arm suspended in the air. In order to improve the signal quality, the test area is wiped with alcohol before the test to ensure that the collected signal strength is sufficient. Each action lasts for 2-3 seconds during each acquisition, and a 3-second rest is taken after each action is completed. Each action is repeated 6 times. After the acquisition is completed, the data is preprocessed to remove the influence of noise, and feature extraction and optimal feature selection are performed. Finally, the selected features are used for gesture classification. The framework of the surface electromyography signal gesture recognition method is as follows: Figure 2 shown.
[0071] The hand gesture recognition method based on entropy features and improved PSO-SVM of the present invention comprises the following steps:
[0072] Step S1: collecting surface electromyographic signals of various gestures and preprocessing them;
[0073] The various gestures include thumbs up, number six, number seven, fist, right-handed palm, and middle two fingers.
[0074] Preprocessing includes:
[0075] Step S101: Filtering the surface electromyography signal using a fourth-order Butterworth bandpass filter and a 50 Hz notch filter;
[0076] When collecting surface electromyographic signals, the sampling frequency of the acquisition equipment is 1000Hz. The signal contains ECG signals and 50Hz power frequency interference. To improve the signal quality, a fourth-order Butterworth bandpass filter and a 50Hz notch filter are used to filter the signal; Figure 3 Shown is a comparison chart of the signal before and after filtering; Figure 3 (a) represents the data before filtering, Figure 3 (b) shows the data after filtering. It can be seen that the signal amplitude is reduced after filtering, effectively removing high-frequency noise and power frequency interference.
[0077] Step S102: Segment the surface electromyography signal of step S101 using a sliding window to extract the action segments and perform feature analysis.
[0078] In order to extract action segments from the preprocessed surface electromyographic signals and perform feature analysis, the sliding window method is used to segment the data. The acquisition frequency of the surface electromyographic signals is 1000 Hz, the sampling point length of the sliding window is set to 1000, the step size is 500, and 50% window overlap is achieved. Each data segment extracted by the window is decomposed using the variational mode decomposition technique.
[0079] Step S2: Using variational mode decomposition method to perform multi-scale decomposition on the surface electromyographic signal and extract entropy features;
[0080] Variational mode decomposition (VMD) is a signal decomposition method used to decompose complex signals into a set of sub-signals in different frequency bands. VMD can synchronously decompose multi-channel surface electromyography data, ensuring that the signal of each channel is decomposed into the same IMF (Intrinsic Mode Function). This helps to reveal the synergy between different muscles, assists in identifying different gestures, and achieves high-precision gesture recognition.
[0081] After the original surface EMG signal is preprocessed, variational modal decomposition is used to perform multi-scale classification on the surface EMG signal, decomposing the complex signal into a set of sub-signals (modal components) of different frequency bands, and calculating the entropy value of each modal component; for each data segment extracted by the window, variational modal decomposition technology is used to decompose it and extract entropy features.
[0082] The variational mode decomposition comprises the following steps:
[0083] Step S201: Decompose the original surface electromyographic signal into K IMFs. Assuming that each IMF has a central frequency, construct a minimization objective function to achieve signal decomposition, as shown in formula (1):
[0084]
[0085] Where: u k (t) is the kth IMF; w k is the center frequency of the kth IMF; H is the Hibert transform, which is used to calculate the analytical representation of the signal; j is the imaginary unit; ||·|| is the calculation of the norm, which measures the energy of the signal;
[0086] Step S202: In order to ensure the rationality of the signal decomposition in step S201, a reconstruction error is introduced in formula (1) to ensure that the sum of the decomposed IMFs can reconstruct the original surface electromyographic signal, as shown in formula (2). On the basis of formula (1), a bandwidth limitation is introduced to facilitate limiting the bandwidth of each IMF, as shown in formula (3):
[0087]
[0088] In formula (3), α is the penalty factor, which controls the strictness of the bandwidth;
[0089] The α in formula (3) is used to balance the relationship between the bandwidth minimization term and the reconstruction error term. A larger α means a stricter bandwidth limit. δ(t) is the Dirac delta function, which has an infinitely high peak at t = 0 and is zero elsewhere. Represents the partial derivative with respect to time t, which is used to calculate the rate of change of the signal.
[0090] Step S203: In order to solve the optimal solution of formula (2) and formula (3), the augmented Lagrangian multiplier is introduced to obtain the augmented Lagrangian function, as shown in formula (4):
[0091]
[0092] Where: λ(t) is the Lagrange multiplier;
[0093] In the formula, λ(t) is used to handle the constraints as part of the augmented Lagrangian function to ensure that the sum of the decomposed IMFs can accurately reconstruct the original signal f(t). The penalty factor α is used as a weight coefficient to affect the importance of the bandwidth limitation term in the entire objective function.
[0094] Step S204: Based on the augmented Lagrangian function of step S203, the alternating direction multiplier method is used to solve it. First, the IMF and center frequency are randomly initialized, and the initial Lagrangian multiplier λ(t) and the penalty factor α are set. Then, each IMF and center frequency is updated by minimizing the augmented Lagrangian function, as shown in Equations (5) and (6):
[0095]
[0096] In updating each IMF's u k (t) and center frequency w k In the process, when the change between two consecutive iterations is less than the absolute convergence tolerance, the algorithm is considered to have converged and the iteration is stopped.
[0097] Step S205: Continuously update the Lagrange multiplier based on the current IMF and the original surface electromyography signal, as shown in formula (7):
[0098]
[0099] If the Lagrange multiplier λ(t) satisfies the convergence condition, the iteration stops.
[0100] The above formula is the update rule of the Lagrange multiplier λ(t). Formula (7) describes how to continuously update the Lagrange multiplier based on the current IMF component and the original surface electromyography signal to ensure that specific constraints are met.
[0101] The purpose of variational mode decomposition is to extract entropy features from the decomposed IMF. Therefore, it is necessary to select reasonable parameters for decomposition. If the K value is too small, the frequencies in the signal cannot be fully decomposed. If the K value is too large, the noise components in the signal may be decomposed. The penalty factor α is used to control the bandwidth. If α is too small, modes of different frequencies will be aliased. If α is too large, high-frequency components will be suppressed, resulting in partial information loss. Therefore, it is crucial to reasonably determine the parameters. Table 1 lists the optimal parameter values determined through experiments. Figure 4 IMF sample graph generated by variational mode decomposition for a segment of electromyographic signal.
[0102] Table 1 VMD decomposition parameters
[0103]
[0104] The absolute convergence tolerance is used to determine whether the optimization process has converged. When the change in the objective function value between two consecutive iterations is less than the tolerance, the optimization process is considered to have converged, the iteration is stopped, and the final IMF decomposition result is output. Otherwise, the next iteration is continued. The value of the absolute convergence tolerance in Table 1 is an empirical value that can strike a balance between accuracy and computational efficiency.
[0105] By adjusting the penalty factor α, the strictness of the bandwidth restriction is controlled to obtain a reasonable IMF decomposition result. Different α values will affect the separation of different frequency modes. Too small α values may cause modal aliasing, while too large α values may suppress high-frequency components and cause information loss. The penalty factor values given in Table 1 are experimentally verified optimal values that are suitable for the current application scenario.
[0106] The appropriate number of IMFs is selected based on the complexity of the signal and the actual application requirements. The number of IMFs determines how many intrinsic mode functions the original signal is decomposed into. A reasonable number of IMFs can ensure that each decomposed IMF has a clear physical meaning and application value. In the VMD algorithm, a reasonable number of IMFs, K, is set, the original signal is decomposed into K IMFs, and the spectral characteristics of each IMF are checked to ensure that it has a clear physical meaning. The IMF number values given in Table 1 can effectively decompose the main features in the signal;
[0107] The initialization method is used to randomly initialize the IMF and center frequency, which is an important part of the VMD algorithm. A reasonable initialization method can improve the convergence speed and stability of the algorithm. Before the VMD algorithm starts, the initial IMF and center frequency are randomly generated according to the selected initialization method. The initial IMF and center frequency are used as input for subsequent optimization and update processes. The initialization method given in Table 1 is Peaks. Since the Peaks method usually determines the initial center frequency based on the peak value of the signal, this method can better capture the main frequency components of the signal.
[0108] Entropy features include approximate entropy features, energy entropy features, substitution entropy features, sample entropy features, singular spectral entropy features and spectral entropy features.
[0109] The complex surface electromyographic signal is decomposed into four intrinsic mode functions (IMFs) through variational mode decomposition technology. The entropy feature is calculated for each decomposed intrinsic mode function. The six entropy features, namely approximate entropy, energy entropy, permutation entropy, sample entropy, singular spectrum entropy and spectral entropy, are used to effectively characterize the complexity and irregularity of the electromyographic signal, thereby improving the accuracy of gesture classification. Equations (8) to (13) are the eigenvalue calculation formulas.
[0110] Formula (8) is the approximate entropy (ApEn), which is used to measure the complexity and randomness of the signal.
[0111] ApEn(m,r,N)=φ m (r)-φ m+1 (r) (8)
[0112] Where: φ m (r) represents the average natural logarithm probability of similar vectors in dimension m; m is the embedding dimension; r is the similarity tolerance; N is the data length.
[0113] Equation (9) is the energy entropy (EEnt), which reflects the uniformity of signal energy distribution.
[0114]
[0115] Where: N represents the number of frequency bands or time windows into which the signal is divided; p i It represents the energy proportion of the i-th frequency band or time window, that is, the ratio of the energy of the i-th sub-segment to the total energy.
[0116] Formula (10) is the permutation entropy (PE) that analyzes the arrangement pattern of the signal sequence to quantify the complexity.
[0117]
[0118] Where: p i Indicates the relative frequency of the arrangement pattern.
[0119] Formula (11) is the sample entropy (SampEn), which is used to measure the regularity of the signal sequence.
[0120]
[0121] Where: A represents the number of similar fragments when the template length is m+1, and B represents the number of similar fragments when the template length is m.
[0122] Formula (12) is the singular spectrum entropy (SSE) to extract the main components of the signal.
[0123]
[0124] Where: d represents the number of singular values, that is, the number of singular values obtained after singular value decomposition; λ i It represents the ratio of the i-th singular value to the total singular values.
[0125] Formula (13) is the spectral entropy (SpEnt), which measures the uniformity of the energy distribution of the signal in the frequency domain.
[0126]
[0127] Where: N represents the number of spectral components of the signal; x i Represents the energy proportion of the i-th spectral component.
[0128] By extracting the entropy features of the electromyographic signal and using them as the input features of the gesture classification model, the accuracy of gesture classification can be effectively improved. Specifically, the entropy features can improve the classification performance in the following aspects: 1) Enhance the discriminability of features: The entropy features can characterize the complexity and irregularity of the electromyographic signal from multiple angles, thereby enhancing the feature differences between different gesture signals and improving the discrimination ability of the gesture classification model; 2) Reduce the redundancy of features: Entropy features usually have lower dimensions and better independence, which can reduce the redundancy between features, reduce the computational complexity of the gesture classification model, and improve classification efficiency; 3) Improve the robustness of features: Entropy features are highly robust to noise and interference, and can suppress the influence of noise and interference to a certain extent, thereby improving the robustness of the gesture classification model; 4) Fusion of multiple information: By fusing multiple entropy features, we can comprehensively utilize the time domain, frequency domain, and time-frequency domain information of the signal, thereby improving the comprehensive performance of the gesture classification model.
[0129] Step S3: Using correlation analysis, random forest and Lasso methods to reduce the dimension of entropy features and obtain reduced dimension feature data;
[0130] High-dimensional data not only increases the computational burden but also affects the accuracy and generalization ability of the gesture classification model. To reduce the dimensionality of the feature space and improve classification performance, three effective feature selection methods are adopted: correlation analysis, random forest, and Lasso regression. These three methods evaluate the importance of features from different perspectives and can effectively screen out the most representative features, thereby significantly reducing the dimensionality of the feature space and improving the accuracy and robustness of the gesture classification model.
[0131] The method of using correlation analysis, random forest and Lasso method to reduce the dimension of entropy features includes the following steps:
[0132] Step S301: The correlation analysis performs feature selection through the Pearson coefficient, as shown in formula (14):
[0133]
[0134] Where: r represents the Pearson correlation coefficient; x i represents the eigenvalue of the i-th sample; y i Represents the target variable value of the i-th sample; Represents the sample eigenvalue x i The average value of Represents the sample target variable value y i The average value of
[0135] The above formula is used to select features with high correlation with the target variable from the extracted entropy features. By calculating the Pearson correlation coefficient between each entropy feature and the target variable, features with strong predictive ability for the target variable can be selected, thereby reducing feature redundancy and improving the generalization ability and computational efficiency of the model.
[0136] Step S302: The random forest implements feature selection by constructing multiple decision trees and synthesizing prediction results;
[0137] Step S303: The Lasso regression correlation analysis implements feature selection by constraining the weight coefficient. Eigenvalues with a weight coefficient of 0 are considered unimportant and are eliminated. The objective function is shown in formula (15):
[0138]
[0139] Where: y i is the target variable; x ij is the jth feature of the i-th sample; b jis the jth feature weight coefficient; l is the regularization parameter; N is the number of samples; b0 is the constant part in the linear regression model, representing the intercept term, which is used to capture the overall trend and offset of the data and help the model fit the data;
[0140] Step S304: Count the number of times each feature is selected in steps S301 to S303 through a voting mechanism, sort the features by the number of selections, and determine the optimal feature set.
[0141] Three feature dimensionality reduction methods are used to independently screen out a set of important features from the original feature set. The Pearson correlation coefficient measures the linear correlation between the features and the target variable and selects the features with the highest correlation; the random forest selects the features with the highest importance score by evaluating the split contribution of the features in all decision trees; the Lasso regression uses L1 regularization to constrain the feature weight coefficients and screen out features with non-zero weight coefficients; the voting mechanism combines the advantages of the three methods, counts the number of times each feature is selected, and sorts the features by the number of selections, and finally determines the top 10 features with the highest frequency as the optimal feature set; Table 2 shows the feature sets selected using each dimensionality reduction algorithm.
[0142] Table 2. Scores of three algorithms for feature selection
[0143] Feature Set Relevance score Importance score Weight coefficient Channel2_IMF3_Sample_Entropy 0.12243 0.00236 -0.45791 Channel2_IMF4_Approximate_Entropy 0.17270 0.00000 -0.42791 Channel2_IMF3_Spectral_Entropy 0.14689 0.00000 0.18735 Channel2_IMF2_Approximate_Entropy 0.12383 0.00000 -0.23465 Channel1_IMF4_SingularSpectrum_Entropy 0.12107 0.00000 -0.26064 Channel1_IMF2_Spectral_Entropy 0.00000 0.00205 0.24905 Channel2_IMF1_Spectral_Entropy 0.10265 0.00000 0.22632 Channel1_IMF3_Spectral_Entropy 0.09794 0.00136 0.00000 Channel2_IMF4_Spectral_Entropy 0.08943 0.00000 0.19094 Channel2_IMF1_Sample_Entropy 0.00000 0.00373 0.22632
[0144] As can be seen from Table 2, Channel2_IMF4_Approximate_Entropy and Channel2_IMF3_Sample_Entropy are the most important features. They show high scores or coefficient values in all three algorithms and play an important role in the prediction of the target variable. Channel1_IMF3_Spectral_Entropy performs well in the random forest model, but performs averagely in correlation and Lasso regression. The other features perform poorly in all three algorithms and can be considered unimportant features, which can be removed from the model. Through the above analysis, we can select features with strong predictive ability for the target variable, thereby improving the performance and explanatory power of the model.
[0145] Step S4: using a gesture classification model to classify the reduced-dimensional feature data to achieve gesture recognition.
[0146] Support vector machines (SVMs) are widely used to construct gesture classification models due to their ability to find optimal classification hyperplanes in high-dimensional feature spaces. However, the performance of SVMs is highly dependent on the selection of their hyperparameters. Traditional network search methods, while intuitive, are computationally intensive in high-dimensional parameter spaces and easily fall into local optimal solutions, making it difficult to find the globally optimal parameter combination. To address this issue, an improved SVM hyperparameter optimization method based on the particle swarm optimization (PSO) algorithm is proposed. PSO is a heuristic global optimization algorithm that can efficiently explore the optimal parameter combination by simulating the movement of particles in the search space, thereby improving the classification performance of SVMs. Figure 5 This is the principle diagram of multi-classification support vector machine.
[0147] The gesture classification model is constructed by a support vector machine and includes the following steps:
[0148] Step S401: Introduce slack variable ε i , construct the objective function as shown in formula (16):
[0149]
[0150] Where: w kl is the weight vector between category k and category l; C is the penalty coefficient;
[0151] For multi-classification problems, the "one-to-one" method is often used to build a support vector machine model; in the "one-to-one" method, a binary support vector machine model is trained for each pair of categories (k, l). Since surface electromyography signals are not linearly separable, it is impossible to find a hyperplane that completely separates all positive and negative samples, so the slack variable ε is introduced. i , allowing some sample classifications to be outside the classification range.
[0152] Step S402: To ensure that each sample can be correctly classified in the binary classification model, a slack variable is used to construct a constraint condition, as shown in formula (17):
[0153]
[0154] Where: is the weight vector between category k and category l; b kl is the bias term between category k and category l; is the label in the binary classification model between the kth and lth categories of the i-th sample; ε i is a slack variable; φ(x i ) is the feature mapping function, which transforms the sample x in the original input space iMapping to a higher-dimensional feature space;
[0155] Step S403: Introduce the Lagrange multiplier method to construct a binary classification model decision function, as shown in formula (18):
[0156]
[0157] Where: is the Lagrange multiplier in the binary classification model between the i-th sample category k and category l; is the label in the binary classification model between the i-th sample category k and category l; K(x,x i ) is the Gaussian kernel function; b kl is the bias term between category k and category l;
[0158] The decision function of the binary classification model is mainly used to determine the category of the sample and measure the classification confidence. Its output value helps to determine which category the sample belongs to and the degree of confidence in the classification.
[0159] Step S404: For each binary classification model f kl (x), the output is a real value. In order to convert the real value into a category label, the sign function sign(x) is used, as shown in formula (19):
[0160]
[0161] Step S405: To determine the final category, the outputs of all binary classification models are summarized. For each category k, the number of votes in all binary classification models is counted, as shown in formula (20):
[0162] vote=∑ l≠k sign(f kl (x)) (20)
[0163] Step S406: Arrange the above formula to obtain a decision function, as shown in formula (21):
[0164]
[0165] The classification accuracy of the support vector machine depends on the hyperparameter penalty coefficient C and the kernel function γ. The particle swarm optimization algorithm (PSO) is used to search for the optimal solution globally to avoid falling into the local optimal solution. The particle swarm optimization algorithm does not require gradient calculation of the objective function, is suitable for discontinuous objective functions, and can optimize two hyperparameters at the same time to ensure that each sub-model can achieve the best performance. In the traditional PSO algorithm, the inertia weight w is fixed, which will cause the algorithm to converge more slowly in the later stage of the search. This application adopts a dynamically adjusted inertia weight strategy, assigning a larger w value in the early stage of the search to enhance the global search capability, and gradually reducing the w value in the later stage of the search to improve the local search accuracy.
[0166] The classification accuracy of the gesture classification model is achieved by the particle swarm optimization algorithm. An improved particle swarm optimization algorithm is obtained based on the particle velocity update formula and position update formula. The improved particle swarm optimization algorithm can find the optimal parameter penalty coefficient C and kernel function γ in the optimal parameter space, so as to improve the accuracy of the gesture classification model. The flowchart of the improved particle swarm optimization algorithm is as follows: Figure 6 As shown;
[0167] Assume that each particle represents a candidate solution in the solution space, and the particle position x i =(x1,x2,x3,......,x n ), particle velocity v i =(v1,v2,v3,......,v n );
[0168] The particle velocity update formula is shown in formula (22):
[0169] v i (t+1)=w·v i (t)+c1·r1·(p best -x i (t))+c2·r2·(g best -x i (t)) (22)
[0170] Where: c1, c2 are acceleration constants; r1, r2 are two random numbers; w is the inertia weight; p best is the best position found during the search for each particle; g best The best position found for all particles in the entire population; x i (t) is the particle position at time t, v i (t) represents the particle velocity at time t;
[0171] The particle position update formula is shown in formula (23):
[0172] x i (t+1)=xi (t)+v i (t+1) (23)
[0173] Through the position update formula and velocity update formula, the dynamic change law of particles in the optimization process can be obtained, thereby realizing the effective exploration and optimization of the problem solution space.
[0174] To evaluate the performance of the gesture classification model, we use four metrics: Accuracy, Precision, Recall, and F1-Score. The calculation formulas are shown in Equations 24-27:
[0175]
[0176] Where: TP represents the number of samples correctly predicted as positive; TN represents the number of samples correctly predicted as negative; FP represents the number of samples incorrectly predicted as positive; FN represents the number of samples incorrectly predicted as negative.
[0177] Figure 7 Represents the evaluation results of accuracy, precision, recall and F1-Score of the six classification models on the dataset, Figure 8 It can be seen that the accuracy of PSO-SVM is 13.3% higher than that of SVM, 3.06% higher than that of stacking model, and 10.91% higher than that of CNN; the three indicators of precision, recall rate and F1-Score also perform well. In terms of precision, PSO-SVM is 16.2% higher than that of traditional SVM and 10.7% higher than that of CNN; the recall rate of PSO-SVM is 14.4% higher than that of traditional SVM and 10.6% higher than that of CNN-GRU; the F1 score of PSO-SVM is 5.51% higher than that of Bayes-SVM and 11.06% higher than that of CNN; through comparison, the PSO-SVM classification model is more suitable for recognizing entropy features for gesture classification.
[0178] In machine learning, cross-validation is a commonly used model evaluation method used to assess the generalization ability of a model. Different folds will affect the model training and testing process, thereby affecting the final model performance indicators. When performing model evaluation, first, set the initial parameters of the particle swarm optimization algorithm, such as inertia factor, learning factor, number of iterations, population size, and search range. Secondly, use different folds to split the data set, train and test the model separately, and calculate the corresponding performance indicators. Then, compare the model performance indicators under different folds, and select the fold with the best performance as the final cross-validation strategy. Finally, based on the selected fold, further adjust the parameters of the particle swarm optimization algorithm to obtain better model performance.
[0179] To fully evaluate the model performance and utilize gesture data, the experiment used 2-, 5-, 7-, 10-, and 15-fold cross-validation to evaluate the model performance. Table 3 shows that as the number of folds increases, the overall performance indicators of the model show an upward trend. Among them, the accuracy of the 15-fold cross-validation reaches 97.3%, and the F1-Score reaches 97.20%, both of which are the highest values. Under 15-fold cross-validation, the accuracy, precision, recall, and F1-Score of the model all reach the highest values. A higher number of folds means that more training data is used for model training, thereby better capturing the distribution characteristics of the data and reducing the risk of overfitting. Although the model performance indicators show an upward trend as the number of folds increases, considering the computational cost and actual application requirements, 15-fold cross-validation achieves a good balance between performance and efficiency.
[0180] Table 3 Performance indicators of different fold models
[0181]
[0182] The particle swarm optimization algorithm is used to optimize the support vector machine hyperparameters. The final parameters are determined by selecting different folds. Table 4 shows the parameter selection of the particle swarm optimization algorithm.
[0183] Table 4 Parameter selection
[0184]
[0185] As can be seen from the above, the particle swarm optimization algorithm parameters in Table 4 are used to optimize the performance indicators of the model in Table 3. By reasonably setting the parameters of the particle swarm optimization algorithm, the performance indicators such as accuracy, precision, recall rate and F1-Score of the model can be improved. After determining the appropriate fold (such as 10 folds in Table 3), the particle swarm optimization algorithm parameters in Table 4 can be further adjusted according to the model performance under the fold to obtain better model performance. The parameters and performance indicators in Tables 3 and 4 interact and influence each other. Reasonable particle swarm optimization algorithm parameters can improve model performance, and the improvement of model performance can guide the further optimization of parameters.
[0186] Therefore, by setting reasonable parameters to optimize the hyperparameters of the support vector machine and finding the most suitable parameters within the largest range, the accuracy of the gesture classification model can be improved.
[0187] Figure 8The performance of four different models on the data set is shown, namely support vector machine (SVM), Bayesian optimization support vector machine, Stacking model and particle swarm optimization support vector machine, and the trained model is used to predict the test set to obtain the prediction results of each sample. The prediction results are compared with the actual labels, and the number of correct predictions and incorrect predictions of each category are counted to form a confusion matrix. The diagonal elements represent the number of correct classifications, and the non-diagonal elements represent the number of incorrect classifications. Figure 8 It can be seen that the particle swarm optimization support vector machine (PSO-SVM) model has a better performance in gesture classification. The diagonal elements are all correctly classified, and the off-diagonal elements are all 0.
[0188] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural transformation made to the above embodiment based on the technical essence of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A gesture recognition method based on entropy features and improved PSO-SVM, characterized in that: The following steps are involved: Step S1: collecting surface electromyographic signals of various gestures and performing preprocessing; Step S2: Using variational mode decomposition method to perform multi-scale decomposition on the surface electromyographic signal and extract entropy features; Step S3: Using correlation analysis, random forest and Lasso methods to reduce the dimension of entropy features and obtain reduced dimension feature data; Step S4: using a gesture classification model to classify the reduced-dimensional feature data to achieve gesture recognition.
2. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The pretreatment includes: Step S101: Filtering the surface electromyography signal using a fourth-order Butterworth bandpass filter and a 50 Hz notch filter; Step S102: Segment the surface electromyography signal of step S101 using a sliding window to facilitate feature analysis after extracting the action segments.
3. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The variational mode decomposition comprises the following steps: Step S201: Decompose the original surface electromyographic signal into K IMFs. Assuming that each IMF has a center frequency, construct a minimization objective function to achieve signal decomposition, as shown in formula (1): Where: u k (t) is the kth IMF; w k is the center frequency of the kth IMF; H is the Hibert transform, which is used to calculate the analytical representation of the signal; j is the imaginary unit; ||·|| is the calculation of the norm, which measures the energy of the signal; Step S202: In order to ensure the rationality of the signal decomposition in step S201, a reconstruction error is introduced in formula (1) to ensure that the sum of the decomposed IMFs can reconstruct the original surface electromyographic signal, as shown in formula (2). On the basis of formula (1), a bandwidth limitation is introduced to facilitate limiting the bandwidth of each IMF, as shown in formula (3): In formula (3), α is the penalty factor, which controls the strictness of the bandwidth; Step S203: In order to solve the optimal solution of formula (2) and formula (3), the augmented Lagrangian multiplier is introduced to obtain the augmented Lagrangian function, as shown in formula (4): Where: λ(t) is the Lagrange multiplier; Step S204: Based on the augmented Lagrangian function of step S203, the alternating direction multiplier method is used to solve it. First, the IMF and center frequency are randomly initialized, and the initial Lagrangian multiplier λ(t) and the penalty factor α are set. Then, each IMF and center frequency is updated by minimizing the augmented Lagrangian function, as shown in Equations (5) and (6): Step S205: Continuously update the Lagrange multiplier based on the current IMF and the original surface electromyography signal, as shown in formula (7): If the Lagrange multiplier λ(t) meets the convergence condition, the iteration is stopped.
4. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The entropy features include approximate entropy features, energy entropy features, substitution entropy features, sample entropy features, singular spectrum entropy features and spectrum entropy features.
5. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The method of using correlation analysis, random forest and Lasso method to reduce the dimension of entropy features includes the following steps: Step S301: The correlation analysis performs feature selection through the Pearson coefficient, as shown in formula (14): Where: r represents the Pearson correlation coefficient; x i represents the eigenvalue of the i-th sample; y i Represents the target variable value of the i-th sample; Represents the sample eigenvalue x i The average value of Represents the sample target variable value y i The average value of Step S302: The random forest implements feature selection by constructing multiple decision trees and synthesizing prediction results; Step S303: The Lasso regression correlation analysis implements feature selection by constraining the weight coefficient. Eigenvalues with a weight coefficient of 0 are considered unimportant and are eliminated. The objective function is shown in formula (15): Where: y i is the target variable; x ij is the jth feature of the i-th sample; b j is the jth feature weight coefficient; l is the regularization parameter; Step S304: Count the number of times each feature is selected in steps S301 to S303 through a voting mechanism, sort the features by the number of selections, and determine the optimal feature set.
6. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The gesture classification model is constructed by a support vector machine and includes the following steps: Step S401: Introduce slack variable ε i , construct the objective function as shown in formula (16): Where: w kl is the weight vector between category k and category l; C is the penalty coefficient; Step S402: To ensure that each sample can be correctly classified in the binary classification model, a slack variable is used to construct a constraint condition, as shown in formula (17): Where: is the weight vector between category k and category l; b kl is the bias term between category k and category l; is the label in the binary classification model between the kth and lth categories of the i-th sample; ε i is a slack variable; φ(x i ) is the feature mapping function, which transforms the sample x in the original input space i Mapping to a higher dimensional feature space; Step S403: Introduce the Lagrange multiplier method to construct a binary classification model decision function, as shown in formula (18): Where: is the Lagrange multiplier in the binary classification model between the i-th sample category k and category l; is the label in the binary classification model between the i-th sample category k and category l; K(x,x i ) is the Gaussian kernel function; b kl is the bias term between category k and category l; Step S404: For each binary classification model f kl (x), the output is a real value. In order to convert the real value into a category label, the sign function sign(x) is used, as shown in formula (19): Step S405: To determine the final category, the outputs of all binary classification models are summarized. For each category k, the number of votes in all binary classification models is counted, as shown in formula (20): vote=∑ l≠k sign(f kl (x)) (20) Step S406: Arrange the above formula to obtain a decision function, as shown in formula (21):
7. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The classification accuracy of the gesture classification model is achieved through a particle swarm optimization algorithm. An improved particle swarm optimization algorithm is obtained based on the particle velocity update formula and position update formula. The improved particle swarm optimization algorithm can find the optimal parameter penalty coefficient C and kernel function γ in the optimal parameter space, thereby improving the accuracy of the gesture classification model. The particle velocity update formula is shown in formula (22): v i (t+1)=w·v i (t)+c1·r1·(p best -x i (t))+c2·r2·(g best -x i (t)) (22) Where: c1, c2 are acceleration constants; r1, r2 are two random numbers; w is the inertia weight; p best is the best position found during the search for each particle; g best The best position found for all particles in the entire population; x i (t) is the particle position at time t, v i (t) represents the particle velocity at time t; The particle position update formula is shown in formula (23): x i (t+1)=x i (t)+v i (t+1) (23) 8. The gesture recognition method based on entropy features and improved PSO-SVM according to claim 1, characterized in that: The multiple gestures include thumbs up, number six, number seven, fist, right-rotated palm, and middle two fingers.
Citation Information
Cited By
Feature collaborative optimization hand action recognition method based on surface electromyogram signals
CN121479452A