Self-calibration wrist surface myoelectric gesture recognition method, system, device and medium
By employing a self-calibrated wrist surface electromyography gesture recognition method, utilizing a CNN-LSTM-Attention network model and an online self-calibration mechanism, the method addresses the issue of poor gesture recognition accuracy caused by individual differences and electrode displacement in existing technologies. It achieves high-precision and real-time gesture recognition, adapting to the electromyographic signal characteristics of different users.
Patent Information
- Application Number
- CN202511163597.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2045-08-19
AI Technical Summary
Existing wearable surface electromyography devices mainly collect data from the arm, which leads to individual differences and electrode displacement issues, affecting the accuracy of gesture recognition. Furthermore, they cannot connect intelligently with other devices, have poor real-time performance, and pose risks of data loss and privacy leaks.
A self-calibrated wrist surface electromyography (EMG) gesture recognition method is adopted. The CNN-LSTM-Attention network model is used for offline pre-training and online self-calibration. Through multi-channel surface EMG signal acquisition, data preprocessing and self-calibration mechanism, it adapts to the EMG signal characteristics of different users. Combined with KNN algorithm and stability regularization term, the adaptability and accuracy of the model are improved.
It significantly improves the accuracy and real-time performance of gesture recognition, solves the problems of individual differences and electrode displacement, realizes intelligent connection with multiple devices, reduces computational complexity, and meets the needs of real-time interaction.
Smart Images

Figure CN121093074B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent wearable devices and gesture recognition technology, specifically relating to a self-calibrated wrist surface electromyography gesture recognition method, system, electronic device, and storage medium. Background Technology
[0002] Surface electromyography (sEMG) is a non-invasive method for acquiring bio-muscle electrical signals. It typically generates 30-150 ms ahead of limb movement and has been widely studied and applied in recent years to decoding human movement intentions, holding significant importance in the field of human-computer interaction. Currently, most wearable sEMG signal acquisition devices on the market only collect sEMG signals from the arm and cannot achieve intelligent connection and interaction with other devices, such as the eCon-Alpha smart sEMG armband, Myo armband, and Aoyi Technology gForce EMG wristband. However, analysis of daily usage habits and practicality shows that smart devices worn on the arm do not conform to human wearing habits. Individual differences and electrode displacement can lead to poor gesture recognition accuracy, affecting the interaction effect. Most human-computer interaction systems based on sEMG signals can only establish a connection with a single device and rely on a computer for data processing and gesture recognition, resulting in poor real-time performance and risks of data loss and privacy leaks. Summary of the Invention
[0003] The main objective of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a self-calibrating wrist surface electromyography gesture recognition method, system, electronic device, and storage medium.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] The first aspect of this invention discloses a self-calibrated wrist surface electromyography gesture recognition method, the gesture recognition method comprising:
[0006] S1. Data acquisition steps: Multi-channel acquisition of surface electromyography signals of the wearer when performing gesture tasks;
[0007] S2. Data preprocessing steps: Baseline drift removal, filtering, noise reduction, and action segment judgment are performed on the multi-channel surface electromyography signals to extract three time-domain features, which constitute a 3D feature vector.
[0008] S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the 3D feature vector into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model), and perform offline network training.
[0009] S4. Online self-calibration inference steps:
[0010] After the user wears the wrist electromyography device, labeled data is collected first. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model.
[0011] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0012] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0013] Furthermore, the data acquisition steps include:
[0014] S11. The wrist electromyography device is worn on the wrist. The metal dry electrodes collect multi-channel surface electromyography signals from the wrist by contacting the skin of the wrist. Each channel corresponds to the signal collected by a group of dry electrodes. The present invention uses a wrist electromyography device and collects signals by contacting the skin with metal dry electrodes, which avoids the inconvenience of wearing it on the arm. At the same time, the metal dry electrodes have good conductivity and stability, which can effectively reduce signal acquisition errors caused by electrode displacement or individual differences.
[0015] S12. The electromyography (EMG) sensor linearly amplifies, bandpass filters, and boosts the level of the raw signal collected by the metal dry electrode to obtain an effective EMG signal. The linear amplification is 1000 times, the bandpass filtering range is 20~200Hz, and the level boosting increases the reference voltage from 0V to 1.5V. Finally, the EMG analog signal is converted into an EMG digital signal.
[0016] Furthermore, the data preprocessing step includes:
[0017] S21. Filter, window, and segment the multi-channel surface electromyography (EMG) signals; use filtering techniques to remove noise and interference components from the signals, and segment the signals into multiple smaller segments through windowing and segmentation to better extract features.
[0018] S22. For the t=1,2,…,T windows of the C=1,2,3 channels, extract the mean absolute value, root mean square value, and waveform length to form a 3D feature vector. For the 3 channels, each channel has T windows, and a 3D feature vector is extracted from each window. Finally, after data preprocessing, the sEMG feature vector matrix is obtained, with a matrix size of [3,T,3]. The extracted feature vectors can more accurately reflect the characteristics of gesture actions, improving the accuracy and reliability of gesture recognition.
[0019] Further, in step S22, the calculation formulas for extracting the mean absolute value (MAV), root mean square value (RMS), and waveform length (WL) are as follows:
[0020]
[0021]
[0022]
[0023] Where x i This represents the sEMG value at the i-th sampling point within a window, where I represents the total number of sampling points within a window.
[0024] Furthermore, in the offline pre-training step, the CLA model is trained offline using sEMG datasets from multiple users. The parameters of the CLA model are updated using the backpropagation algorithm, with the loss function being cross-entropy loss during the update process.
[0025]
[0026] in It is the one-hot encoding of the actual gesture action label. If the current sample belongs to the m-th type of gesture action, If it does not belong, then it is 0. The CLA model predicts the probability that the current sample belongs to class m, where M represents the total number of classes. Gesture classes include thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and the OK gesture. L represents the total loss value, which is the difference between the current prediction and the true label. Through offline pre-training, the model can learn the electromyographic signal characteristics of different users, improving the model's generalization ability and the accuracy of gesture recognition.
[0027] Furthermore, the CLA model comprises a CNN part, an LSTM part, and an Attention part connected sequentially. The CNN part performs convolution and batch normalization operations on the input feature vector matrix [C,T,3], and then transforms it using the ReLU activation function and global response normalization to obtain the output feature sequence. The CNN part is responsible for performing convolution and batch normalization operations on the input feature vector matrix to extract local features. The ReLU activation function and global response normalization further enhance the expressive power of the features.
[0028] The LSTM part outputs the feature sequence from the CNN part. Perform time series modeling to obtain a high-dimensional time series representation sequence. The LSTM part performs time-series modeling on the feature sequences output by the CNN, capturing long-term dependencies in the time series.
[0029] The Attention component represents the high-dimensional temporal sequence. Multi-head attention mechanism learning is used to obtain aggregated context feature vectors. Each attention head is responsible for independently learning the dependency structure in a feature subspace. For each attention head, the query vector is computed. Key vector Sum value vector Query vector The key vector represents the current location that needs attention. The value vector represents the position associated with the query vector. Representing the information contained in the corresponding key vector, the computational representation of the multi-head attention mechanism is as follows: ,
[0030] , and These represent the weight matrices that represent the linear mappings of the query vector, key vector, and value vector, respectively. Used to map input data to the query vector space. Used to map input data to a key vector space These vectors are used to map the input data to a value vector space. They are randomly initialized at the start of CLA model training and updated via backpropagation during training.
[0031] Let the number of attention heads be h. The formula for calculating multi-head attention is:
[0032]
[0033] in, This represents the result of multi-head attention calculation. This represents the attention calculation result of the p-th attention head. , This represents the output weight matrix, used to linearly map the results of multi-head attention to the final output. Concat() represents the concatenation operation.
[0034] Attention of each head The calculation formula is
[0035] in, They represent the first The weight matrix of the query vector, key vector, and value vector of each attention head. The query vector space used to map input data to the p-th attention head. The key vector space used to map input data to the p-th attention head. This is used to map the input data to the value vector space of the p-th attention head.
[0036] Used respectively for matrix and Perform a linear mapping. Used to calculate the influence weight of each input weight matrix on each element of the output sequence;
[0037] Through context feature vectors The gesture recognition results are obtained.
[0038] The attention mechanism learns the high-dimensional temporal representation sequence using a multi-head attention mechanism, aggregating contextual feature vectors. This attention mechanism enables the model to focus more on the parts relevant to the current task when processing sequence data, thereby improving model performance. By learning different representations of the input sequence simultaneously through multiple attention heads, the multi-head attention mechanism can capture richer contextual information.
[0039] By extracting local features through CNN, modeling temporal relationships through LSTM, and aggregating contextual information through Attention, the CLA model can more accurately recognize gestures, improving the accuracy and real-time performance of gesture recognition.
[0040] Furthermore, the online inference steps of the model include:
[0041] S41. After the user wears the wrist electromyography device, collect sEMG data and gesture labels corresponding to the standard movements of each gesture to construct an initial labeled dataset. ,in It is the feature vector of the n=1,2,…,Nth sample. It is the gesture label of the nth sample, which will be used to initially label the data. The initial accuracy is calculated by inputting the CLA model into the offline pre-training part. ,Compare With the preset threshold ;
[0042] S42, if This indicates that the CLA model in the offline pre-training part is suitable for the user under test and can be directly applied to the current user's real-time gesture recognition task. At this time, it enters the online inference stage, where the CLA model recognizes and outputs the gesture recognition results.
[0043] S43, if Then, semi-supervised online self-calibration is performed, as follows:
[0044] S431, Based on initial marker data Train a KNN model and use it to process newly acquired pseudo-labeled samples. For gesture prediction, the KNN model uses the following formula:
[0045] in The indicator function is defined as follows:
[0046] This represents the gesture label predicted by the KNN model, where K represents the distance. The most recent K samples, where b represents the pseudo-labeled sample. The corresponding actual gesture label;
[0047] pseudo-labeled samples and their corresponding prediction labels Added as pseudo-label data to the labeled data To obtain new labeled data The calculation formula is: ;
[0048] S432, Transfer new tag data The CLA model is input for self-calibration. The model output is obtained through forward propagation. The error is evaluated using the cross-entropy loss function. The gradient is calculated through backpropagation. The model weights are fine-tuned through backpropagation and the Adam optimizer.
[0049] S433, Introducing a stability regularization term This controls the offset between the outputs of the old and new models, prevents overfitting to pseudo-labeled data, and improves the adaptive stability of the model.
[0050] Stability regularization term The calculation formula is: ,in This is the τth time after the CLA model self-calibration, for pseudo-labeled samples. The prediction results It is the prediction result of the τ-1th CLA model self-calibration on the same input data, denoted by "". " indicates norm 2 operation;
[0051] A stability regularization term is introduced to form the total loss function in the self-calibration phase. : ,in The cross-entropy classification loss for pseudo-labeled samples. The regularization coefficient is . The value ranges from 0 to 1;
[0052] S434, Repeat process S431-S434 until the condition is met. Finally, the self-calibrated CLA model was used for online gesture recognition.
[0053] After the user wears the wrist electromyography (EMG) device, EMG signal data and gesture labels corresponding to the standard movements of each gesture are collected to construct an initial labeled dataset. This initial labeled data is then input into an offline pre-trained model to calculate the initial accuracy. If the initial accuracy is lower than a preset threshold, self-calibration is performed until the initial accuracy reaches the preset threshold. This online self-calibration inference step allows for model adjustments based on individual user differences and actual usage, improving the model's adaptability and accuracy.
[0054] A second aspect of this invention discloses a self-calibrating wrist surface electromyography (EMG) gesture recognition system for performing the aforementioned self-calibrating wrist surface EMG gesture recognition method, the gesture recognition system comprising:
[0055] The data acquisition module is used to acquire surface electromyography signals of the wearer during gesture tasks through multiple channels;
[0056] The data preprocessing module performs baseline drift removal, filtering, noise reduction, and action segment determination on the multi-channel surface electromyography signals, extracting three time-domain features to form a 3D feature vector.
[0057] The offline pre-training module constructs a CNN-LSTM-Attention network model for gesture recognition. The 3D feature vector is input into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model) for offline network training.
[0058] The online self-calibration inference module first collects labeled data after the user wears the wrist electromyography device. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model.
[0059] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0060] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0061] A third objective of the present invention is to provide an electronic device, including a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the above-described self-calibrating wrist surface electromyography gesture recognition method.
[0062] A fourth objective of this invention is to provide a storage medium storing a program that, when executed by a processor, implements the aforementioned self-calibrating wrist surface electromyography gesture recognition method.
[0063] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0064] (1) This invention employs a CNN-LSTM-Attention (CLA) model, which uses a convolutional neural network (CNN) to extract local features, a long short-term memory network (LSTM) to model temporal information, and an attention mechanism to aggregate contextual information, thereby enabling more accurate recognition of hand gestures. Compared with existing technologies, this combined model can effectively handle complex electromyographic signal features, improving recognition accuracy and stability.
[0065] (2) This invention proposes an online self-calibration mechanism that can adjust and optimize model parameters in real time to adapt to the electromyographic signal characteristics of different users. By collecting labeled data from users, the initial accuracy of the model is verified, and self-calibration is performed when the initial accuracy is lower than a preset threshold until a satisfactory accuracy is achieved. This mechanism significantly improves the adaptability and accuracy of the model and solves the problem of poor model adaptability among different users in the prior art.
[0066] (3) This invention introduces the KNN algorithm into the online self-calibration process to predict gestures from newly acquired pseudo-labeled samples. The pseudo-labeled samples are then added to the labeled data based on the prediction results of the KNN model, further enriching the training dataset. This method not only improves the model's generalization ability but also reduces the dependence on a large amount of labeled data, thus improving the efficiency of self-calibration.
[0067] (4) To prevent the model from overfitting to pseudo-labeled data during self-calibration, this invention introduces a stability regularization term. This regularization term ensures that the model remains stable during the update process by controlling the offset between the outputs of the old and new models. This innovation not only improves the robustness of the model but also guarantees the reliability of the self-calibration process.
[0068] (5) The online self-calibration mechanism of this invention emphasizes computational efficiency and real-time performance in its design. By optimizing the model structure and algorithm, it can significantly reduce computational complexity and improve the real-time performance of the system while ensuring recognition accuracy. This enables the invention to quickly respond to user gestures in practical applications and meet the needs of real-time interaction. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This is a schematic diagram of the subject wearing the wristband in this invention;
[0071] Figure 2 This is an example of a hand gesture in this invention;
[0072] Figure 3 This is a flowchart of the self-calibrated wrist surface electromyography gesture recognition method in this invention;
[0073] Figure 4 This is a schematic diagram of the structure of the self-calibrating wrist surface electromyography gesture recognition system disclosed in Embodiment 3 of the present invention;
[0074] Figure 5 This is a structural diagram of the electronic device disclosed in Embodiment 4 of the present invention. Detailed Implementation
[0075] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0076] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0077] Example 1
[0078] This embodiment discloses a self-calibrated wrist surface electromyography gesture recognition method, such as... Figure 3 As shown, Figure 3 A flowchart of a self-calibrated wrist surface electromyography gesture recognition method is disclosed, including the following steps:
[0079] S1. Data Acquisition Steps: Multi-channel acquisition of surface electromyography (EMG) signals from the wearer during gesture tasks was conducted on 20 healthy subjects. The experiment was carried out at a room temperature of 25°C and a humidity of 50%RH. After cleaning the skin of the wrist, the subjects wore the wrist-type device of this invention (5-channel dry electrodes, 15 mm spacing) and performed 10 dynamic wrist gestures. The acquired analog EMG signals were converted into digital EMG signals.
[0080] In this embodiment, the specific process of step S1, data acquisition, includes:
[0081] S11. The task of this invention is to collect the same hand gestures from different subjects for self-calibration recognition. Twenty healthy subjects (12 males, 8 females, aged 23±3 years) were selected and performed 10 hand gestures in a normal temperature environment (room temperature 25 ℃, relative humidity 50% RH): thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and OK gesture. Each hand gesture was repeated 6 times, with each session lasting 5 seconds and a rest time of 3 seconds. Finally, 20 sets of raw wrist electromyography data were obtained. Each set of data was divided into 10 categories, and the data length of each category was 48 seconds.
[0082] S12. Linearly amplify the original data to increase the electromyographic signal from 0 to 1.5mV to 0 to 1.5V.
[0083] S13. The raw data is subjected to bandpass filtering and power frequency notch filtering. Bandpass filtering ensures that the effective frequency range of the electromyography signal is 20~200Hz, and power frequency notch filtering reduces the mains interference by 50Hz.
[0084] S13. Increase the reference voltage of the electromyography signal from 0V to 1.5V to ensure that the fluctuation range of the electromyography signal is within 0~3V.
[0085] S14. Convert the electromyographic analog signal through a 16-bit ADC to obtain the electromyographic digital signal, with a digital value ranging from 0 to 4096.
[0086] S2. Data preprocessing steps: Baseline drift removal, filtering, noise reduction, and motion segment judgment are performed on 20 sets of electromyographic digital signals. Then, the data segments are further segmented using a sliding window. Features are extracted from each segmented data to obtain 3 time-domain features, which are then concatenated to form a 3D feature vector.
[0087] In this embodiment, the specific process of step S2, data preprocessing, includes:
[0088] S21. The 20 sets of electromyographic digital signals are filtered using a 4th-order Butterworth filter to extract the signal of the active segment. The active segment signal is segmented using a sliding window with a length of 200ms and a step size of 25ms. For a sampling frequency of 1KHz, there are 41 windows that can be obtained in 1 second.
[0089] S22. Extract the three features of the electromyography signal in each window: mean absolute value, root mean square value, and waveform length, to form a 3D feature vector. For 5 channels, each channel can obtain 41 windows at a sampling frequency of 1KHz. Finally, each sampling yields an sEMG feature vector matrix of size [3,41,3]. This matrix can more accurately reflect the characteristics of multi-channel gestures, improving the accuracy and reliability of gesture recognition.
[0090] Further, in step S22, the calculation formulas for extracting the mean absolute value (MAV), root mean square value (RMS), and waveform length (WL) are as follows:
[0091]
[0092]
[0093]
[0094] in This represents the sEMG value at the i-th sampling point within a window, where I represents the total number of sampling points within a window.
[0095] S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the sEMG feature vector matrix into the CNN-LSTM-Attention network model, and train the CNN-LSTM-Attention network model required in this embodiment. The CNN-LSTM-Attention model is referred to as the CLA model below. Perform offline network training.
[0096] In this embodiment, the specific process of step S3, offline pre-training, includes:
[0097] S31. First, the 10 gesture data of 20 users are randomly divided according to the number of repetitions. The data collected in the 1st, 3rd, 4th and 5th repetitions of each gesture are used as the training set, and the data collected in the 2nd and 6th repetitions are used as the validation set.
[0098] S32. Initialize the basic parameters of the CLA model, including 32 CNN convolutional kernels of size 1*3, an LSTM with 64 hidden units, and an Attention module with 4 attention heads. Use the Adam optimizer with a learning rate of 1e-3, train for 128 batches, with each batch trained for 100 epochs. During this process, update the parameters of the CLA model using the backpropagation algorithm. The loss function during the update process is the cross-entropy loss.
[0099] in It is the one-hot encoding of the actual gesture action label. If the current sample belongs to the m-th type of gesture action, If it does not belong, then it is 0. It is the probability that the current sample is classified as class m by the CLA model. This indicates the total number of categories. The gesture categories include thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and OK gesture. This represents the total loss value, which is the difference between the current prediction and the true label. Through offline pre-training, the model can learn the electromyographic signal characteristics of different users, improving the model's generalization ability and the accuracy of gesture recognition.
[0100] Furthermore, the CLA model comprises a CNN part, an LSTM part, and an Attention part connected sequentially, wherein,
[0101] S32. The CNN part performs convolution and batch normalization operations on the input feature vector matrix [C,T,3], and then uses the ReLU activation function and global response normalization operation to transform it to obtain the output feature sequence. The CNN part is responsible for performing convolution and batch normalization operations on the input feature vector matrix to extract local features. The ReLU activation function and global response normalization further enhance the expressive power of the features.
[0102] S33, The feature sequence output by the LSTM part to the CNN part Perform time series modeling to obtain a high-dimensional time series representation sequence. The LSTM part performs time-series modeling on the feature sequences output by the CNN, capturing long-term dependencies in the time series.
[0103] S34, The Attention component represents the high-dimensional temporal sequence. Multi-head attention mechanism learning is used to obtain aggregated context feature vectors. Each attention head is responsible for independently learning the dependency structure in a feature subspace. For each attention head, the query vector is computed. Key vector Sum value vector Query vector The key vector represents the current location that needs attention. The value vector represents the position associated with the query vector. Representing the information contained in the corresponding key vector, the computation of the multi-head attention mechanism can be expressed as:
[0104]
[0105] , and These represent the weight matrices that represent the linear mappings of the query vector, key vector, and value vector, respectively.
[0106] Used to map input data to the query vector space. Used to map input data to a key vector space These vectors are used to map the input data to a value vector space. They are randomly initialized at the start of CLA model training and updated via backpropagation during training.
[0107] S35. The multi-head attention mechanism sets the number of attention heads to h, and the calculation formula for multi-head attention is:
[0108]
[0109] in, This represents the result of multi-head attention calculation. This represents the attention calculation result of the p-th attention head. , This represents the output weight matrix, used to linearly map the results of multi-head attention to the final output; Concat() represents the concatenation operation;
[0110] Attention of each head The calculation formula is
[0111] in, They represent the first The weight matrix of the query vector, key vector, and value vector of each attention head. The query vector space used to map input data to the p-th attention head. The key vector space used to map input data to the p-th attention head. This is used to map the input data to the value vector space of the p-th attention head.
[0112] Used respectively for matrix and Perform a linear mapping. Used to calculate the influence weight of each input weight matrix on each element of the output sequence;
[0113] Through context feature vectors The gesture recognition results are obtained.
[0114] The attention mechanism learns the high-dimensional temporal representation sequence using a multi-head attention mechanism, aggregating contextual feature vectors. This attention mechanism enables the model to focus more on the parts relevant to the current task when processing sequence data, thereby improving model performance. By learning different representations of the input sequence simultaneously through multiple attention heads, the multi-head attention mechanism can capture richer contextual information.
[0115] By extracting local features through CNN, modeling temporal relationships through LSTM, and aggregating contextual information through Attention, the CLA model can more accurately recognize gestures, improving the accuracy and real-time performance of gesture recognition.
[0116] S4. Online self-calibration inference steps:
[0117] Ten healthy new users (with similar physical conditions to the 20 users training the model) were selected and put on wrist electromyography devices. Labeled data was collected first. Users were required to perform each gesture for 1 second. Then, the gesture category was labeled as an action label. The labeled data and the corresponding action labels were input into the CLA model to verify the initial accuracy of the CLA model.
[0118] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0119] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0120] In this embodiment, the specific process of step S4, online self-calibration inference, includes:
[0121] S41. Select 10 users of different ages to be tested, and after they wear wrist electromyography devices, collect sEMG data and gesture labels corresponding to the standard actions of 10 gestures they perform, and construct an initial labeled dataset. ,in It is the feature vector of the n=1,2,…,Nth sample. It is the gesture label of the nth sample, which will be used to initially label the data. The initial accuracy is calculated by inputting the CLA model into the offline pre-training part. ,Compare With the preset threshold The comparison of the initial recognition accuracy and preset threshold for the 10 test users is shown in Table 1:
[0122] Table 1. Initial identification accuracy of 10 test users in Example 1
[0123]
[0124] S42, if This indicates that the CLA model in the offline pre-training part is suitable for the user under test and can be directly applied to the current user's real-time gesture recognition task. At this time, it enters the online inference stage, where the CLA model recognizes and outputs the gesture recognition results.
[0125] S43, if Then, semi-supervised online self-calibration is performed, as follows:
[0126] S431, Based on initial marker data Train a KNN model and use it to process newly acquired pseudo-labeled samples. For gesture prediction, the KNN model uses the following formula:
[0127] in The indicator function is defined as follows:
[0128] This represents the gesture label predicted by the KNN model, where K represents the distance. The most recent K samples, where b represents the pseudo-labeled sample. The corresponding actual gesture label;
[0129] pseudo-labeled samples and their corresponding prediction labels Added as pseudo-label data to the labeled data To obtain new labeled data The calculation formula is: ;
[0130] S432, Transfer new tag data The CLA model is input for self-calibration. The model output is obtained through forward propagation. The error is evaluated using the cross-entropy loss function. The gradient is calculated through backpropagation. The model weights are fine-tuned through backpropagation and the Adam optimizer.
[0131] S433, Repeat process S431-S433 until the condition is met. Finally, the self-calibrated CLA model was used for online gesture recognition. During the self-calibration process, the number of self-calibrations for each user, the prediction accuracy at the final condition, and the improvement were recorded, as shown in Table 2.
[0132] Table 2. Online self-calibration results of 10 users under test in Example 1
[0133]
[0134] As shown in the results of Example 1, the online self-calibration mechanism proposed in this invention can significantly bridge the performance gap between the "offline model" and "individual differences." After no more than seven self-calibrations, the initial recognition accuracy of 10 test users converged from a discrete distribution of 60.5% to 83.7% to over 90%, meeting the requirements of online inference. In particular, for users over 40 years old (U6~U10), the initial accuracy averaged only 62.6% in a typical cross-subject scenario, but after self-calibration, it averaged 85.1%, demonstrating that this invention has strong robustness against "covariate drift" caused by age-related degradation of electromyographic signals.
[0135] Example 2
[0136] In this embodiment, the same experimental steps as in Embodiment 1 are used, but a stability regularization term is introduced during the self-calibration process to control the prediction bias between the old and new models. The self-calibration process of wrist surface electromyography gesture recognition in this embodiment is described in detail below.
[0137] S1. Data Acquisition Steps: Multi-channel acquisition of surface electromyography (EMG) signals from the wearer during gesture tasks was conducted on 20 healthy subjects. The experiment was carried out at a room temperature of 25°C and a humidity of 50%RH. After cleaning the skin of the wrist, the subjects wore the wrist-type device of this invention (5-channel dry electrodes, 15 mm spacing) and performed 10 dynamic wrist gestures. The acquired analog EMG signals were converted into digital EMG signals.
[0138] In this embodiment, the specific process of step S1, data acquisition, includes:
[0139] S11. The task of this invention is to collect the same hand gestures from different subjects for self-calibration recognition. Twenty healthy subjects (12 males, 8 females, aged 23±3 years) were selected and performed 10 hand gestures in a normal temperature environment (room temperature 25 ℃, relative humidity 50% RH): thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and OK gesture. Each hand gesture was repeated 6 times, with each session lasting 5 seconds and a rest time of 3 seconds. Finally, 20 sets of raw wrist electromyography data were obtained. Each set of data was divided into 10 categories, and the data length of each category was 48 seconds.
[0140] S12. Linearly amplify the original data to increase the electromyographic signal from 0 to 1.5mV to 0 to 1.5V.
[0141] S13. The raw data is subjected to bandpass filtering and power frequency notch filtering. Bandpass filtering ensures that the effective frequency range of the electromyography signal is 20~200Hz, and power frequency notch filtering reduces the mains interference by 50Hz.
[0142] S13. Increase the reference voltage of the electromyography signal from 0V to 1.5V to ensure that the fluctuation range of the electromyography signal is within 0~3V.
[0143] S14. Convert the electromyographic analog signal through a 16-bit ADC to obtain the electromyographic digital signal, with a digital value ranging from 0 to 4096.
[0144] S2. Data preprocessing steps: Baseline drift removal, filtering, noise reduction, and motion segment judgment are performed on 20 sets of electromyographic digital signals. Then, the data segments are further segmented using a sliding window. Features are extracted from each segmented data to obtain 3 time-domain features, which are then concatenated to form a 3D feature vector.
[0145] In this embodiment, the specific process of step S2, data preprocessing, includes:
[0146] S21. The 20 sets of electromyographic digital signals are filtered using a 4th-order Butterworth filter to extract the signal of the active segment. The active segment signal is segmented using a sliding window with a length of 200ms and a step size of 25ms. For a sampling frequency of 1KHz, there are 41 windows that can be obtained in 1 second.
[0147] S22. Extract the mean absolute value, root mean square value, and waveform length of the electromyography (EMG) signal from each window to form a 3D feature vector. For 5 channels, each channel can obtain 41 windows at a sampling frequency of 1kHz. Finally, each sampling yields an sEMG feature vector matrix of size [3,41,3]. This matrix can more accurately reflect the characteristics of multi-channel gesture movements, improving the accuracy and reliability of gesture recognition. Further, in step S22, the calculation formulas for the mean absolute value (MAV), root mean square value (RMS), and waveform length (WL) are as follows:
[0148]
[0149]
[0150]
[0151] in This represents the sEMG value at the i-th sampling point within a window, where I represents the total number of sampling points within a window.
[0152] S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the sEMG feature vector matrix into the CNN-LSTM-Attention network model, and train the CNN-LSTM-Attention network model required in this embodiment. The CNN-LSTM-Attention model is referred to as the CLA model below. Perform offline network training.
[0153] In this embodiment, the specific process of step S3, offline pre-training, includes:
[0154] S31. First, the 10 gesture data of 20 users are randomly divided according to the number of repetitions. The data collected in the 1st, 3rd, 4th and 5th repetitions of each gesture are used as the training set, and the data collected in the 2nd and 6th repetitions are used as the validation set.
[0155] S32. Initialize the basic parameters of the CLA model, including 32 CNN convolutional kernels of size 1*3, an LSTM with 64 hidden units, and an Attention module with 4 attention heads. Use the Adam optimizer with a learning rate of 1e-3, train for 128 batches, with each batch trained for 100 epochs. During this process, update the parameters of the CLA model using the backpropagation algorithm. The loss function during the update process is the cross-entropy loss. ,
[0156] in It is the one-hot encoding of the actual gesture action label. If the current sample belongs to the m-th type of gesture action, If it does not belong, then it is 0. It is the probability that the current sample is classified as class m by the CLA model. This indicates the total number of categories. The gesture categories include thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and OK gesture. This represents the total loss value, which is the difference between the current prediction and the true label. Through offline pre-training, the model can learn the electromyographic signal characteristics of different users, improving the model's generalization ability and the accuracy of gesture recognition.
[0157] Furthermore, the CLA model comprises a CNN part, an LSTM part, and an Attention part connected sequentially, wherein,
[0158] S32. The CNN part performs convolution and batch normalization operations on the input feature vector matrix [C,T,3], and then uses the ReLU activation function and global response normalization operation to transform it to obtain the output feature sequence. The CNN part is responsible for performing convolution and batch normalization operations on the input feature vector matrix to extract local features. The ReLU activation function and global response normalization further enhance the expressive power of the features.
[0159] S33, The feature sequence output by the LSTM part to the CNN part Perform time series modeling to obtain a high-dimensional time series representation sequence. The LSTM part performs time-series modeling on the feature sequences output by the CNN, capturing long-term dependencies in the time series.
[0160] S34, The Attention component represents the high-dimensional temporal sequence. Multi-head attention mechanism learning is used to obtain aggregated context feature vectors. Each attention head is responsible for independently learning the dependency structure in a feature subspace. For each attention head, the query vector is computed. Key vector Sum value vector Query vector The key vector represents the current location that needs attention. The value vector represents the position associated with the query vector. Representing the information contained in the corresponding key vector, the computation of the multi-head attention mechanism can be expressed as: ,
[0161] , and These represent the weight matrices that represent the linear mappings of the query vector, key vector, and value vector, respectively.
[0162] Used to map input data to the query vector space. Used to map input data to a key vector space These vectors are used to map the input data to a value vector space. They are randomly initialized at the start of CLA model training and updated via backpropagation during training.
[0163] S35. The multi-head attention mechanism sets the number of attention heads to h, and the calculation formula for multi-head attention is:
[0164] ,
[0165] in, This represents the result of multi-head attention calculation. This represents the attention calculation result of the p-th attention head. , This represents the output weight matrix, used to linearly map the results of multi-head attention to the final output; Concat() represents the concatenation operation;
[0166] Attention of each head The calculation formula is ,
[0167] in, They represent the first The weight matrix of the query vector, key vector, and value vector of each attention head. The query vector space used to map input data to the p-th attention head. The key vector space used to map input data to the p-th attention head. This is used to map the input data to the value vector space of the p-th attention head.
[0168] Used respectively for matrix and Perform a linear mapping. Used to calculate the influence weight of each input weight matrix on each element of the output sequence;
[0169] Through context feature vectors The gesture recognition results are obtained.
[0170] The attention mechanism learns the high-dimensional temporal representation sequence using a multi-head attention mechanism, aggregating contextual feature vectors. This attention mechanism enables the model to focus more on the parts relevant to the current task when processing sequence data, thereby improving model performance. By learning different representations of the input sequence simultaneously through multiple attention heads, the multi-head attention mechanism can capture richer contextual information.
[0171] By extracting local features through CNN, modeling temporal relationships through LSTM, and aggregating contextual information through Attention, the CLA model can more accurately recognize gestures, improving the accuracy and real-time performance of gesture recognition.
[0172] S4. Online self-calibration inference steps:
[0173] Ten healthy new users (with similar physical conditions to the 20 users training the model) were selected and put on wrist electromyography devices. Labeled data was collected first. Users were required to perform each gesture for 1 second. Then, the gesture category was labeled as an action label. The labeled data and the corresponding action labels were input into the CLA model to verify the initial accuracy of the CLA model.
[0174] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0175] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0176] In this embodiment, the specific process of step S4, online self-calibration inference, includes:
[0177] S41. Select 10 users of different ages to be tested, and after they wear wrist electromyography devices, collect sEMG data and gesture labels corresponding to the standard actions of 10 gestures they perform, and construct an initial labeled dataset. ,in It is the feature vector of the n=1,2,…,Nth sample. It is the gesture label of the nth sample, which will be used to initially label the data. The initial accuracy is calculated by inputting the CLA model into the offline pre-training part. ,Compare With the preset threshold The comparison of the initial recognition accuracy and preset threshold for the 10 test users is shown in Table 3:
[0178] Table 3. Initial identification accuracy of 10 test users in Example 2
[0179]
[0180] S42, if This indicates that the CLA model in the offline pre-training part is suitable for the user under test and can be directly applied to the current user's real-time gesture recognition task. At this time, it enters the online inference stage, where the CLA model recognizes and outputs the gesture recognition results.
[0181] S43, if Then, semi-supervised online self-calibration is performed, as follows:
[0182] S431, Based on initial marker data Train a KNN model and use it to process newly acquired pseudo-labeled samples. For gesture prediction, the KNN model uses the following formula: ,
[0183] in The indicator function is defined as follows: ,
[0184] This represents the gesture label predicted by the KNN model, where K represents the distance. The most recent K samples, where b represents the pseudo-labeled sample. The corresponding actual gesture label;
[0185] pseudo-labeled samples and their corresponding prediction labels Added as pseudo-label data to the labeled data To obtain new labeled data The calculation formula is: ;
[0186] S432, Transfer new tag data The CLA model is input for self-calibration. The model output is obtained through forward propagation. The error is evaluated using the cross-entropy loss function. The gradient is calculated through backpropagation. The model weights are fine-tuned through backpropagation and the Adam optimizer.
[0187] S433, Introducing a stability regularization term This controls the offset between the outputs of the old and new models, prevents overfitting to pseudo-labeled data, and improves the adaptive stability of the model.
[0188] Stability regularization term The calculation formula is: ,in This is the τth time after the CLA model self-calibration, for pseudo-labeled samples. The prediction results It is the prediction result of the τ-1th CLA model self-calibration on the same input data, denoted by "". " indicates norm 2 operation;
[0189] A stability regularization term is introduced to form the total loss function in the self-calibration phase. : ,
[0190] in The cross-entropy classification loss for pseudo-labeled samples. The regularization coefficient is . The value ranges from 0 to 1; S434, repeat the process from S431 to S434 until the condition is met. Finally, the self-calibrated CLA model was used for online gesture recognition. During the self-calibration process, the number of self-calibrations for each user, the prediction accuracy at the final condition, and the improvement were recorded, as shown in Table 4.
[0191] Table 4. Online self-calibration results of 10 users under test in Example 1
[0192]
[0193] As can be seen from the results of Example 2, the present invention introduces a stability regularization term during the self-calibration process, which not only significantly improves the recognition accuracy after self-calibration, but also is particularly critical for the low initial accuracy group (over 40 years old). U6~U10 improved by an average of 24.8% without regularization, and further improved to 28.8% after adding regularization, with the maximum single-user increase reaching 30.5%.
[0194] In summary, this embodiment effectively solves the problem of poor adaptability of gesture recognition models among different users in existing technologies by designing an online self-calibration mechanism that combines the KNN algorithm and the CLA model. Specifically, the online self-calibration mechanism of this invention can adjust and optimize in real time according to individual user differences and actual usage, significantly improving the model's adaptability and accuracy. By using the KNN algorithm to predict gestures from newly collected pseudo-labeled samples and adding them to the labeled data, the training dataset is further enriched, improving the model's generalization ability. Simultaneously, a stability regularization term is introduced to control the offset between the outputs of the old and new models, automatically suppressing overfitting risks while amplifying pseudo-labeled samples, thereby significantly improving the robustness and reproducibility of the self-calibration process while ensuring convergence accuracy. Compared with traditional methods, this invention not only improves the accuracy and stability of gesture recognition but also reduces system complexity and enhances the user experience.
[0195] Example 3
[0196] like Figure 4As shown, this embodiment provides a self-calibrating wrist surface electromyography (EMG) gesture recognition system. This system includes: a data acquisition module 401, a data preprocessing module 402, an offline pre-training module 403, and an online self-calibration inference module 404. The specific functions of each module are as follows:
[0197] Data acquisition module 401 is used to acquire surface electromyography signals of the wearer when performing gesture tasks through multiple channels;
[0198] The data preprocessing module 402 performs baseline drift removal, filtering, noise reduction, and action segment determination on the multi-channel surface electromyography signal, extracting three time-domain features to form a 3-dimensional feature vector.
[0199] The offline pre-training module 403 constructs a CNN-LSTM-Attention network model for gesture recognition. The 3D feature vector is input into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model) for offline network training.
[0200] The online self-calibration inference module 404 first collects labeled data after the user wears the wrist electromyography device. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model.
[0201] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0202] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0203] Example 4
[0204] This embodiment provides an electronic device, which can be a computer, such as... Figure 5As shown, the processor 502, memory, input device 503, display 504, and network interface 505 are connected via system bus 501. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 506 and internal memory 507. The non-volatile storage medium 506 stores the operating system, computer programs, and database. The internal memory 507 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 502 executes the computer program stored in the memory, it implements a self-calibrating wrist surface electromyography gesture recognition method according to Embodiment 1 above. The self-calibrating wrist surface electromyography gesture recognition method includes the following steps:
[0205] S1. Data acquisition steps: Multi-channel acquisition of surface electromyography signals of the wearer when performing gesture tasks;
[0206] S2. Data preprocessing steps: Baseline drift removal, filtering, noise reduction, and action segment judgment are performed on the multi-channel surface electromyography signals to extract three time-domain features, which constitute a 3D feature vector.
[0207] S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the 3D feature vector into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model), and perform offline network training.
[0208] S4. Online self-calibration inference steps: After the user wears the wrist electromyography device, labeled data is collected first. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model.
[0209] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0210] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0211] Example 5
[0212] This embodiment provides a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, it implements a self-calibrating wrist surface electromyography gesture recognition method according to Embodiment 1 above. The self-calibrating wrist surface electromyography gesture recognition method includes the following steps:
[0213] S1. Data acquisition steps: Multi-channel acquisition of surface electromyography signals of the wearer when performing gesture tasks;
[0214] S2. Data preprocessing steps: Baseline drift removal, filtering, noise reduction, and action segment judgment are performed on the multi-channel surface electromyography signals to extract three time-domain features, which constitute a 3D feature vector.
[0215] S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the 3D feature vector into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model), and perform offline network training.
[0216] S4. Online self-calibration inference steps: After the user wears the wrist electromyography device, labeled data is collected first. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model.
[0217] If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures.
[0218] If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
[0219] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0220] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A self-calibrated wrist surface electromyography gesture recognition method, characterized in that, The gesture recognition method includes: S1. Data acquisition steps: Multi-channel acquisition of surface electromyography signals of the wearer when performing gesture tasks; S2. Data preprocessing steps: The multi-channel surface electromyography (EMG) signals are processed by baseline drift removal, filtering, noise reduction, and action segment determination to extract three time-domain features, forming a 3D feature vector; the data preprocessing steps are as follows: S21. Filter, window, and segment the multi-channel surface electromyography signal; S22. For the t=1,2,…,T window of the C=1,2,3 channel, extract the mean absolute value, root mean square value, and waveform length to form a 3-dimensional feature vector. For the 3 channels, there are T windows for each channel. Extract a 3-dimensional feature vector for each window. Finally, after data preprocessing, obtain the sEMG feature vector matrix with a matrix size of [3,T,3]. S3. Offline pre-training steps: Construct a CNN-LSTM-Attention network model for gesture recognition, input the 3D feature vector into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model), and perform offline network training. S4. Online self-calibration inference steps: After the user wears the wrist electromyography device, labeled data is collected first. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model. If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures. If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
2. The self-calibrated wrist surface electromyography gesture recognition method according to claim 1, characterized in that, The data acquisition steps include: S11. Wear the wrist electromyography device on your wrist. The metal dry electrodes collect multi-channel surface electromyography signals of the wrist by contacting the skin of the wrist. Each channel corresponds to the signal collected by a group of dry electrodes. S12. The electromyography (EMG) sensor linearly amplifies, bandpass filters, and boosts the level of the raw signal collected by the metal dry electrode to obtain an effective EMG signal. The linear amplification is 1000 times, the bandpass filtering range is 20~200Hz, and the level boosting increases the reference voltage from 0V to 1.5V. Finally, the EMG analog signal is converted into an EMG digital signal.
3. The self-calibrated wrist surface electromyography gesture recognition method according to claim 1, characterized in that, In step S22, the formulas for calculating the mean absolute value (MAV), root mean square value (RMS), and waveform length (WL) are as follows: in This represents the sEMG value at the i-th sampling point within a window, where I represents the total number of sampling points within a window.
4. The self-calibrated wrist surface electromyography gesture recognition method according to claim 1, characterized in that, The offline pre-training step uses sEMG datasets from multiple users to train the CLA model offline. The parameters of the CLA model are updated using the backpropagation algorithm, with cross-entropy loss as the loss function during the update process. in It is the one-hot encoding of the actual gesture action label. If the current sample belongs to the m-th type of gesture action, If it does not belong, then it is 0. It is the probability that the current sample is classified as class m by the CLA model. This indicates the total number of categories. The gesture categories include thumb extension, index finger extension, middle finger extension, ring finger extension, little finger extension, wrist inversion, wrist eversion, palm extension, fist clenching, and OK gesture. This represents the total loss value, which is the difference between the current prediction and the true label.
5. The self-calibrated wrist surface electromyography gesture recognition method according to claim 1, characterized in that, The CLA model comprises a CNN part, an LSTM part, and an Attention part connected sequentially. The CNN part performs convolution and batch normalization operations on the input feature vector matrix [C,T,3], and then uses the ReLU activation function and global response normalization to transform it to obtain the output feature sequence. The LSTM part outputs the feature sequence from the CNN part. Perform time series modeling to obtain a high-dimensional time series representation sequence. ; The Attention component represents the high-dimensional temporal sequence. Multi-head attention mechanism learning is used to obtain aggregated context feature vectors. Each attention head is responsible for independently learning the dependency structure in a feature subspace. For each attention head, the query vector is computed. Key vector Sum value vector Query vector The key vector represents the current location that needs attention. The value vector represents the position associated with the query vector. Representing the information contained in the corresponding key vector, the computational representation of the multi-head attention mechanism is as follows: , and These represent the weight matrices that represent the linear mappings of the query vector, key vector, and value vector, respectively. Used to map input data to the query vector space. Used to map input data to a key vector space These three vectors are used to map the input data to the value vector space. They are randomly initialized at the beginning of the training of the CLA model and updated through backpropagation during the training process of the CLA model. Let the number of attention heads be h. The formula for calculating multi-head attention is: in, This represents the result of multi-head attention calculation. This represents the attention calculation result of the p-th attention head. , This represents the output weight matrix, used to linearly map the results of multi-head attention to the final output; Concat() represents the concatenation operation; Attention of each head The calculation formula is , in, They represent the first The weight matrix of the query vector, key vector, and value vector of each attention head. The query vector space used to map input data to the p-th attention head. The key vector space used to map input data to the p-th attention head. Used to map input data to the value vector space of the p-th attention head; Used for matrices respectively and Perform a linear mapping. Used to calculate the influence weight of each input weight matrix on each element of the output sequence; Through context feature vectors The gesture recognition results are obtained.
6. The self-calibrated wrist surface electromyography gesture recognition method according to claim 1, characterized in that, The online self-calibration inference step includes: S41. After the user wears the wrist electromyography device, collect sEMG data and gesture labels corresponding to the standard movements of each gesture to construct an initial labeled dataset. ,in It is the feature vector of the n=1,2,…,Nth sample. It is the gesture label of the nth sample, which will be used to initially label the data. The initial accuracy is calculated by inputting the CLA model into the offline pre-training part. ,Compare With the preset threshold ; S42, if This indicates that the CLA model in the offline pre-training part is suitable for the user under test and can be directly applied to the current user's real-time gesture recognition task. At this time, it enters the online inference stage, where the CLA model recognizes and outputs the gesture recognition results. S43, if Then, semi-supervised online self-calibration is performed, as follows: S431, Based on initial marker data Train a KNN model and use it to process newly acquired pseudo-labeled samples. For gesture prediction, the KNN model uses the following formula: in The indicator function is defined as follows: This represents the gesture label predicted by the KNN model, where K represents the distance. The most recent K samples, where b represents the pseudo-labeled sample. The corresponding actual gesture label; pseudo-labeled samples and their corresponding prediction labels Added as pseudo-label data to the labeled data To obtain new labeled data The calculation formula is: ; S432, Transfer new tag data The CLA model is input for self-calibration. The model output is obtained through forward propagation. The error is evaluated using the cross-entropy loss function. The gradient is calculated through backpropagation. The model weights are fine-tuned through backpropagation and the Adam optimizer. S433, Introducing a stability regularization term This controls the offset between the outputs of the old and new models, prevents overfitting to pseudo-labeled data, and improves the adaptive stability of the model. Stability regularization term The calculation formula is: ,in This is the τth time after the CLA model self-calibration, for pseudo-labeled samples. The prediction results This is the prediction result of the τ-1th CLA model self-calibration on the same input data, denoted by "". " indicates norm 2 operation; A stability regularization term is introduced to form the total loss function in the self-calibration phase. : in The cross-entropy classification loss for pseudo-labeled samples. The regularization coefficient is . The value ranges from 0 to 1; S434, Repeat process S431-S434 until the condition is met. Finally, the self-calibrated CLA model was used for online gesture recognition.
7. A self-calibrating wrist surface electromyography (EMG) gesture recognition system, used to implement the self-calibrating wrist surface EMG gesture recognition method according to any one of claims 1 to 6, characterized in that, The gesture recognition system includes: The data acquisition module is used to acquire surface electromyography signals of the wearer during gesture tasks through multiple channels; The data preprocessing module performs baseline drift removal, filtering, noise reduction, and action segment determination on the multi-channel surface electromyography signals, extracting three time-domain features to form a 3D feature vector. The data preprocessing module works as follows: Filtering, windowing, and segmentation of the multi-channel surface electromyography (EMG) signals were performed. For the t=1,2,…,T windows of the C=1,2,3 channels, the mean absolute value, root mean square value, and waveform length are extracted to form a 3-dimensional feature vector. For the 3 channels, there are T windows for each channel, and a 3-dimensional feature vector is extracted for each window. Finally, after data preprocessing, the sEMG feature vector matrix is obtained, and the matrix size is [3,T,3]. The offline pre-training module constructs a CNN-LSTM-Attention network model for gesture recognition. The 3D feature vector is input into the CNN-LSTM-Attention network model (hereinafter referred to as the CLA model) for offline network training. The online self-calibration inference module first collects labeled data after the user wears the wrist electromyography device. The labeled data consists of multi-channel surface electromyography signal data corresponding to the specified number of seconds the user performs each gesture according to the instructions, as well as the action label corresponding to each gesture. The multi-channel surface electromyography signal data is referred to as sEMG data. The sEMG data and the corresponding action labels are input into the CLA model to verify the initial accuracy of the CLA model. If the initial accuracy has reached the preset threshold, online inference will begin, using the CLA model to recognize the user's real-time gestures. If the initial accuracy is lower than the preset threshold, the collected sEMG data will be labeled and the CLA model will be self-calibrated until the initial accuracy reaches the preset threshold. The self-calibrated CLA model will then be used for gesture recognition.
8. An electronic device comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the self-calibrated wrist surface electromyography gesture recognition method according to any one of claims 1 to 6.
9. A storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the self-calibrated wrist surface electromyography gesture recognition method according to any one of claims 1 to 6.