Similarity gesture recognition method of surface electromyography signal based on interpretable deep learning
By adopting an interpretable deep learning method in the recognition of similar gestures of surface electromyography signals, combined with Shapley value analysis and model optimization, the problem of low accuracy of similar gesture recognition is solved, and higher recognition accuracy and interpretability are achieved.
Patent Information
- Application Number
- CN202311272367.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2043-09-27
AI Technical Summary
The prior art has low accuracy when identifying similar gestures, especially between similar gestures controlled by nearly the same muscle contraction pattern, which traditional machine learning and deep learning methods are difficult to effectively recognize.
Using an interpretable deep learning method, a deep learning recognition model is built through surface electromyography signal acquisition and preprocessing, and interpretability analysis is introduced. The contribution of each electrode channel to the recognition of similar gestures is used to quantify the contribution of each electrode channel, and the recognition model is optimized to improve recognition performance.
Improve the accuracy and reliability of similar gesture recognition, provide interpretability analysis of the recognition process, enhance understanding of the recognition process, and serve as feedback to improve recognition performance.
Smart Images

Figure CN117312985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of surface electromyography signal similarity gesture recognition, and in particular to a surface electromyography signal similarity gesture recognition method based on interpretable deep learning. Background Art
[0002] Advances in the fields of artificial intelligence and hardware devices have stimulated interest in human-computer interaction. Gesture recognition plays a vital role in facilitating this interaction, especially in assistive and rehabilitation devices such as robotic prostheses and hand exoskeletons, which rely heavily on surface electromyography signals. These signals are captured by sensors placed on the skin above the muscles responsible for gestures and are subsequently processed and analyzed using various signal processing techniques and artificial intelligence algorithms to identify the specific muscle activation patterns associated with each gesture. One of the most important aspects of gesture recognition based on surface electromyography is similar gesture recognition, which is able to identify similar gestures, including grasping, functional movements, and many other daily life actions. This recognition helps to accurately control virtual objects or prosthetic hands using natural gestures, thereby enhancing user experience and device functionality.
[0003] Gestures are mainly controlled by contractions of various hand muscles, and surface electromyography (EMG) signals are recorded from muscle fibers during their contraction and relaxation phases. Therefore, current recognition methods mainly focus on extracting the best features based on surface electromyography (EMG) signals and developing practical classification algorithms. However, in scenarios where there are slight differences between similar gestures controlled by almost identical muscle contraction patterns, the recognition accuracy is usually low regardless of whether traditional machine learning or deep learning methods are used. The main obstacle to recognizing similar gestures is the almost identical hand muscle contraction patterns. But even similar gestures can show subtle differences in muscle strength and changes in the composition of muscle synergies, which can be captured by surface electromyography acquisition electrode channels. Despite the great attention paid to this area, no research has yet investigated the contribution of different channels in similar gesture recognition. In addition, deep learning-based methods are often used for gesture recognition, and these methods are often regarded as "black box" systems. Using these methods, we can only observe the input and output of the deep learning model, but it is difficult to understand why the neural network makes a specific decision. Therefore, developing effective solutions to address this challenge is crucial to improve the accuracy and reliability of similar gesture recognition based on surface electromyography signals. The existing technology does not consider the feature similarity of similar actions, and needs to extract features manually. It also lacks feature correlation to explain the differences between different individuals, which makes the design method less universal. It does not evaluate and analyze the extracted information, and there is a lot of redundant information. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a surface electromyography signal similarity gesture recognition method based on interpretable deep learning, which mainly includes:
[0005] S1: Surface electromyography signal acquisition and preprocessing;
[0006] S2: Based on the processed surface electromyography signals, a recognition model is built based on deep learning;
[0007] S3: Introducing interpretability analysis on the recognition model;
[0008] S4: Optimize the recognition model with the introduction of interpretability analysis;
[0009] S5: Using the optimized recognition model to recognize the surface electromyography signal actually obtained.
[0010] Furthermore, in step S1, the process of surface electromyography signal acquisition and preprocessing is as follows:
[0011] Connect N surface electromyography signal sensors to the forearm for signal collection, and then perform denoising on the surface electromyography signals collected by the N surface electromyography signal sensors; set the collection time to T and the collection frequency to F, and you can get a TF×N data matrix; the column number of the matrix represents the electrode number corresponding to the surface electromyography sensor, and the number of rows is the product of the sampling time and frequency; each row of the data matrix is assigned a label corresponding to the gesture being performed; each row is marked as i, indicating the type of gesture performed at that moment;
[0012] In order to detect the active segments in the surface EMG data, they are divided into action mode and rest mode according to the label i. The labels of each row are scanned, and the data marked with i = 0 are classified as rest mode, while the data corresponding to the non-zero label are classified as action mode;
[0013] Set an M×N analysis window to analyze the surface EMG data, select only the data of the action mode, and set the sliding step of the analysis window to s. The M×N array with the same gesture label i is considered to be valid data. The label of the array is defined as i. The number of arrays K can be calculated as:
[0014]
[0015] Wherein, M represents the width of the set analysis window; N represents the length of the set analysis window, and the size of N is the number of collection electrodes;
[0016] Each array is converted to an M×N matrix A k , where k∈(1,K), then for the matrix A kNormalize and map its value to the range of (0,255), which can be calculated as
[0017]
[0018] Among them, minA k Indicates the minimum value in the mapping range, maxA k Indicates the maximum value within the mapping range; Represents the matrix A k The new matrix after the value is mapped to (0, 255) is the matrix required to convert the grayscale image;
[0019] The valid array data with gesture label i is converted into K grayscale images, each of which has a size of M×N. In order to improve the accuracy of similar gesture recognition, three adjacent grayscale images with the same gesture label are combined to form a three-dimensional color image, thus obtaining a data set of surface electromyography color images.
[0020] Further, in step S2, an image-level deep convolutional neural network architecture is used to establish a recognition model, which takes the surface electromyography signal color image as input and uses deep learning technology to recognize patterns in these images; the recognition model includes a convolution layer, a fully connected layer and a softmax layer;
[0021] Extract features from the surface electromyography color image. The lth convolutional layer accepts input α (l) , and by changing α (l) With the convolution kernel ω (l) Convolution is performed to produce output O (l) ; The receptive field size of the convolution kernel is A×B, the sliding length is z, and the bias term is β (l) , the calculation performed by the convolutional layer is:
[0022]
[0023] Where x represents the xth row in the image; y represents the yth column in the image; * represents the convolution operation; represents the input of the lth convolutional layer, represents the value of the ath row and bth column of the lth layer convolution kernel in the receptive field A×B, and a and b represent the ath row and bth column in the receptive field A×B;
[0024] The cross entropy based loss function is defined as:
[0025]
[0026] Among them, p i represents the actual output probability of gesture i; q irepresents the expected output probability of gesture i;
[0027] This loss function is used to train the recognition model during the offline training phase to ensure that the recognition model can accurately predict each gesture associated with the surface EMG color image.
[0028] Furthermore, the specific implementation process of step S3 is:
[0029] First, the total contribution of the surface electromyography data obtained from all input electrode channels in a similar gesture recognition task is calculated. The total contribution of the task refers to the difference between the output f(C) obtained after all channel signals are input into the recognition model and the output obtained when there is no input. The total contribution of all channels can be calculated as:
[0030]
[0031] in, Indicates zero input; represents the Shapley value of the nth input electrode channel, n = 1, 2, ..., N, N represents the total number of input electrode channels;
[0032] Then, the total contribution obtained by the N input electrode channels must be fairly distributed to each channel. The Shapley value is used as a measure of the impact of each channel on gesture recognition performance when the channel participates or does not participate in the recognition task. The Shapley value of each channel is calculated by weighting and aggregating the possible combinations of all electrode channels. Based on this, the Shapley value of each channel represents its contribution to similar gesture recognition tasks and can be calculated as
[0033]
[0034] Where N represents the total number of electrode channels; S represents the number of channels participating in game interaction; v(S) represents the contribution value of S; v(S∪{n})-v(S) represents the marginal contribution of channel N to participating in S; |S|! represents the numerical factorial of the number of channels participating in game interaction; |N|! represents the numerical factorial of the total number of electrode channels; |S| represents the number of channels participating in game interaction; |N| represents the total number of electrode channels; N\{n} represents the set after removing element n from set N;
[0035] In the task of recognizing similar gestures, the calculation process of the Shapley value is determined by the game interaction between the surface electromyography signal electrode channels. In order to ensure the accurate estimation of the contribution of each channel, a permutation and combination technique is used to ensure the coverage of the interaction between all channels in the game. Specifically, all possible length combinations ranging from 1 to N are calculated, and each combination corresponds to a round of game interaction.
[0036] For each round of game interaction, the input electrode channels are set according to the corresponding combination. The channels that are part of the combination remain unchanged, while the channels that are not included are set to 0. These input data are then used for gesture recognition, and the prediction matrix of the previous results of applying the softmax layer in the deep neural network is composed of the scores of different channels in this round. As the contribution value v(S), after calculating all feasible combinations and contribution values, the Shapley value of each channel for gesture recognition is calculated based on formula (6). The Shapley value of each channel reflects its contribution to the task of recognizing similar gestures, and takes into account all possible channel alliances and their marginal contributions;
[0037] Finally, we get a Shapley value array for each gesture type. All gesture arrays form a matrix. By analyzing the Shapley values in the matrix, we can achieve a global explanation of the relationship between input electrode channels and similar gesture recognition. The contribution of each channel involved in the recognition of gestures can be calculated as
[0038]
[0039] Among them, I n represents the average Shapley value of the nth input electrode channel, indicating its contribution to gesture recognition; X represents the number of samples in the dataset; represents the Shapley value of the nth input electrode channel, determined by analyzing the jth sample;
[0040] Through the above steps, the contribution of each input electrode channel in similar gesture recognition is finally analyzed, and the accuracy of the calculation results can be verified by formula (5).
[0041] Furthermore, the specific implementation process of step S4 is as follows:
[0042] After the global interpretation analysis, the contribution rate of the input electrode channel n is calculated and then normalized using formula (8) to obtain the contribution rate C of each gesture. n , this ratio reflects the different importance of different electrode channels in similar gesture recognition tasks; among them,
[0043]
[0044] represents the Shapley value of the nth input electrode channel, n∈[1,N]; represents the Shapley value of the t-th input electrode channel, t=1,2,...,N;
[0045] The recognition model is optimized by using the contribution rate of each electrode channel as the weight of data enhancement. Specifically, the contribution rate is used as feedback to the input part of the recognition model and applied to the first convolutional layer of the deep neural network, as shown in formula (9):
[0046]
[0047] By incorporating weights into the convolution kernel, the data obtained from key electrode channels can be enhanced, thereby guiding the recognition model to focus on learning this section of data;
[0048] In addition, model feedback also requires fine-tuning of model parameters. During the fine-tuning stage, all convolutional layers are fixed and only the last fully connected layer is adjustable, which ensures that only a small number of parameters are optimized during the retraining process; the recognition model obtained through this training process can effectively improve the recognition performance of similar gestures.
[0049] A storage device stores instructions and data for implementing a surface electromyography signal similarity gesture recognition method based on interpretable deep learning.
[0050] A surface electromyography signal similar gesture recognition device based on interpretable deep learning comprises: a processor and the storage device; the processor loads and executes instructions and data in the storage device to implement a surface electromyography signal similar gesture recognition method based on interpretable deep learning.
[0051] The technical solution provided by the present invention has the following beneficial effects: the present invention first collects and preprocesses surface electromyography signals, builds a recognition model based on deep learning, and uses deep neural networks to automatically extract features instead of manually extracting electromyography features, thereby improving the recognition efficiency of the recognition model and making the recognition model more convenient; then, interpretability analysis is introduced into the recognition model, and a new solution based on Shapley value is developed for accurately identifying and distinguishing similar gestures, which emphasizes the influence of surface electromyography electrode channels in the recognition process, and uses Shapley value to quantify the contribution of each channel to the recognition of similar gestures. This method provides interpretable analysis, enhances the understanding of the recognition process, and serves as feedback to improve recognition performance; the recognition model introduced with interpretability analysis is optimized; and finally, the optimized recognition model is used to recognize the surface electromyography signals actually obtained. By performing interpretability analysis on the recognition process, the feature correlation and the importance attribution of input features are analyzed. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0053] Figure 1This is a flowchart of a surface electromyography signal similarity gesture recognition method based on interpretable deep learning in an embodiment of the present invention.
[0054] Figure 2 It is a schematic diagram of the operation of the hardware device in the embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0056] An embodiment of the present invention provides a surface electromyography signal similarity gesture recognition method based on interpretable deep learning.
[0057] Please refer to Figure 1 , Figure 1 : is a flow chart of a method for surface electromyography signal similarity gesture recognition based on interpretable deep learning in an embodiment of the present invention, which specifically includes:
[0058] Step 1: Surface electromyography signal acquisition and preprocessing
[0059] Surface electromyography is an electrical signal that accompanies muscle contraction. It is also a biological signal with characteristics such as non-stationarity, low signal-to-noise ratio and multi-channel. Each channel of the surface electromyography reflects the synthesis of muscle activity in the surrounding area. Effectively extracting the features of these signals is the key to accurate gesture recognition.
[0060] Connect N surface electromyography sensors to the forearm for signal collection, and then perform denoising on the surface electromyography signals collected by the N surface electromyography sensors. The acquisition time is T, the acquisition frequency is F, and a TF×N data matrix can be obtained. The column number of the matrix represents the electrode number corresponding to the surface electromyography sensor, and the number of rows is the product of the sampling time and frequency. Each row of the data matrix is assigned a label corresponding to the gesture performed. Each row is marked as i, indicating the type of gesture performed at that moment.
[0061] To detect active segments in surface EMG data, they are divided into action mode (i≠0) and rest mode (i=0) according to label i. The labels of each row are scanned, and the data marked with i=0 are classified as rest mode, while the data corresponding to non-zero labels are classified as action mode.
[0062] Set an M×N analysis window to analyze the surface EMG data. Only the data of the action mode is selected, and the sliding step of the analysis window is set to s. The M×N arrays with the same gesture label i are considered valid data, and the label of the array is defined as i. The number of arrays K can be calculated as
[0063]
[0064] Wherein, M represents the width of the set analysis window; N represents the length of the set analysis window, and the size of N is the number of collection electrodes;
[0065] Each array is converted to an M×N matrix A k , where k∈(1,K). Then for the matrix A k Normalize and map its value to the range of (0,255). It can be calculated as
[0066]
[0067] Among them, minA k Indicates the minimum value in the mapping range, maxA k Indicates the maximum value within the mapping range; Represents the matrix A k The new matrix after the value is mapped to (0, 255) is the matrix required to convert the grayscale image;
[0068] The valid array data with gesture label i is converted into K grayscale images, each of which has a size of M × N. In order to improve the accuracy of similar gesture recognition, three adjacent grayscale images with the same gesture label are combined to form a three-dimensional color image, and a surface electromyography color image dataset is obtained.
[0069] Step 2: Building a recognition model based on deep learning
[0070] In order to recognize similar gestures using surface EMG color images, a deep neural network model is developed, which includes convolutional layers, fully connected layers, and softmax layers. The model takes surface EMG color images as input and uses deep learning techniques to recognize patterns in these images.
[0071] The image-level deep convolutional neural network architecture is used to extract features from the surface electromyography signal color image. The lth convolutional layer accepts the input α (l) , and by changing α (l) With the convolution kernel ω (l) Convolution is performed to produce output O (l) The receptive field size of the convolution kernel is A×B, the sliding length is z, and the bias term is β (l) The computation performed by the convolutional layer is
[0072]
[0073] Where:
[0074] x – the xth row in the image;
[0075] y – the y-th column in the image;
[0076] *——Convolution operation;
[0077] ——The input of the lth convolutional layer;
[0078] ——The value of the l-th layer convolution kernel in the a-th row and b-th column in the receptive field A×B;
[0079] a and b — the ath row and bth column in the receptive field A×B;
[0080] The cross entropy based loss function is defined as
[0081]
[0082] Where:
[0083] p i ——The actual output probability of gesture i;
[0084] q i ——The expected output probability of gesture i;
[0085] This loss function is used to train the recognition model during the offline training phase, ensuring that the classifier can accurately predict each gesture associated with the surface EMG color image.
[0086] Step 3: Interpretability Analysis of Deep Learning Models
[0087] Interpretability means that the neural network in artificial intelligence has a clear symbolic expression of internal knowledge, matching the knowledge framework of human beings, so that people can diagnose and modify the neural network at the semantic level. The present invention introduces an interpretable method based on Shapley value into the recognition model, which provides an effective way to understand the contribution and significance of input features in recognizing similar gestures. By considering each electrode channel of the surface electromyography signal as a "player" in the game, game theory can be used to explain the recognition results. The Shapley value represents the weighted average of the marginal contribution of a channel in all possible alliances, which can be used to explain these results.
[0088] First, the total contribution of the surface electromyography data obtained from all input electrode channels in a similar gesture recognition task is calculated. Specifically, the total contribution of the task refers to the difference between the output f(C) obtained after all channel signals are input into the recognition model and the output obtained when there is no input. The total contribution of all channels can be calculated as
[0089]
[0090] Where:
[0091] ——Zero input;
[0092] ——Shapley value of the nth input electrode channel;
[0093] Then, the total contribution obtained by the N input electrode channels must be fairly distributed to each channel. In the present invention, the Shapley value is used as a measure of the impact of each channel on the gesture recognition performance when the channel participates or does not participate in the recognition task. The Shapley value of each channel is calculated by weighting and aggregating the possible combinations of all electrode channels. Based on this, the Shapley value of each channel represents its contribution to similar gesture recognition tasks and can be calculated as
[0094]
[0095] Where:
[0096] N——the collection of all electrode channels;
[0097] S – the set of channels participating in game interactions;
[0098] v(S)——the contribution value of S;
[0099] v(S∪{n})-v(S) — marginal contribution of channel N to participation S;
[0100] |S|! — numerical factorial of the number of channels participating in the game interaction;
[0101] |N|!——Numerical factorial of the total number of electrode channels;
[0102] |S| — the number of channels participating in the game interaction;
[0103] |N|——the total number of electrode channels;
[0104] N\{n}——the set N minus element n;
[0105] In the task of recognizing similar gestures, the calculation process of Shapley value is determined by the game interaction between the surface electromyography electrode channels. In order to ensure accurate estimation of the contribution of each channel, a permutation and combination technique is used to ensure coverage of the interaction between all channels in the game. Specifically, all possible length combinations ranging from 1 to N are calculated. Where N is the total number of electrodes, and each combination corresponds to a round of game interaction.
[0106] For each round of game interaction, the input electrode channels are set according to the corresponding combination. Channels that are part of the combination remain unchanged, while channels that are not included are set to 0. These input data are then used for gesture recognition and the prediction matrix of the results before applying the softmax layer in the deep neural network. This matrix consists of the scores of different channels in this round as contribution values v(S). After calculating all feasible combinations and contribution values, the Shapley value of each channel for gesture recognition is calculated based on formula (6). The Shapley value of each channel reflects its contribution to the task of recognizing similar gestures, taking into account all possible channel coalitions and their marginal contributions. By calculating the Shapley value of each channel, we can better understand the relative importance of each channel in the recognition task.
[0107] Finally, we get an array of Shapley values for each gesture type, and all gesture arrays form a matrix. By analyzing the Shapley values in the matrix, we can achieve a global explanation of the relationship between input electrode channels and similar gesture recognition. The contribution of each channel involved in the recognition of gestures can be calculated as
[0108]
[0109] Where:
[0110] I n ——The average Shapley value of the nth input electrode channel, indicating its contribution to gesture recognition;
[0111] X – the number of samples in the dataset;
[0112] ——The Shapley value of the nth input electrode channel, determined by analyzing the jth sample;
[0113] Through the above steps, the contribution of each input electrode channel in similar gesture recognition is finally analyzed. The accuracy of the calculation results can be verified by formula (5).
[0114] Step 4: Identify model optimization
[0115] After the global interpretation analysis, the contribution rate of the input electrode channel n can be calculated and then normalized using formula (8) to obtain the contribution rate C of each gesture. n This ratio reflects the different importance of different electrode channels in similar gesture recognition tasks.
[0116]
[0117] in, represents the Shapley value of the nth input electrode channel, n = 1, 2, ..., N; represents the Shapley value of the t-th input electrode channel, t=1,2,...,N;
[0118] This is equivalent to dividing the contribution value of each electrode channel by the total contribution value, and then calculating the contribution rate of each electrode channel.
[0119] The recognition model is optimized by using the contribution rate of each electrode channel as the weight for data enhancement. Specifically, the contribution rate is used as feedback to the input part of the model. This method is applied to the first convolution layer of the deep neural network. As shown in formula (9), by incorporating the weight into the convolution kernel, the data obtained from the key electrode channel can be enhanced, thereby guiding the recognition model to focus on learning this section of data.
[0120]
[0121] In addition, model feedback also requires fine-tuning of model parameters. During the fine-tuning stage, all convolutional layers are fixed and only the last fully connected layer is adjustable. This ensures that only a small number of parameters are optimized during the retraining process. The recognition model obtained through this training process can effectively improve the recognition performance of similar gestures.
[0122] See also Figure 2 , Figure 2 4 is a schematic diagram of the working of the hardware device of an embodiment of the present invention, and the hardware device specifically includes: a surface electromyography signal similarity gesture recognition device 401 based on interpretable deep learning, a processor 402 and a storage device 403.
[0123] A surface electromyography signal similarity gesture recognition device 401 based on interpretable deep learning: The surface electromyography signal similarity gesture recognition device 401 based on interpretable deep learning implements the surface electromyography signal similarity gesture recognition method based on interpretable deep learning.
[0124] Processor 402: The processor 402 loads and executes the instructions and data in the storage device 403 to implement the surface electromyography signal similarity gesture recognition method based on interpretable deep learning.
[0125] Storage device 403: The storage device 403 stores instructions and data; the storage device 403 is used to implement the surface electromyography signal similarity gesture recognition method based on interpretable deep learning.
[0126] The beneficial effects of the present invention are as follows: the present invention first collects and preprocesses surface electromyography signals, builds a recognition model based on deep learning, and uses a deep neural network to automatically extract features instead of manually extracting electromyography features, thereby improving the recognition efficiency of the recognition model and making the recognition model more convenient; then, the recognition model is introduced with interpretability analysis, and a new solution based on Shapley value is developed for accurately identifying and distinguishing similar gestures, which emphasizes the influence of surface electromyography electrode channels in the recognition process, and uses Shapley value to quantify the contribution of each channel to the recognition of similar gestures. This method provides an interpretable analysis, enhances the understanding of the recognition process, and serves as feedback to improve recognition performance; the recognition model introduced with interpretability analysis is optimized; and finally, the surface electromyography signals actually obtained are recognized using the optimized recognition model. By performing interpretability analysis on the recognition process, the feature correlation and the importance attribution of input features are analyzed.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A surface electromyography signal similarity gesture recognition method based on interpretable deep learning, characterized by: include: S1: collect surface electromyography signals and preprocess them; The process of surface electromyography signal acquisition and preprocessing is as follows: Will N A surface electromyography sensor is connected to the forearm for signal collection. N The surface electromyography signals collected by the surface electromyography signal sensors are subjected to denoising processing; Set the collection time to T The acquisition frequency is F ,get TF × N The data matrix of the present invention is a matrix of the present invention; the column number of the matrix indicates the electrode number corresponding to the surface electromyography sensor, and the row number is the product of the sampling time and the frequency; each row of the data matrix is assigned a label corresponding to the gesture performed; Each line is marked i , indicating the kind of gesture action performed at that moment; To detect active segments in surface EMG data, we use the labels i Divide it into action mode and rest mode, scan the labels of each line, and mark i = 0 is classified as rest mode, while the data corresponding to non-zero labels are classified as action mode; Set up a M × N Analyze the surface EMG data with an analysis window of a certain size, select only the data of the action mode, and set the sliding step size of the analysis window to s , with the same gesture label i of M × N An array is considered valid data and its label is defined as i , the number of arrays K Calculated as: (1) Wherein, M represents the width of the set analysis window; N represents the length of the set analysis window; Each array is converted into a M × N matrix ,in k ∈(1, K ), then the matrix Normalize and map its value to the range of (0,255), calculated as (2) Among them, min Indicates the minimum value in the mapping range, max Indicates the maximum value within the mapping range; Representation Matrix The new matrix after the value is mapped to (0, 255) is the matrix required to convert the grayscale image; Will be labeled with gesture i The effective array data is converted into K grayscale images, each of size M × N ,In order to improve the accuracy of similar gesture recognition, three adjacent gray ,images with the same gesture label are combined to form a 3D color image, and a data set of surface EMG ,color images is obtained; S2: Based on the processed surface electromyography signals, a recognition model is built based on deep learning; Using an image-level deep convolutional neural network architecture, a recognition model is established that takes surface electromyography color images as input and uses deep learning techniques to recognize patterns in these images; the recognition model includes convolutional layers, fully connected layers, and softmax layers; Extracting features from surface electromyography color images, l The convolutional layers take input , and by With convolution kernel Convolution is performed to produce the output ; The receptive field size of the convolution kernel is A × B , the sliding length is z , the deviation term is recorded as , the calculation performed by the convolutional layer is: (3) in, Indicates the first OK; Indicates the first Column; * indicates convolution operation; Indicates l The input of the convolutional layer; Indicates l Layer convolution kernel in the receptive field The a Row, No. b The size of the column value; a and b In the receptive field The a Row, No. b List; The cross entropy based loss function is defined as: (4) in, Gestures i The actual output probability of Gestures i The expected output probability of This loss function is used to train the recognition model in the offline training phase to ensure that the recognition model can accurately predict each gesture associated with the surface electromyography signal color image; S3: Introducing interpretability analysis on the recognition model; The specific implementation process of step S3 is: First, the total contribution of the surface electromyography data obtained from all input electrode channels in a similar gesture recognition task is calculated. The total contribution of the task refers to the output obtained after all channel signals are input into the recognition model. The output obtained when there is no input The total contribution of all channels is calculated as: (5) in, Indicates zero input; Indicates n The Shapley value of the input electrode channel, n =1,2,..., N , N Indicates the total number of input electrode channels; Then, by N The total contribution obtained by the input electrode channels must be fairly distributed to each channel. The Shapley value is used as a measure of the impact of each channel on gesture recognition performance when the channel participates or does not participate in the recognition task. The Shapley value of each channel is calculated by weighting and aggregating the possible combinations of all electrode channels. Based on this, the Shapley value of each channel represents its contribution to similar gesture recognition tasks. The calculation formula is: (6) in, Indicates the total number of electrode channels; Indicates the number of channels participating in game interactions; express S Contribution value; Indicates channel N About participation S marginal contribution of; | S| ! represents the numerical factorial of the number of channels participating in the game interaction; | N| ! represents the numerical factorial of the total number of electrode channels; |S |Indicates the number of channels participating in game interaction;| N | represents the total number of electrode channels; N { n } represents the set N after removing element n; In the task of recognizing similar gestures, the calculation process of Shapley value is determined by the game interaction between surface electromyography signal electrode channels, and the length ranges from 1 to N All possible length combinations within are calculated, each combination corresponds to a round of game interaction; For each round of game interaction, the input electrode channels are set according to the corresponding combination. The channels that are part of the combination remain unchanged, while the channels that are not included are set to 0. These input data are then used for gesture recognition and the prediction matrix of the previous results of applying the softmax layer in the deep neural network is composed of the scores of different channels in this round as the contribution value ,After calculating all feasible combinations and contribution values, the Shapley value of each channel of gesture recognition is calculated based on formula (6). The Shapley value of each channel reflects its contribution to the task of recognizing similar gestures; Through step S3, the contribution of each input electrode channel in similar gesture recognition is finally analyzed, and the accuracy of the calculation result is verified by formula (5); S4: Optimize the recognition model with the introduction of interpretability analysis; The specific implementation process of step S4 is: After global interpretation analysis, the input electrode channels were calculated n The contribution rate of each gesture is then normalized using formula (7) to obtain the contribution rate of each gesture. , this contribution rate reflects the different importance of different electrode channels in similar gesture recognition tasks; among them, (7) Indicates n The Shapley value of the input electrode channel, ; Indicates t The Shapley value of the input electrode channel, t =1,2,..., N ; The recognition model is optimized by using the contribution rate of each electrode channel as the weight of data enhancement. Specifically, the contribution rate is used as feedback to the input part of the recognition model and applied to the first convolutional layer of the deep neural network, as shown in formula (8): (8) By incorporating weights into the convolution kernel, the data obtained from the key electrode channels is enhanced, thereby guiding the recognition model to focus on learning this section of data; In addition, model feedback also requires fine-tuning of model parameters. During the fine-tuning stage, all convolutional layers are fixed and only the last fully connected layer is adjustable; S5: Using the optimized recognition model to recognize the surface electromyography signal actually obtained.
2. A storage device, characterized in that: The storage device stores instructions and data for implementing the surface electromyography signal similarity gesture recognition method based on interpretable deep learning as described in claim 1.
3. A surface electromyography signal similarity gesture recognition device based on interpretable deep learning, characterized in that: include: Processor and storage device; the processor loads and executes instructions and data in the storage device to implement the surface electromyography signal similarity gesture recognition method based on interpretable deep learning as described in claim 1.
Citation Information
Patent Citations
Trajectory prediction model optimization method based on Shapley feedback mechanism
CN116579480A