Multi-attention-based hand myoelectricity continuous motion estimation method
By employing a deep learning model with multiple attention techniques, combining depthwise separable convolution, channel attention, and a Transformer encoder, the high computational cost and slow speed of continuous hand electromyography estimation in existing technologies are addressed, achieving efficient and accurate joint angle prediction.
Patent Information
- Application Number
- CN202511605634.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-04-10
AI Technical Summary
Existing deep learning models struggle to achieve high-precision real-time continuous motion estimation of hand electromyography in resource-constrained embedded devices, exhibiting problems such as high computational cost, slow inference speed, or low estimation accuracy.
A multi-attention-based approach is adopted, combining a depthwise separable convolution module, efficient channel attention, a Transformer encoder module, and a one-dimensional adaptive average pooling layer to extract and process features from electromyographic signals. The depthwise separable convolution module is used for feature extraction and dimensionality enhancement, the efficient channel attention is used to adjust channel weights, the Transformer encoder module is used to capture global dependencies, and the one-dimensional adaptive average pooling layer is used for feature compression, ultimately outputting the joint angle.
While maintaining computational efficiency, it improves the accuracy and speed of continuous hand electromyography estimation, making it suitable for resource-constrained embedded devices and meeting the low-latency requirements of real-time human-computer interaction.
Smart Images

Figure CN121834423A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of deep learning, in particular to a hand electromyographic continuous motion estimation method based on multi-attention. BACKGROUND
[0002] Paperless surface electromyography (sEMG) signals represent the activity of muscle fibers, which contain rich information about muscle activity during motor control, such as exerting force and maintaining gestures. Therefore, surface electromyography signals have been widely used in the analysis of motion in the fields of biomechanics, rehabilitation, and human-machine interaction (HMI). In the field of human-machine interaction, pattern recognition tasks can be divided into action classification and continuous motion estimation. Discrete classification is based on a predefined set of action categories, and the electromyography signal is mapped to the corresponding discrete label space by algorithm to realize the discrimination of specific actions. In contrast, continuous motion estimation technology focuses on real-time calculation of continuous parameters such as joint angles, motion trajectories, and force outputs from electromyography signals. Continuous motion estimation breaks through the limitations of fixed action categories and can more accurately and intuitively capture subtle changes in motion intent, showing significant advantages in simulating natural limb movements and achieving fine motion control.
[0003] In recent years, with the rise of deep learning, researchers have begun to apply deep learning algorithms to continuous motion estimation based on surface electromyography signals. However, high-precision models such as BERT and LS-TCN have large parameter quantities and high computational costs, resulting in long training and inference times, making it difficult to respond in real time on resource-constrained embedded devices such as intelligent prostheses and wearable sensors. Existing deep learning models such as Transformer and TCN often sacrifice inference speed (such as high self-attention calculation complexity) when improving prediction accuracy, or reduce estimation accuracy (such as TCN only capturing one-way time series information) when optimizing speed, making it difficult to meet the low-latency needs of real-time human-machine interaction. SUMMARY
[0004] In view of the deficiencies in the prior art, the purpose of the present application is to provide a hand electromyographic continuous motion estimation method based on multi-attention to solve the problems in the background art.
[0005] The present application is implemented as follows: a hand electromyographic continuous motion estimation method based on multi-attention, the method comprising the following steps: The surface electromyography signal is preprocessed and feature extracted, and the processed surface electromyography signal is input into a motion estimation model, the motion estimation model comprising a depth separable convolution module, an efficient channel attention, a Transformer encoder module, a one-dimensional adaptive average pooling layer, and a single-layer MLP. Feature extraction and dimension lifting are performed through a deep separable convolution module, and the weights of each channel are adaptively adjusted through efficient channel attention; An additive attention and a feedforward network are used through a Transformer encoder module to further capture global dependencies; Feature compression is performed through a one-dimensional adaptive average pooling layer, and each channel obtains its own average value to extract global information; The global information is input into a single-layer MLP layer for nonlinear mapping, and the joint angle is output.
[0006] As a further scheme of the present application, the deep separable convolution module performs two independent steps of depth convolution and point-by-point convolution, the depth convolution is used for independent convolution operation on each channel of the input information to retain the feature information in the channel, and the point-by-point convolution uses a convolution kernel to fuse information across channels and map the feature maps of multiple channels to a new feature space to realize information interaction and feature integration between channels.
[0007] As a further scheme of the present application, the step of adaptively adjusting the weights of each channel through efficient channel attention specifically includes: performing global average pooling to calculate the global average value of each channel of the input feature map to obtain a channel feature vector; performing convolution operation on the feature vector using one-dimensional convolution to model the dependency relationship of channel attention and obtain the weight of each channel, using a sigmoid activation function for normalization to generate the final channel attention score; and multiplying the calculated channel attention weight by the original input feature to enhance the feature information of important channels.
[0008] As a further scheme of the present application, the Transformer encoder module combines an additive attention mechanism and a feedforward network.
[0009] As a further scheme of the present application, the working steps of the Transformer encoder module are as follows: two matrices and are used to convert the input matrix X into a query matrix Q and a key matrix K, wherein , where R represents the real space of elements in the matrix, n is the number of tokens in the sequence, and d is the dimension of the embedding vector; the query matrix Q is multiplied by a learnable parameter vector to learn the attention weight of the query and generate a global attention query vector ; the query matrix is pooled according to the learned attention weight to generate a single global query vector , It is the attention weight for each token, representing the contribution of each token to the global query vector; it is obtained by mapping the input tokens to the query space. , The query vector is the query vector corresponding to the i-th token in the input sequence, with dimension d. A global query vector q, obtained through weighted pooling, integrates information from all tokens in the input sequence. Element-wise multiplication is used to combine the global query vector and the key matrix. The interactions between them are encoded to form global context information, which is then used to process the query matrix. Standardize and utilize global query vectors. The element-wise product of the key K and the key K is used to capture global context information; the interaction between the query and the key is processed through a linear transformation layer T, ultimately generating a hidden representation for each token. , .
[0010] As a further aspect of the present invention, the working steps of the one-dimensional adaptive average pooling layer are as follows: dividing the input data into several regions and calculating the average value of the regions; through adaptive pooling, the pooling window size will be automatically adjusted according to the length of the input data to ensure that the output length is the target size.
[0011] As a further aspect of the present invention, the output length is 1, and the electromyography signals of each channel are averaged to obtain the average value of all data points of each channel.
[0012] As a further aspect of the present invention, the single-layer MLP is used to flatten the processed electromyographic signal features and then transmit them to the linear layer, thereby mapping them to joint angles.
[0013] Compared with the prior art, the beneficial effects of the present invention are: This invention employs depthwise separable convolutions to reduce computational complexity and parameter size; it introduces an efficient channel attention module to maintain high computational efficiency while enhancing feature representation capabilities; and it improves inference speed based on the Transformer encoder component. Furthermore, each module progressively extracts and strengthens effective features, enabling the model to enhance its predictive ability for joint angles while preserving temporal information. Attached Figure Description
[0014] Figure 1 This is a flowchart of a multi-attention-based method for estimating continuous hand electromyography.
[0015] Figure 2 This is a structural diagram of the motion estimation model in the multi-attention-based continuous motion estimation method for hand electromyography.
[0016] Figure 3This is a schematic diagram of depth-separable convolution in a multi-attention-based method for estimating continuous electromyographic motion of the hand.
[0017] Figure 4 This is a schematic diagram of efficient channel attention in a multi-attention-based method for estimating continuous electromyographic movements of the hand.
[0018] Figure 5 This is a schematic diagram of the additive attention mechanism in a multi-attention-based method for estimating continuous hand electromyography. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0020] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0021] like Figure 1 and Figure 2 As shown, this embodiment of the invention provides a method for estimating continuous hand electromyography based on multi-attention, the method comprising the following steps: S100 performs preprocessing and feature extraction on surface electromyography (sEMG) signals, and inputs the processed surface electromyography signals into the motion estimation model. The motion estimation model includes a depthwise separable convolution module, an efficient channel attention module, a Transformer encoder module, a one-dimensional adaptive average pooling layer, and a single-layer MLP. S200 uses a depthwise separable convolutional module (DSC) for feature extraction and dimensionality enhancement, and adaptively adjusts the weights of each channel through efficient channel attention (ECA), which enhances the information of important channels and suppresses unimportant channels, thereby optimizing feature representation. The S300, through the Transformer encoder module, utilizes additive attention and a feedforward network to further capture global dependencies, thereby enhancing the expressive power of features; S400 uses a one-dimensional adaptive average pooling layer (AdaptiveAvgPool1d layer) to compress features, and each channel obtains its own average value, thus extracting more representative global information. The S500 inputs global information to a single-layer MLP layer for nonlinear mapping and outputs joint angles.
[0022] In this embodiment of the invention, Depthwise Separable Convolution (DSC) is an efficient convolution operation method widely used in lightweight deep learning models. The DSC module performs two independent steps: depthwise convolution and pointwise convolution. Depthwise convolution performs independent convolution operations on each channel of the input information, without simultaneously operating on all channels. This significantly reduces computational complexity while preserving feature information within each channel. Pointwise convolution uses convolution kernels to fuse information across channels, mapping feature maps from multiple channels to a new feature space, thus achieving information interaction and feature integration between channels.
[0023] like Figure 3 As shown, the kernel size in pointwise convolution is 1. 1. In depthwise convolution, the kernel size is always n. n, assuming the size of the input feature map is... The computational cost of standard convolution is approximately Where K is the size of the convolution kernel. The computational cost of depthwise separable convolution is reduced to... Compared to standard convolution, it reduces by approximately The computational cost was reduced. In this experiment, pointwise convolution was first performed to map the features of each input channel to a new dimension. Then, drawing on the principle of VIT image segmentation, a depthwise convolution with a stride of 10 was used for the Ninapro data to process each channel independently and extract local features. Finally, activation functions and normalization operations were used to further enhance the feature representation. The data was compressed in the time dimension and increased in the channel dimension.
[0024] like Figure 4 As shown, in this embodiment of the invention, Efficient Channel Attention (ECA) optimizes the traditional SE attention mechanism by using 1D convolution instead of fully connected layer operations. The step of adaptively adjusting the weights of each channel through Efficient Channel Attention specifically includes: performing global average pooling to calculate the global average value for each channel of the input feature map, obtaining a feature vector for one channel; and performing a 1D convolution operation on the feature vector to model the dependency relationship of channel attention, where k is a dynamically adjusted convolution kernel size. ,in Indicates closest The number of channels is an odd number, where C represents the channel dimension (i.e., the number of filters). By performing a logarithmic transformation on the number of channels, the influence of the number of channels on the kernel size is mitigated, allowing the kernel size to grow smoothly with the increase of the number of channels. Adding a constant term further adjusts the kernel size, ensuring a more balanced computational result. Finally, an odd-sized kernel is obtained, avoiding boundary issues in convolution operations, making the network more flexible and efficient in handling different inputs. After 1D convolution, the weights of each channel are obtained, normalized using the sigmoid activation function, and the final channel attention score is generated. The calculated channel attention weights are multiplied by the original input features to enhance the feature information of important channels while weakening the feature information of less important channels. The ECA method is used to extract electromyographic signal features between channels, enabling the simultaneous extraction of temporal scale information and inter-channel spatial information.
[0025] like Figure 5 As shown, in this embodiment of the invention, the Transformer encoder module combines an additive attention mechanism with a feedforward network to further capture global dependencies. The efficient additive attention mechanism can remove key-value interactions without sacrificing performance, and by simply focusing on effectively encoding query key interactions through merging linear projection layers, it is sufficient to understand the relationships between tags, resulting in faster inference speeds and more powerful contextual representations. The working steps of the Transformer encoder module are as follows: using two matrices... and Transform the input matrix X into a query matrix Q and a key matrix K, where , Where R represents the real space of elements in the matrix, n is the number of tokens in the sequence, and d is the dimension of the embedding vector; the query matrix Q is coupled with a learnable parameter vector. Multiply to learn the attention weights of the query and generate a global attention query vector. The query matrix is pooled based on the learned attention weights to generate a single global query vector. , This is the attention weight for each token, representing the contribution of each token to the global query vector. It is calculated using a self-attention mechanism based on the relationship between queries and keys. These are all scalars, typically derived using Softmax or other similar normalization methods, ensuring that the sum of all weights is 1; this is obtained by mapping the input token to the query space. , It is the query vector corresponding to the i-th token in the input sequence, with dimension d; specifically, it is generated by combining the query vectors of all tokens through a weighted pooling operation to produce a global query vector q. The query vector for each token... They will all be based on their corresponding attention weights Weighting is applied to determine which tokens are more important and which tokens' information should be assigned higher weights. Ultimately, through this weighted pooling method, the resulting global query vector q integrates information from all tokens in the input sequence, and the weights of this information are dynamically adjusted according to the model's learning process. This global query vector can be used for subsequent attention calculations or other tasks; element-wise multiplication is used to combine the global query vector and the key matrix. The interactions between them are encoded to form global context information, which is then used to process the query matrix. Standardize and utilize global query vectors. The element-wise product of the key K and the key K is used to capture global context information; the interaction between the query and the key is processed through a linear transformation layer T, ultimately generating a hidden representation for each token. , This method is more computationally efficient than traditional MHSA, reducing computational complexity while ensuring information capture.
[0026] In this embodiment of the invention, the working steps of the one-dimensional adaptive average pooling layer are as follows: the input data is divided into several regions, and the average value of each region is calculated; through adaptive pooling, the pooling window size is automatically adjusted according to the length of the input data to ensure that the output length is the target size. The output length is 1, and the electromyography signal of each channel is averaged, and each channel obtains the average value of all its data points. This can effectively compress the dimensionality of the signal, retain key information, and reduce computational complexity, making it suitable for extracting global features from long-term sequences.
[0027] In this embodiment of the invention, the single-layer MLP is used to flatten the processed electromyographic signal features and then transmit them to the linear layer, thereby mapping them to joint angles.
[0028] In this embodiment of the invention, experiments were conducted on the publicly available NinaPro dataset. This dataset includes not only surface electromyography (sEMG) signals but also multiple modalities such as kinematic data, inertial measurement unit data, force data, and video data, aiming to promote machine learning research on human, robotic, and prosthetic hands. The NinaPro dataset comprises 10 sub-databases, each with different subjects and data acquisition devices. The primary dataset used was NinaPro DB2, which recorded experimental data from 40 healthy subjects aged 23-45 years, with heights ranging from 150-192 cm and weights from 44-105 kg. There were 29 males and 11 females, with a left-handed / right-handed ratio of 5 / 35. A total of 49 different types of hand movements were included, which were categorized into two types based on function and complexity: the first type consisted of 17 basic finger movements; the second type comprised 23 grasping and functional movements. Based on previous research, eight grasping actions from Ninapro were randomly selected, including large-diameter grip, small-diameter grip, fixed hook grip, index finger extension grip, medium full grip, ring grip, strength ball grip, and strength disk grip. Furthermore, to accommodate the model size, the Ninapro data was divided into three categories: the first category of actions was divided into 1-8 and 9-17, and the second category of actions was divided into 18-25, 26-33, and 34-40 for performance evaluation.
[0029] In this embodiment of the invention, the raw electromyography (EMG) signals are often affected by various noises and cannot be directly used for analysis. Therefore, appropriate filtering methods must be used to remove these noises. The Butterworth filter is a commonly used filter, widely applied in signal filtering due to its smooth frequency response. Therefore, a fourth-order Butterworth filter was applied to the NinaPro dataset in this experiment, with a frequency range of 20-500Hz. Furthermore, common noises during EMG signal acquisition include 50Hz power frequency interference and the superposition of other bioelectrical signals. The 50Hz power frequency interference mainly originates from radiation from electronic devices connected to the power supply and can usually be effectively removed by a notch filter. Therefore, a 50Hz notch filter was used in this experiment to remove power frequency interference. sEMG is a non-stationary and noisy bioelectrical signal, making its signal characteristics analysis quite challenging. To effectively utilize these signals to identify human movement intentions, feature extraction is the most crucial step. In the feature extraction stage, the sliding window analysis method is typically used. The basic principle of this method is: a fixed-size window is slid across the original dataset, features are extracted from each window, and feature extraction is completed step by step as the window moves. The specific steps are as follows: 1. Window Size: Sets the number of samples contained in the window, usually based on the frequency of information collection. 2. Step Size: The window moves across the dataset in fixed steps. The step size can be a preset fixed value or dynamically adjusted according to the characteristics of the dataset. 3. Feature Extraction: Treats each time point of the window as an independent sample and performs feature extraction. Commonly used feature extraction methods include time domain, frequency domain, and time-frequency domain analysis. The features extracted in this experiment are RMS features. 4. Output Results: The features extracted from each window will be output as the final feature vector.
[0030] In this embodiment of the invention, for processing the Ninapro dataset, the width of the sliding window is set to 200 sampling points, and the step size is set to 1 sampling point. After feature extraction, a normalization method can be used to keep the electromyographic signals within a certain dynamic range, which can improve the resolution of low-amplitude signal regions and make the algorithm better able to capture changes in the electromyographic signals. Specifically, the μ-law normalization method is used, using the formula... , where x i This is the input signal value, and μ is a compression parameter that determines the compression strength, with a value of 2. 20 Specifically, first separate and retain x. i Symbolic information (sign(x)) i Next, a crucial nonlinear transformation is applied to the absolute value of the normalized signal: calculating ln(1+μ|x) iThe logarithmic operation effectively compresses signals with larger amplitudes while relatively enhancing the details of signals with smaller amplitudes. To ensure that the final output value strictly falls within [−1,1], the result of the logarithmic transformation is divided by the normalization factor ln(1+μ). Finally, the original sign separated in the first step is multiplied back to give the compressed amplitude the correct positive and negative polarities, resulting in the final compressed output value.
[0031] Finally, the proposed algorithm was compared with commonly used models such as TCN, BERT, and LSTM to fully verify its performance in the continuous hand motion estimation task. All models were built on PyTorch 2.0 and trained on an NVIDIA GeForce RTX 3060 GPU. The optimizer used was AdamW, with batch size, number of iterations, and learning rate of 64, 100, and 0.001, respectively. During the experiments, to improve performance, the learning rate for all model parameters was reduced to 0.0001 after half of the iterations.
[0032] Three main experiments were conducted in this embodiment of the invention: 1. A comparative experiment was conducted on eight movements selected from the electromyographic information of 40 subjects in the Ninapro DB2 dataset.
[0033] 2. The 40 actions of 40 subjects in the Ninapro DB2 dataset were divided into five groups: 1-8, 9-17, 18-25, 26-33, and 34-40. The performance of each model was recorded for each group in each run, and the performance of the models was evaluated.
[0034] 3. The training time of different models was statistically analyzed, and the inference speed of different algorithms on portable devices was compared using a RASPBERRY PI-4B as the hardware platform.
[0035] To evaluate the relationship between this method and other methods, three evaluation criteria are proposed, as follows: 1. Pearson Correlation Coefficient: The Pearson Correlation Coefficient (PCC) is a commonly used indicator to measure the linear relationship between two variables. Its value ranges from -1 to 1. A positive PCC indicates that there is a positive correlation between the variables, and the higher the coefficient, the closer the estimated joint angle is to the true joint angle. ,in , , and These are the estimated joint angle, the average of the estimated joint angle, the actual joint angle, and the average of the actual joint angle, respectively.
[0036] 2. Coefficient of determination R 2R-squared, also known as the coefficient of determination, is a commonly used tool for evaluating the applicability of regression models. It ranges from 0 to 1, with higher values indicating better model approximation. ,in , , and These are the estimated joint angle, the average of the estimated joint angle, the actual joint angle, and the average of the actual joint angle, respectively.
[0037] 3. Normalized Root Mean Square Error (NRMSE): This is a widely used metric for evaluating the performance of regression models. When predicting joints at different locations, NRMSE addresses the issue of inconsistent data distribution. NRMSE values range from 0 to 1, with lower values indicating a higher degree of closeness between the predicted and actual results. ,in , , and These represent the estimated joint angle, the actual joint angle, the maximum actual joint angle, and the minimum actual joint angle.
[0038] The above description only details the preferred embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0039] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0040] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0041] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the disclosure in the specification and embodiments. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A method for estimating continuous hand electromyography based on multi-attention, characterized in that, The method includes the following steps: The surface electromyography (SEMG) signal is preprocessed and its features are extracted. The processed SEMG signal is then input into the motion estimation model, which includes a depthwise separable convolutional module, an efficient channel attention module, a Transformer encoder module, a one-dimensional adaptive average pooling layer, and a single-layer MLP. Feature extraction and dimensionality enhancement are performed using depthwise separable convolution modules, and the weights of each channel are adaptively adjusted using efficient channel attention. The global dependencies are further captured using the Transformer encoder module, which leverages additive attention and a feedforward network. Feature compression is performed using a one-dimensional adaptive average pooling layer, and the average value of each channel is obtained to extract global information. Global information is input into a single-layer MLP layer for nonlinear mapping, and the joint angle is output.
2. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The depthwise separable convolution module runs two independent steps: depthwise convolution and pointwise convolution. Depthwise convolution is used to perform independent convolution operations on each channel of the input information, preserving the feature information within each channel. Pointwise convolution uses convolution kernels to fuse information across channels, mapping the feature maps of multiple channels to a new feature space, thus realizing information interaction and feature integration between channels.
3. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The steps of adaptively adjusting the weights of each channel through efficient channel attention specifically include: performing global average pooling to calculate the global average value for each channel of the input feature map, obtaining a feature vector for one channel; performing convolution operation on the feature vector using one-dimensional convolution to model the dependency relationship of channel attention, obtaining the weight of each channel; normalizing using the sigmoid activation function to generate the final channel attention score; and multiplying the calculated channel attention weights by the original input features to enhance the feature information of important channels.
4. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The Transformer encoder module combines an additive attention mechanism with a feedforward network.
5. The hand electromyography continuous motion estimation method based on multi-attention according to claim 4, characterized in that, The Transformer encoder module operates as follows: using two matrices... and Transform the input matrix X into a query matrix Q and a key matrix K, where , Where R represents the real space of elements in the matrix, n is the number of tokens in the sequence, and d is the dimension of the embedding vector; the query matrix Q is coupled with a learnable parameter vector. Multiply to learn the attention weights of the query and generate a global attention query vector. The query matrix is pooled based on the learned attention weights to generate a single global query vector. , It is the attention weight for each token, representing the contribution of each token to the global query vector; it is obtained by mapping the input tokens to the query space. , The query vector is the query vector corresponding to the i-th token in the input sequence, with dimension d. A global query vector q, obtained through weighted pooling, integrates information from all tokens in the input sequence. Element-wise multiplication is used to combine the global query vector and the key matrix. The interactions between them are encoded to form global context information, which is then used to process the query matrix. Standardize and utilize global query vectors. Element-wise product of key K is used to capture global context information; The interaction between queries and keys is processed through a linear transformation layer T, ultimately generating a hidden representation for each token. , .
6. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The working steps of the one-dimensional adaptive average pooling layer are as follows: the input data is divided into several regions, and the average value of the regions is calculated; through adaptive pooling, the pooling window size will be automatically adjusted according to the length of the input data to ensure that the output length is the target size.
7. The method for estimating continuous hand electromyography based on multi-attention according to claim 6, characterized in that, The output length is 1, and the electromyography signal of each channel is averaged to obtain the average value of all data points of each channel.
8. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The single-layer MLP is used to flatten the processed electromyographic signal features and then pass them to the linear layer, thereby mapping them to joint angles.
9. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, The raw surface electromyography signal was noise-removed using a Butterworth filter with a frequency range of 20Hz-500Hz.
10. The method for estimating continuous hand electromyography based on multi-attention according to claim 1, characterized in that, When performing feature extraction on surface electromyography signals, a sliding window analysis method is used. A fixed-size window is slid across the original dataset, and features are extracted from each window. The feature extraction is completed step by step as the window moves.
