An open-set myoelectric pattern recognition method robust to electrode shift
Patent Information
- Application Number
- CN202611102930.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-27
AI Technical Summary
然而,在电极偏移条件下,特征空间的结构会发生变化,这将直接削弱开放集决策边界的稳定性
本发明在构建测试数据集的过程中,通过采集用户原始肌电信号并基于数据变换策略构建时域特征样本,以增强特征多样性。随后,将测试数据集输入训练好的肌电模式识别模型中。该训练好的肌电模式识别模型中融合肌肉协同约束的对比学习框架,在提高类内紧凑性和类间可分离性的同时,输出对电极偏移具有鲁棒性的语义特征向量、重构肌电特征图和预测动作类别标签。在此基础上,基于学习得到的语义特征向量,进一步获得每个测试样本与已知类别向量的语义相似性,以及基于学习得到的重构肌电特征图,进一步获得每个测试样本的重构一致性,并基于语义相似性、重构一致性以及预测动作类别标签构建联合决策机制,实现对已知动作模式的准确分类以及未知动作模式的可靠拒绝。本发明方法对电极偏移具有优异的鲁棒性能,且已知动作识别率高,未知动作拒绝性能好,商业潜力和应用价值巨大。
Smart Images

Figure CN122986584A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of physiological signal processing, specifically relating to a robust open-set electromyography pattern recognition method for electrode offset. Background Technology
[0002] Surface electromyography (sEMG) signals capture the neural drives behind muscle activation, providing a non-invasive way to decode human motor intentions. Therefore, sEMG is widely used in human-computer interaction systems as a control source for external devices. As a core technology in this field, myoelectric pattern recognition (MPR) establishes a mapping between muscle activity and multi-degree-of-freedom motor intentions, enabling natural and intuitive human-machine interaction (HMI). In recent years, MPR has been widely applied in commercial products, including smart prostheses and rehabilitation aids. Furthermore, due to its rapid response and direct reflection of user intentions, sEMG-based gesture interfaces have become a promising HMI method in consumer electronics such as virtual reality systems and wearable devices. Although previous studies have demonstrated the effectiveness of MPR under controlled laboratory conditions, its robustness in real-world applications remains a key challenge that has not yet been fully resolved.
[0003] In real-world HMI scenarios, a fundamental challenge limiting the deployment of MPR systems lies in the inherently open and uncertain nature of the operating environment, inevitably leading to the appearance of unknown gestures not included in the training set. Most traditional MPR methods are built upon the strict closed-set assumption, meaning the training and test sets contain identical sets of gesture categories. When these closed-set models are applied to real-world environments, they often force unknown samples into known categories, resulting in misclassification and serious safety hazards. This problem is particularly pronounced in safety-sensitive applications such as prosthetic control and rehabilitation robots, as incorrect predictions can trigger unexpected, sudden, or even harmful movement behaviors. Therefore, open-set recognition technology, capable of simultaneously recognizing known categories and rejecting unknown categories, is crucial for improving the safety and reliability of MPR systems.
[0004] Besides category uncertainty in the task space, MPR systems also face distribution shift issues during actual deployment, with electrode offset being one of the most significant influencing factors. Therefore, to adapt to the inevitable changes in sensor position caused by repeated device wear, skin deformation, and daily activities, MPR systems must be robust to electrode offset. Electrode offset significantly alters the spatial distribution characteristics of surface electromyography (EMG) signals, affecting not only signal amplitude but also the spatiotemporal activation patterns of different channels, thus severely reducing the recognition performance of pre-trained models.
[0005] Despite extensive research addressing these two challenges, current findings still lag significantly behind practical commercial applications. A key issue is that research on electrode shift robustness and open set recognition is typically conducted independently. The former focuses on classification stability under distribution shift conditions, while the latter emphasizes constructing decision boundaries for detecting and rejecting unknown categories. However, electrode shift alters the structure of the feature space, directly weakening the stability of open set decision boundaries. Since decision boundaries are built upon feature distributions learned during training, existing open set discrimination mechanisms often fail to maintain effectiveness when electrode shifts alter the feature distribution. Electrode shifts make traditional open set MPR methods unreliable in recognizing and rejecting unknown gestures. Therefore, developing an electromyography pattern recognition method that simultaneously possesses electrode shift robustness and anti-interference capabilities for unknown gestures remains a crucial challenge with significant commercial potential and application value. Summary of the Invention
[0006] The purpose of this invention is to provide an open-set electromyography pattern recognition method that is robust to electrode offset, capable of simultaneously handling electrode offset and unknown action (or gesture) interference, providing a unified solution for improving the robustness of sEMG-based motion interaction systems in open dynamic environments, and helping to promote their reliable deployment in practical application scenarios.
[0007] To achieve the above objectives, the present invention employs the following technical solution: A robust open-set electromyography pattern recognition method for electrode offset includes: acquiring raw electromyography signals of a user performing N action patterns to obtain test samples of N types of action patterns, where N is greater than 1; and extracting temporal features from each test sample to obtain a test dataset. Input the test dataset into the trained electromyography pattern recognition model to obtain the semantic feature vector, reconstruct the electromyography feature map and predict the action category label for each test sample; Based on the similarity between semantic feature vectors and multiple known category vectors, the pseudo-action category label and semantic similarity score corresponding to each test sample are determined; among them, the multiple known category vectors are determined based on the feature embedding space of the electromyography pattern recognition model; different known category vectors correspond to different action category labels; Based on the mean squared error between each test sample and its reconstructed electromyography feature map, a consistency score is determined for each test sample, and a joint confidence score for each test sample is determined based on the consistency score and semantic similarity score. When the joint confidence score of any test sample exceeds the category threshold and the predicted action category label is consistent with the pseudo action category label, the test sample is determined to be a known gesture and the predicted action category label is output as the final action category label. Otherwise, the test sample is determined to be an unknown gesture and is rejected. The category threshold is related to the predicted action category label.
[0008] Furthermore, the test dataset is input into the trained electromyography pattern recognition model to obtain the semantic feature vector, reconstructed electromyography feature map, and predicted action category label for each test sample, including: The test dataset is input into the backbone feature extraction network for feature extraction to obtain two initial feature vectors for each test sample. The first initial feature vector is input into the semantic representation branch to obtain the semantic feature vector and predicted action category label for each test sample; The second initial feature vector is input into the muscle coordination constraint branch to obtain the original coordination activation coefficient vector corresponding to each test sample; wherein, the original coordination activation coefficient vector is used to characterize the muscle coordination constraint information of the user in the current action mode; Based on the muscle coordinator library and the original co-activation coefficient vector, a reconstructed electromyographic feature map is generated. The muscle coordinator library is composed of training samples from different action modes.
[0009] Furthermore, based on the muscle coordination primitive library and the original co-activation coefficient vector, a reconstructed electromyographic feature map is generated, including: Based on the predicted action category label, a mask vector is determined, wherein the index position corresponding to the predicted action category label in the mask vector is set to one, and the other index positions are set to zero; Based on the mask vector, muscle co-activation primitive library, and original co-activation coefficient vector, a reconstructed electromyographic feature map is generated.
[0010] Furthermore, the second initial feature vector is input into the muscle co-constraint branch to obtain the original co-activation coefficient vector corresponding to each test sample, including: The second initial feature vector is input into the muscle coordination constraint branch for linear mapping and normalization. The second initial feature vector, after linear mapping and normalization, is subjected to non-negativity constraint through an activation function layer, outputting a non-negative original co-activation coefficient vector.
[0011] Furthermore, based on the similarity between the semantic feature vector and multiple known category vectors, the pseudo-action category label and semantic similarity score corresponding to each test sample are determined, including: The semantic feature vector is compared with multiple known category vectors using cosine similarity calculation to obtain multiple similarities; Determine the action category label of the known category vector corresponding to the maximum similarity among multiple similarity values; The action category label is determined as the pseudo-action category label for each test sample; The semantic similarity score is obtained by normalizing the maximum similarity.
[0012] Furthermore, for each known action pattern, the distribution of the joint confidence score of all samples under that action pattern is statistically analyzed, and the 10th percentile is taken as the category threshold of the action category corresponding to that action pattern.
[0013] Furthermore, the method also includes training an electromyography pattern recognition model using the following steps: Step 1: Collect raw electromyographic signals from the user when performing C action patterns at the initial electrode position to obtain training samples with action category labels, where C is greater than 1; construct a training dataset based on the training samples. Step 2: Construct a muscle coordination primitive library and perform data transformation for each training sample: Step 2.1: Based on the action category labels, divide the training dataset into several subsets corresponding to different action categories; each subset includes one or more training samples; for each subset corresponding to an action category, use a non-negative matrix factorization algorithm to decompose it into a class-specific muscle coordination primitive matrix and a corresponding activation coefficient matrix; concatenate all class-specific muscle coordination primitive matrices corresponding to all action categories along the column direction to construct a global muscle coordination primitive library. Step 2.2: Perform two independent random offset sampling and boundary expansion padding on each training sample to generate two enhanced feature views containing the same semantic information, forming the positive sample pair required for contrastive learning training; Step 3: Construct a contrastive learning neural network based on muscle coordination constraints: Step 3.1: Construct a convolutional neural network with shared parameters as the backbone feature extraction network. Input the two enhanced feature views generated for each training sample in Step 2 into the backbone feature extraction network to obtain two initial feature vectors for each training sample. Then, input the two initial feature vectors into the semantic representation branch and the muscle coordination constraint branch respectively. In the semantic representation branch, obtain the semantic feature vector based on the initial feature vectors. Step 3.2: In the muscle co-activation constraint branch, after linear mapping and normalization of the enhanced feature view, a vector is obtained. The vector is then subjected to non-negativity constraint through the activation function layer, and a non-negative original co-activation coefficient vector is output. Using the original coactivation coefficient vector, the muscle co-activation primitive library, and the action category label indicated by the semantic feature vector, a reconstructed electromyographic feature map corresponding to each training sample is generated; Step 3.3: Perform multi-task collaborative optimization on the semantic representation branch and the muscle collaboration constraint branch using the joint loss function. The joint loss function is a linear weighted combination of supervised contrastive learning loss, cross-entropy loss and reconstruction loss.
[0014] Further, in step one, the electrodes are an 8×4 high-density array. The extensor muscles of the arm are selected as the initial positions of the electrodes to collect the raw electromyography (EMG) signals when the user performs ten types of gesture movements. The raw EMG signals are segmented using a time window with a window length of 120ms and a step length of 60ms. Preprocessing includes extracting active segments using an adaptive threshold, defined as the average amplitude of the resting surface EMG signal plus three times its standard deviation. Active segment samples are then selected, and the active segment samples are subjected to 1-500Hz bandpass filtering and 50Hz notch filtering. Finally, time-domain features are extracted to form training samples. Further, in step 3.1, the backbone feature extraction network includes a first convolutional layer and a second convolutional layer; each of the first and second convolutional layers is sequentially connected to an activation function layer and a batch normalization layer; wherein, The first convolutional layer has 64 convolutional kernels, the second convolutional layer has 128 convolutional kernels, and the activation function layer uses the Swish activation function.
[0015] Furthermore, in step 3.3, the temperature parameter of the supervised contrastive learning loss is set to 0.1; the reconstruction loss is calculated using the Huber function, and the threshold parameter of the Huber function is set to 1.
[0016] Compared with the prior art, the present invention has the following technical features: This invention enhances feature diversity by collecting raw electromyographic (EMG) signals from users and constructing temporal feature samples based on data transformation strategies during the construction of the test dataset. The test dataset is then input into a pre-trained EMG pattern recognition model. This model incorporates a contrastive learning framework with muscle coordination constraints, improving intra-class compactness and inter-class separability while outputting semantic feature vectors robust to electrode shifts, reconstructed EMG feature maps, and predicted action category labels. Based on these, the semantic similarity between each test sample and known category vectors is obtained from the learned semantic feature vectors, and the reconstruction consistency of each test sample is obtained from the learned reconstructed EMG feature maps. A joint decision-making mechanism is constructed based on semantic similarity, reconstruction consistency, and predicted action category labels to achieve accurate classification of known action patterns and reliable rejection of unknown action patterns. This invention demonstrates excellent robustness to electrode shifts, high recognition rate for known actions, and good rejection performance for unknown actions, exhibiting significant commercial potential and application value. Attached Figure Description
[0017] Figure 1 A flowchart of an open-set electromyography pattern recognition method robust to electrode offset provided by an embodiment of the present invention; Figure 2 A schematic diagram of a high-density surface electromyography signal acquisition device and a movement mode provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electrode offset data acquisition scenario provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of a contrastive learning neural network structure based on muscle coordination constraints, provided in an embodiment of the present invention. Detailed Implementation
[0018] This invention provides a robust open-set electromyography (EMG) pattern recognition method resistant to electrode offset. First, raw EMG signals of multiple gestures (or various movement patterns) at the initial electrode position are acquired to construct a training dataset. Then, muscle co-factors for each gesture are extracted and concatenated into a global co-factor library, while a random translation is applied to the feature map to simulate the electrode offset effect. Next, a convolutional backbone network with shared parameters and a dual-branch structure are constructed, introducing a co-constrained reconstruction branch in addition to the semantic classification branch. Contrastive learning loss, cross-entropy loss, and reconstruction loss are jointly used for training. Subsequently, semantic cosine similarity and signal reconstruction consistency are fused in the embedding space to obtain a joint confidence score. This score is then combined with a category-specific threshold to classify known gestures and reject unknown gestures. This invention achieves high-precision recognition of known movement patterns and reliable rejection of unknown interference in the practical situation where electrode offset and open sets coexist.
[0019] Step 1: Collect raw electromyographic signals from the user when performing C known movement patterns at the initial electrode positions to obtain training samples labeled with movement category (C>1); perform routine preprocessing on each training sample to construct the training dataset. .
[0020] In this embodiment, the electrodes are an 8×4 high-density array. The extensor muscles of the arm are selected as the initial position of the electrodes. Raw electromyography (EMG) signals are collected when the user performs ten known gesture movement patterns. The raw EMG signals are segmented using a time window with a window length of 120ms and a step length of 60ms to obtain training samples with labels representing these ten movement patterns. Each training sample undergoes routine preprocessing. First, an adaptive threshold is used to extract the active segment, defined as the average amplitude of the resting sEMG signal plus three times its standard deviation, to filter out the active segment samples. Next, all active segment samples are bandpass filtered from 1 to 500 Hz, and four temporal features are extracted: Mean Absolute Value (MAV), Slope Sign Change (SSC), Zero Crossing (ZC), and Waveform Length (WL). This results in a training dataset consisting of all feature samples (including temporal feature samples). Each feature sample can be a feature map with a length × width × time equal to 8 × 4 × 4.
[0021] Step 2: Construct a muscle coordination primitive library and perform data transformation for each feature sample.
[0022] Step 2.1: Prepare the training dataset. Each feature sample in the dataset is converted into a one-dimensional vector. In this embodiment, each one-dimensional vector is represented as... Based on the gesture category labels (equivalent to action category labels), the one-dimensional training dataset is divided into several subsets corresponding to different gesture categories. (in c (Representing gesture categories). For each gesture category, a subset... The nonnegative matrix factorization algorithm is used to decompose it into class-specific muscle synergy primitive matrices. and the corresponding activation coefficient matrix Its mathematical expression is formula (1): (1) In this embodiment, the number of muscle coordinating primitives for each gesture category is set to . The corresponding class-specific muscle synergy primitive matrix is represented as follows: . Class-specific muscle coordination primitive matrices corresponding to all gesture categories. By splicing along the column direction, a global muscle coordination primitive library is constructed. This can be expressed as formula (2): (2) In the subsequent training of the neural network model, this global muscle coordination primitive library... The parameters are kept frozen (not participating in backpropagation updates) and introduced into the model as physiological prior constraints to guide subsequent signal reconstruction.
[0023] Step 2.2: To better generalize to the electrode position offset in actual wear, the training dataset described in Step 1 is used... The data is transformed, and two enhanced feature images are generated for each training sample through the data transformation strategy, which are used for subsequent training of the contrastive learning model.
[0024] In this embodiment, the 8×4 feature map in each time dimension is randomly translated in the spatial dimension. The translation amount is independently and uniformly sampled in the [-1, 1] pixel range (in pixel steps) in both the vertical (long side direction) and horizontal (wide side direction). For edge regions that appear blank due to spatial translation, a boundary copying strategy is used to fill pixels, ensuring that the size of the transformed feature sample remains unchanged at 8×4. For each transformed feature sample, two distinct but identical enhanced feature images containing the same semantic information are generated by performing two independent bidirectional uniform random offsets and boundary expansion padding, thereby constructing a positive sample pair for subsequent contrastive learning branch training.
[0025] Step 3: Construct a contrastive learning neural network based on muscle synergy constraints (i.e., the MPR model).
[0026] This step aims to construct a shared-parameter, two-branch neural network model. By combining semantic recognition with muscle co-reconstruction, it introduces physiological prior constraints while extracting classification features, thereby achieving robust electromyography pattern recognition. The specific implementation plan includes the following sub-steps: Step 3.1: Construct a shared-parameter Convolutional Neural Network (CNN) as the backbone feature extraction network. Input the dual-channel enhanced feature images generated by the data transformation in Step 2 into this backbone feature extraction network. The backbone feature extraction network contains at least two sequentially connected convolutional layers, each followed by a Swish activation function layer and a batch normalization (BN) layer. At the output of the second convolutional layer, a Global Average Pooling (GAP) layer is connected to transform the three-dimensional (length, width, and time) feature map into a one-dimensional feature embedding vector (equivalent to two initial feature vectors), i.e., the feature embedding vector. and feature embedding vector , Among them, the feature embedding vector Corresponding to the input semantic representation branch, feature embedding vector This is then fed into the muscle coordination constraint branch. In the semantic representation branch, the feature embedding vector is... The dimension is mapped using a fully connected layer, and then fed into a Softmax classifier to output the predicted category label of the current input sample to each known gesture category. Embed the features into the vector. conduct Regularization yields normalized semantic feature vectors. This is used for subsequent supervised contrastive learning loss calculations to narrow the distance between samples of the same class and widen the distance between samples of different classes.
[0027] In some embodiments, feature embedding vector Inputting the classifier into the semantic representation branch will output a predicted action category label. This can also be understood as the action category label indicated by the semantic feature vector.
[0028] In this embodiment, the first convolutional layer is configured with 64 convolutional kernels of size 3×3; the second convolutional layer is configured with 128 convolutional kernels of size 3×3.
[0029] Step 3.2: Muscle synergy constraint branch processing and signal reconstruction to obtain the reconstructed electromyography feature map. In the muscle synergy constraint branch, the feature embedding vector is... The vector is obtained by performing linear mapping and normalization. Then, a nonnegativity constraint is applied through a Softplus activation function layer, outputting a nonnegative vector of the original co-activation coefficients. To simulate the muscle co-activation mechanism under specific hand gestures, a dimension is defined as... c × kbinary mask vector Based on the current gesture category label of the input sample. c , mask vector m The middle corresponds only to the category c of k Set one of the cooperative primitive index positions to 1, and the rest to 0. Then, set the original cooperative activation coefficient vector... With mask vector m Perform element-wise multiplication to obtain the masked activation coefficient vector. This can be expressed as formula (3): (3) Utilizing the global muscle synergy primitive library constructed and solidified in step two With the masked activation coefficient vector Matrix multiplication is performed to reconstruct a one-dimensional electromyographic signal. This can be expressed as formula (4): (4) Subsequently, the one-dimensional electromyographic signal Rearranged into 3D reconstructed electromyographic feature maps with the same format as the original input. .
[0030] In other words, the reconstructed electromyographic feature map corresponding to each training sample is generated by using the original coactivation coefficient vector and the action category label indicated by the semantic feature vector.
[0031] In this embodiment, a dimension of 50 (i.e., 10×5) is defined. c =10, k=5 binary mask vector Based on the current gesture category label of the input sample. c , mask vector m The middle corresponds only to the category c Five coordinating primitive index positions are set to 1, and the remaining positions are set to 0. This utilizes the global muscle coordinating primitive library constructed and solidified in step two. With the masked activation coefficient vector Matrix multiplication is performed to reconstruct the restored one-dimensional electromyographic signal. Subsequently, the one-dimensional signal Rearranged to the same format as the original input Three-dimensional reconstructed electromyography feature map .
[0032] Step 3.3: Construction of Joint Loss Function and Optimization of Model Parameters. The joint loss function is used to perform multi-task collaborative optimization of the two-branch neural network. The joint loss function is derived from supervised contrastive learning loss. Cross-entropy loss and reconstruction loss It is composed of linearly weighted combinations. Total loss function L Represented as formula (5): (5) In this embodiment, the weighting coefficient is set to , The calculation schemes for each sub-loss function are as follows: For a containing N The training batch of training samples has a normalized semantic feature vector set of . For anchor point samples i The set of positive samples is defined as (in y j This refers to the category label, i.e., the predicted action category label; (with real labels), supervised contrastive learning loss. The mathematical expression for it is formula (6): (6) In this embodiment, the temperature parameter Set to 0.1.
[0033] Cross-entropy loss The mathematical expression used to constrain the accuracy of gesture classification is formula (7): (7) in, The sample represents the output of the classifier. i Belongs to its true label The predicted probability.
[0034] To improve the model's robustness to anomalous signals and local noise, the Huber function is used to calculate the original one-dimensional electromyography signal. x With reconstructed signal Reconstruction loss between As in formula (8): (8) in, The piecewise mathematical expression is formula (9): = (9) In this embodiment, parameters Set to 1.
[0035] Step 4: Construct the unknown action rejection module.
[0036] To achieve effective detection of unknown categories in open set scenarios, this invention proposes a rejection strategy based on category adaptive threshold and joint confidence, specifically including the following sub-steps: Step 4.1: Calculation of Prototype Vectors for Known Categories. In the trained feature embedding space, calculate the mean of the feature vectors of all training samples for each known gesture category, and use this as the prototype vector for that category. C c That is, a known category vector. Construct a structure containing all... c A set of prototype vectors of known categories.
[0037] Step 4.2: Joint confidence score calculation. For the input sample, the normalized semantic feature vector is first extracted using the backbone network. The cosine similarity is calculated with each known category prototype vector, and the pseudo-category label is determined based on the maximum similarity criterion. The maximum similarity is then normalized to the range [0,1] to obtain the semantic similarity score. S Meanwhile, based on pseudo-category labels Muscle coordination constraints are constructed to reconstruct the input signal, resulting in a reconstructed signal. The mean square error between the original and reconstructed signals is calculated and normalized to obtain the reconstruction consistency score M. S and M are then weighted and fused to obtain a joint confidence score, which comprehensively reflects the confidence level of the sample in both semantic matching and physiological plausibility.
[0038] Step 4.3: Determining Category-Specific Thresholds. For example, the 10th percentile of the joint confidence score corresponding to each category is used as the category. c Decision threshold To achieve the optimal balance between known classifications and unknown rejections, Defined as formula (10): (10) Step 4.4: During the inference phase, calculate the joint confidence score and pseudo-class label for each test sample. At the same time, input the sample into the Softmax classifier to obtain the predicted class. When the joint confidence score exceeds the corresponding class threshold and the classifier's predicted class is consistent with the pseudo-class, it is determined to be a known gesture and the final class label is output. Otherwise, it is determined to be an unknown gesture and is rejected.
[0039] Step 5: Using the trained contrastive learning neural network and the unknown action rejection module, perform known action pattern classification and unknown action rejection tests on the electromyographic signals collected under electrode offset conditions.
[0040] Step 5.1: Using the trained MPR model, collect raw electromyographic signals from the user while performing N movement patterns using repositioned high-density electromyographic electrodes to obtain test samples of N types of movement patterns, where N≥C; perform routine preprocessing on each test sample to construct a test dataset. Here, the test dataset This can include unknown operating modes and electrode offsets.
[0041] In this embodiment, an 8×4 high-density electrode array is repositioned on the arm extensor muscles. For testing purposes, the electrodes are placed in four offset positions: the left distal, left proximal, right distal, and right proximal positions, respectively, relative to the initial electrode positions in step one. Raw electromyographic (EMG) signals are collected when the user performs 19 different hand gesture patterns at these four offset positions. The raw EMG signals are then segmented using a time window of 120ms and a step size of 60ms, as described in step one, to obtain an unlabeled test sample dataset of 19 different movements. .
[0042] It should be noted that the feature extraction method for test samples can be the same as that for training samples, both involving temporal feature extraction to enhance feature diversity and provide a foundation for robust representation learning. Here, the learning process of test samples in the MPR model is also consistent with that of training samples, and will not be elaborated further in this invention.
[0043] Step 5.2: Test sample dataset A joint confidence score is calculated for each test sample. First, the confidence score (Score) and pseudo-label are calculated for each test sample. and classifier prediction The final output of each test sample is defined by formula (11): (11) A sample is considered to belong to a known class when the confidence score exceeds the corresponding class threshold and the classifier prediction matches the pseudo-label. Otherwise, the sample is considered inconsistent with the existing class distribution and is therefore rejected as an unknown class.
[0044] It should be noted that after training the MPR model through steps one to three, only step five needs to be executed when predicting new electromyographic signals. The parameters in step five can be obtained through step four. In other words, the method disclosed in this invention includes: collecting raw electromyographic signals from a user performing N action patterns to obtain test samples of N types of action patterns, where N is greater than 1; extracting temporal features from each test sample to obtain a test dataset; inputting the test dataset into a trained electromyographic pattern recognition model to obtain a semantic feature vector, reconstructed electromyographic feature map, and predicted action category label for each test sample; determining the pseudo-action category label and semantic similarity score for each test sample based on the similarity between the semantic feature vector and multiple known category vectors; wherein the multiple known category vectors are feature embeddings based on the electromyographic pattern recognition model. The spatial definition is as follows: different known category vectors correspond to different action category labels; based on the mean square error between each test sample and its reconstructed electromyography feature map, the consistency score of each test sample is determined, and based on the consistency score and semantic similarity score, the joint confidence score of each test sample is determined; when the joint confidence score corresponding to any test sample exceeds the category threshold and the predicted action category label is consistent with the pseudo action category label, the test sample is determined to be a known gesture and the predicted action category label is output as the final action category label; otherwise, the test sample is determined to be an unknown gesture and is rejected. Here, the category threshold is related to the predicted action category label.
[0045] The specific process of each step can be found in the descriptions of steps one through five above. For the sake of brevity, it will not be repeated here.
[0046] For details, see Figure 1As shown, the robust open-set electromyography pattern recognition method for electrode offset includes: Step S11, obtaining samples. Here, samples include training samples and test samples. Training samples can be samples composed of known gestures when the electrode is in the initial position. Test samples can be samples composed of known and unknown gestures when the electrode is in the initial position. Next, step S12 is executed to preprocess the samples, step S13 is executed to transform the data of the preprocessed samples, and step S14 is executed to construct the collaborative primitive library. Here, steps S12 to S14 can be referred to the description of steps one to two above, and will not be repeated here for the sake of brevity. It should be noted that steps S12 to S14 are executed during model training, and only steps S12 to S13 are executed during model use. Next, step S15 is executed to input the extracted feature vectors into the model. The model includes a backbone network, a semantic representation branch, and a collaborative constraint branch. After the feature vectors pass through the semantic representation branch, semantic feature vectors can be obtained. The semantic feature vector can be used to predict the classification label in step S16 and to calculate the joint loss in step S17. After passing through the co-constraint branch, the feature vector yields the original co-activation coefficient vector, which can be used to generate the reconstructed electromyography feature map and to calculate the joint loss in step S17. Here, the joint loss is used to optimize the model parameters to improve model performance. Next, step S18 is executed, inputting the classification label, semantic feature vector, and original co-activation coefficient vector learned by the model into the unknown action rejection module. Then, step S19 is executed, determining whether it is a known category based on the rejection module logic. If yes, step S20 is executed to obtain the known category; otherwise, step S22 is executed to reject the output.
[0047] See Figure 2 As shown on the left, a high-density surface electromyography (EMG) signal acquisition device includes an 8×4 high-density electrode array. Electrodes 1 to 4 are placed in the first horizontal row, and then each subsequent row is arranged incrementally until electrodes 29 to 32 are placed horizontally, thus forming an 8-row × 4-column high-density electrode array. Here, the spacing between two electrodes in each row can be 15 mm, and the spacing between two electrodes in each column can also be 15 mm. This high-density electrode array is placed on the extensor muscles of the arm for EMG signal detection. During detection, the movement pattern can be as shown in the gesture on the right.
[0048] See Figure 3 As shown, during electrode offset data acquisition, the electrode array can be offset relative to its initial position at the left distal end, left proximal end, right distal end, and right proximal end. The offset range can be within 10 mm.
[0049] See Figure 4 As shown, the vector obtained after the semantic representation branch of the enhanced feature image input is illustrated. The vector is obtained by inputting the enhanced feature image into the collaborative constraint branch (i.e., the muscle collaborative constraint branch) along with the category output (i.e., the predicted action category label) and the category output (i.e., the predicted action category label). and the original co-activation coefficient vector The vectors from the two branches can be used for comparative learning. Original co-activation coefficient vector. With mask vector m Combined, the activation coefficient vector after masking is obtained The activation coefficient vector after masking With Collaborative Primitive Library Combined with the reconstructed one-dimensional electromyographic signals .
[0050] This invention first constructs temporal feature samples through data transformation strategies to enhance feature diversity and provide a foundation for robust representation learning. Subsequently, a contrastive learning framework incorporating muscle co-constraints is introduced to improve intra-class compactness and inter-class separability while enhancing the model's robustness to distribution changes caused by electrode shifts. Building upon this, a joint decision-making mechanism fusing semantic similarity and reconstruction consistency is further constructed based on the learned representation features, enabling accurate classification of known gestures and reliable rejection of unknown gestures.
[0051] To verify the robust performance of the present invention against electrode offset in open set MPR, a comparative evaluation was conducted using MPR methods based on non-open sets and open sets. The evaluation covered the known class accuracy (KCA), unknown rejection rate (URR), and mean average (MA) of the two in two scenarios: no electrode offset and electrode offset.
[0052] In the comparison, Linear Discriminant Analysis-Mahalanobis Distance (LDA-MD) is a conventional non-open-set MPR method, while Convolutional Neural Network Confidence Estimation (CNNCE) and Convolutional Neural Network Auto-Encoder (CNNAE) are two deep learning-based open-set MPR methods. Since these methods are not designed for data distribution shifts and their performance degrades significantly in electrode offset scenarios, an adaptive open-set MPR method capable of handling data distribution shifts, namely Metric-Adapted Prototype Learning (MAPL), is introduced for comparison.
[0053] Table 1 Comparison of Open Set Electromyography Pattern Recognition Rate (%)
[0054] For example, Table 1 summarizes the average performance of seven subjects in both electrode-free and electrode-free scenarios. The comparison results in Table 1 show that the method of this invention achieves KCA and URR of 87.78% and 89.38% respectively in the electrode-free scenario, both superior to all compared methods. In the electrode-free scenario, the performance of LDA-MD and CNNCE drops sharply, with MA values of only 32.65% and 35.75% respectively, almost rendering them unusable. While CNNAE and MAPL show some robustness, their MA values decrease by 17.82 and 7.20 percentage points respectively compared to the electrode-free scenario. In contrast, the method of this invention only decreases KCA and URR by 2.47 and 1.89 percentage points respectively after electrode-free conditions, while maintaining a high MA value of 86.40%. This not only significantly outperforms all compared methods but also exhibits the smallest performance degradation, fully demonstrating the excellent robustness of the method of this invention against electrode-free conditions.
[0055] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A robust open-set electromyography pattern recognition method for electrode offset, characterized in that, include: Collect raw electromyographic signals of the user when performing N action patterns to obtain test samples of N types of action patterns, where N is greater than 1; After extracting time-domain features from each test sample, the test dataset is obtained. The test dataset is input into the trained electromyography pattern recognition model to obtain the semantic feature vector, reconstructed electromyography feature map and predicted action category label for each test sample; Based on the similarity between the semantic feature vector and multiple known category vectors, a pseudo-action category label and semantic similarity score are determined for each test sample; wherein, the multiple known category vectors are determined based on the feature embedding space of the electromyography pattern recognition model; different known category vectors correspond to different action category labels; Based on the mean squared error between each test sample and its reconstructed electromyography feature map, a consistency score is determined for each test sample, and a joint confidence score is determined for each test sample based on the consistency score and the semantic similarity score. When the joint confidence score corresponding to any test sample exceeds the category threshold and the predicted action category label is consistent with the pseudo action category label, the test sample is determined to be a known gesture and the predicted action category label is output as the final action category label; otherwise, the test sample is determined to be an unknown gesture and is rejected. The category threshold is related to the predicted action category label.
2. The robust open-set electromyography pattern recognition method for electrode offset according to claim 1, characterized in that, The electromyography pattern recognition model includes a backbone feature extraction network, a semantic representation branch, and a muscle coordination constraint branch. The step of inputting the test dataset into the trained electromyography pattern recognition model to obtain the semantic feature vector, reconstructed electromyography feature map, and predicted action category label corresponding to each test sample includes: The test dataset is input into the backbone feature extraction network for feature extraction to obtain two initial feature vectors for each test sample. The first initial feature vector is input into the semantic representation branch to obtain the semantic feature vector and the predicted action category label for each test sample; The second initial feature vector is input into the muscle coordination constraint branch to obtain the original coordination activation coefficient vector corresponding to each test sample; wherein, the original coordination activation coefficient vector is used to characterize the muscle coordination constraint information of the user in the current action mode; Based on the muscle coordinating primitive library and the original co-activation coefficient vector, the reconstructed electromyographic feature map is generated, wherein the muscle coordinating primitive library is composed of training samples from different action modes.
3. The robust open-set electromyography pattern recognition method for electrode offset according to claim 2, characterized in that, The process of generating the reconstructed electromyographic feature map based on the muscle coordinating primitive library and the original co-activation coefficient vector includes: Based on the predicted action category label, a mask vector is determined, wherein the index position corresponding to the predicted action category label in the mask vector is set to one, and the remaining index positions are set to zero; The reconstructed electromyographic feature map is generated based on the mask vector, the muscle co-activation primitive library, and the original co-activation coefficient vector.
4. The robust open-set electromyography pattern recognition method for electrode offset according to claim 2, characterized in that, The step of inputting the second initial feature vector into the muscle coordination constraint branch to obtain the original coordination activation coefficient vector corresponding to each test sample includes: The second initial feature vector is input into the muscle synergy constraint branch for linear mapping and normalization processing; The second initial feature vector, after linear mapping and normalization, is subjected to non-negativity constraint through an activation function layer, outputting a non-negative original co-activation coefficient vector.
5. The robust open-set electromyography pattern recognition method for electrode offset according to claim 1, characterized in that, The process of determining the pseudo-action category label and semantic similarity score for each test sample based on the similarity between the semantic feature vector and multiple known category vectors includes: The semantic feature vector is compared with the multiple known category vectors using cosine similarity calculation to obtain multiple similarities; Determine the action category label of the known category vector corresponding to the maximum similarity among the multiple similarities; The action category label is determined as the pseudo action category label corresponding to each test sample; The semantic similarity score is obtained by normalizing the maximum similarity.
6. The robust open-set electromyography pattern recognition method for electrode offset according to claim 1, characterized in that, For each known action pattern, the distribution of the joint confidence score of all samples under that action pattern is statistically analyzed, and the 10th percentile is taken as the category threshold of the action category corresponding to that action pattern.
7. The robust open-set electromyography pattern recognition method for electrode offset according to claim 1, characterized in that, The method also includes training the electromyographic pattern recognition model using the following steps: Step 1: Collect raw electromyographic signals from the user when performing C action patterns at the initial electrode position to obtain training samples with action category labels, where C is greater than 1; construct a training dataset based on the training samples. Step 2: Construct a muscle coordination primitive library and perform data transformation for each training sample: Step 2.1: Based on the action category labels, divide the training dataset into several subsets corresponding to different action categories; each subset includes one or more training samples; For each subset corresponding to a movement category, a nonnegative matrix factorization algorithm is used to decompose it into a class-specific muscle synergy primitive matrix and a corresponding activation coefficient matrix; the class-specific muscle synergy primitive matrices corresponding to all movement categories are concatenated along the column direction to construct a global muscle synergy primitive library; Step 2.2: Perform two independent random offset sampling and boundary expansion padding on each training sample to generate two enhanced feature views containing the same semantic information, forming the positive sample pair required for contrastive learning training; Step 3: Construct a contrastive learning neural network based on muscle coordination constraints: Step 3.1: Construct a convolutional neural network with shared parameters as the backbone feature extraction network. Input the two enhanced feature views generated for each training sample in Step 2 into the backbone feature extraction network to obtain two initial feature vectors for each training sample. Then, the two initial feature vectors are input into the semantic representation branch and the muscle coordination constraint branch, respectively; In the semantic representation branch, a semantic feature vector is obtained based on the initial feature vector; Step 3.2: In the muscle co-activation constraint branch, after linear mapping and normalization of the enhanced feature view, a vector is obtained, and the vector is constrained to be non-negativity through the activation function layer to output a non-negative original co-activation coefficient vector. Using the original coactivation coefficient vector, the muscle co-activation primitive library, and the action category label indicated by the semantic feature vector, a reconstructed electromyographic feature map corresponding to each training sample is generated. Step 3.3: Perform multi-task collaborative optimization on the semantic representation branch and the muscle coordination constraint branch using the joint loss function. The joint loss function is a linear weighted combination of supervised contrastive learning loss, cross-entropy loss and reconstruction loss.
8. The robust open-set electromyography pattern recognition method for electrode offset according to claim 7, characterized in that, The electrodes described in step one are an 8×4 high-density array. The extensor muscles of the arm are selected as the initial positions of the electrodes to collect the raw electromyography (EMG) signals when the user performs ten types of gesture movements. The raw EMG signals are segmented using a time window with a window length of 120ms and a step length of 60ms. Preprocessing includes extracting active segments using an adaptive threshold, defined as the average amplitude of the resting surface EMG signal plus three times its standard deviation. Active segment samples are then selected, and the active segment samples are subjected to 1-500Hz bandpass filtering and 50Hz notch filtering. Finally, time-domain features are extracted to form training samples.
9. The robust open-set electromyography pattern recognition method for electrode offset according to claim 7, characterized in that, The backbone feature extraction network described in step 3.1 includes a first convolutional layer and a second convolutional layer; both the first and second convolutional layers are sequentially connected to an activation function layer and a batch normalization layer; wherein, The first convolutional layer is configured with 64 convolutional kernels, the second convolutional layer is configured with 128 convolutional kernels, and the activation function layer uses the Swish activation function.
10. The robust open-set electromyography pattern recognition method for electrode offset according to claim 7, characterized in that, In step 3.3, the temperature parameter of the supervised contrastive learning loss is set to 0.1; the reconstruction loss is calculated using the Huber function, and the threshold parameter of the Huber function is set to 1.