Muscle force estimation method based on combination of long and short term memory and attention mechanism
By combining the multi-channel fusion strength estimation method with long and short-term memory networks and attention mechanisms, the problem of insufficient multi-channel signal fusion and model generalization capabilities in the prior art is solved, and high-precision and stable muscle strength estimation is achieved.
Patent Information
- Application Number
- CN202510001463.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-06
AI Technical Summary
Existing strength assessment methods have challenges in multi-channel signal fusion, attention mechanism application and model generalization capabilities, resulting in insufficient assessment accuracy and reliability.
A multi-channel fusion muscle strength estimation method based on long and short-term memory network (LSTM) and attention mechanism is used to perform weight estimation and feature screening of multi-channel signals through channel attention, self-attention and mixed attention mechanisms to achieve high-precision muscle strength estimation.
It improves the accuracy and stability of muscle strength estimation, enhances the ability to predict muscle strength changes, and is suitable for rehabilitation medical care, sports training, and human-computer interaction.
Smart Images

Figure CN119924838A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of bioelectric signal processing, and specifically is a muscle strength estimation method based on long-term and short-term memory combined with attention mechanism. Background Art
[0002] Diseases such as stroke, disability, motor impairment and hemiplegia can cause limb function loss in patients. Limb motor rehabilitation training is required in the follow-up treatment stage of patients. Through motor rehabilitation training, patients' limb function can be gradually improved and restored, so that they can return to society. Traditional motor rehabilitation training methods have high labor intensity for rehabilitation therapists, and it is difficult to ensure the intensity and continuity of patient training. There is a lack of effective methods to objectively evaluate the training effect and training program, which affects the therapeutic effect of motor rehabilitation training. The surface electromyography (sEMG) signal of muscles contains information such as the degree of muscle activation and muscle contraction force. By collecting the surface electromyography signal of muscles for analysis and using mathematical modeling methods to calculate muscle strength, this can become a new evaluation method for sports rehabilitation training. However, the physiological and non-physiological factors of muscles will affect the sEMG signal, which makes the estimation of muscle strength based on surface electromyography quite difficult and challenging.
[0003] Traditional muscle strength assessment methods mainly rely on physical testing and biosignal measurement. Physical testing methods, such as handheld dynamometers and isokinetic muscle strength testing, are direct but often time-consuming and difficult to monitor continuously. Biosignal measurement methods, especially the combined use of surface electromyography (sEMG) and force sensors, provide a wireless, real-time monitoring method for muscle strength assessment. However, these methods have some limitations: they usually can only provide limited muscle activity information and it is difficult to capture the complexity and dynamic changes of muscle activity; in addition, individual differences, signal noise and environmental interference also seriously affect the accuracy and reliability of the assessment.
[0004] In recent years, with the development of deep learning technology, especially the application of recurrent neural networks (RNN) and long short-term memory networks (LSTM), new perspectives have been provided for muscle strength assessment. These models are able to process time series data and capture the dynamic changes of muscle activity, thereby improving the accuracy of assessment. However, most existing studies focus on the processing of single-channel signals and ignore the potential of multi-channel signal fusion. Multi-channel signals, such as surface electromyography signals and force sensor data from multiple locations, can provide more comprehensive muscle activity information, but how to effectively fuse this information and extract key features remains a challenge.
[0005] Attention mechanism is another important progress in the field of deep learning, which enables the model to focus on the key parts of the input data and improve the performance of the model. In muscle strength assessment, this means that the model can focus on the key features of muscle activity and improve the accuracy of the assessment. However, how to combine attention mechanism with muscle strength assessment, especially in the context of multi-channel signal fusion, is still an underexplored area.
[0006] In addition, existing muscle strength assessment models often lack generalization capabilities, that is, the performance in different individuals or under different conditions may vary greatly. This is because these models are usually trained and tested based on a single dataset, lacking diversity and complexity. Therefore, developing a muscle strength assessment model that can work stably across multiple subjects and conditions is crucial to improving its effectiveness in practical applications.
[0007] Although muscle strength assessment technology has made some progress, there are still many challenges, including how to effectively fuse multi-channel signals, how to use attention mechanisms to improve assessment accuracy, and how to improve the generalization ability of the model. Summary of the invention
[0008] The purpose of the present invention is to overcome the shortcomings of the prior art and propose a multi-channel fusion muscle strength estimation method based on long and short-term memory combined with attention mechanism. Through deep learning technology, the accuracy of muscle strength estimation is optimized, and the ability to predict the trend of muscle strength changes is enhanced, providing a scientific basis for rehabilitation medicine, sports training, human-computer interaction and other fields.
[0009] In order to achieve the above object, the technical solution specifically adopted by the present invention is as follows:
[0010] A muscle force estimation method based on a long short-term memory network combined with an attention mechanism is proposed. Based on a long short-term memory network (LSTM) and an attention mechanism, a channel attention mechanism, a self-attention mechanism, and a hybrid attention mechanism are combined to estimate weights and screen channels for different channels of each subject. After the model is trained, the method adaptively pays attention to its own channel to allocate weights, thereby realizing high-precision fusion and analysis of surface electromyography (sEMG) and force signal data collected by multiple subjects under different conditions. Specifically, the method includes the following steps:
[0011] S1, synchronously collect high-density surface electromyographic signals and force data in real time at a sampling frequency of 2000 Hz through electromyographic sensors and force sensors to obtain original signals;
[0012] S2, performing denoising and filtering processing on the original signal, including wavelet denoising, threshold quantization, soft threshold processing and signal reconstruction;
[0013] S3. Construct a channel attention mechanism module to perform weight estimation and channel screening on different channels of each subject. The channel attention mechanism module includes two fully connected layers FC, one as a dimensionality reduction layer and the other as a dimensionality increase layer, and the formula is expressed as:
[0014] y=Wx+b
[0015] Among them, W is the weight matrix, which contains the weights of all connections, and b is the bias vector, which is usually used to adjust the linear transformation of the output.
[0016] Finally, the importance of different channels is obtained, and the formula is expressed as:
[0017] v = softmax(W2·(tanh(W1·s - +b1)+b2))
[0018] Among them, s - As channel statistics, W1 and b1 are used as weight parameters and bias vectors of the dimensionality reduction layer, the reduction rate r and tanh function are used as activation functions, and W2 and b2 are used as weight parameters and bias vectors of the dimensionality increase layer.
[0019] S4, input the time series data of channel weights and spatial features processed by the channel attention mechanism module into the long short-term memory network LSTM model;
[0020] S5. Construct a residual connection module and a self-attention mechanism module, add a residual connection between the LSTM model and the self-attention mechanism module, allow the output of the previous layer to be directly passed to the input of the next layer, so that the input is identically mapped to the output and output together with the data information passed through the self-attention mechanism module, so that the self-attention mechanism pays more attention to its own information, and then, use the self-attention mechanism module to assign weights to each sEMG signal sample;
[0021] S6. Construct a hybrid attention mechanism module CBAM, and perform data fusion on the training results of multiple subjects through the hybrid attention mechanism module; the hybrid attention mechanism module CBAM combines the attention of the two dimensions of channel and space, and realizes adaptive optimization of the feature map by multiplying the output of channel attention and spatial attention; this mechanism can simultaneously emphasize important channels and spatial positions in the feature map, enhance the ability of feature representation, and improve the accuracy of muscle strength estimation.
[0022] S7. The mean square error (MSE) and Pearson correlation coefficient are introduced to calculate the results of data training fusion to measure the accuracy of muscle force estimation.
[0023] Furthermore, the step S2 specifically includes the following steps:
[0024] S2.1 performs wavelet decomposition on the original signal. Given a signal f(k), where k is a sampling point, its wavelet transform expression is:
[0025]
[0026] Among them, j is the scale parameter, J is the optimal scale, N is the length of the time series, and ψ represents the wavelet function;
[0027] S2.2 performs threshold quantization on the wavelet coefficients, selects the threshold as the hard threshold, and performs soft threshold quantization on the wavelet coefficients of this layer. The soft threshold operation expression is:
[0028]
[0029] Among them, T is the threshold, and T is selected as 0.2;
[0030] S2.3 reconstructs the wavelet component after soft threshold processing to obtain the denoised surface electromyography signal; the reconstruction formula is expressed as:
[0031]
[0032] in, and are the conjugates of h and g respectively.
[0033] Furthermore, the long short-term memory network LSTM model includes a forget gate, an input gate, a candidate cell state and an output gate; wherein:
[0034] The forget gate is used to filter the data from the previous node and decide which information should be forgotten from the cell state, so that only necessary information is retained for subsequent processing. The calculation formula is:
[0035] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0036] Among them, σ represents the sigmoid activation function, W f and b f are the weight matrix and bias term of the forget gate, h t-1 is the hidden state of the previous time step, x t is the input of the current time step;
[0037] The input gate and candidate cell state are used to update the cell state; it includes two stages. In the first stage, the input gate controls the inflow of new information, while the candidate cell state stores the new information. The calculation formula is as follows:
[0038] it =σ(W i ·[h t-1 ,x t ]+b i )
[0039]
[0040] Among them, i t is the activation value of the input gate, W i and b i are the weight matrix and bias term of the input gate respectively, and tanh is the hyperbolic tangent activation function;
[0041] The second stage: Combine the results of the forgetting stage and the memory selection stage to update the cell state. The calculation formula is as follows:
[0042]
[0043] Among them, C t is the cell state at the current time step, C t-1 is the cell state at the previous time step;
[0044] The output gate is used to determine what information will be output to the next hidden state. The calculation formula is as follows:
[0045] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0046] h t =o t *tanh(C t )
[0047] Among them, t is the activation value of the output gate, W o and b o are the weight matrix and bias term of the output gate, h t is the hidden state at the current time step.
[0048] Furthermore, the gradient clipping technology is introduced into the long short-term memory network LSTM model. When the norm of the gradient exceeds a preset threshold, the gradient is clipped to the threshold, thereby preventing the gradient from becoming too small during the back propagation process; specifically, the implementation steps of the gradient clipping are as follows:
[0049] (1) The loss function is calculated during the forward propagation process of the network, and the gradient of the loss function with respect to each network parameter is calculated through the back-propagation process.
[0050] (2) For each parameter’s gradient vector, calculate its L2 norm, which is the square root of the sum of the squares of the elements of the gradient vector.
[0051] (3) Set a threshold as the upper limit of the gradient. During the training process, if the L2 norm of the gradient of any parameter exceeds this threshold, gradient clipping is performed.
[0052] (4) Gradient clipping is achieved by scaling the gradient vector proportionally to ensure that the L2 norm of the gradient is equal to the preset threshold. Specifically, if the gradient vector is g and the threshold is T, the gradient vector g′ after gradient clipping is calculated as:
[0053]
[0054] Among them, ∥g∥2 represents the L2 norm of the gradient vector.
[0055] (5) Monitor the magnitude of the gradient throughout the training process to ensure that gradient clipping is triggered when necessary to maintain the stability of the training process.
[0056] Furthermore, in step S5, a self-attention mechanism module is used to assign a weight to each sEMG signal sample by exploring the intrinsic importance of each sample, which specifically includes the following steps:
[0057] (1) Calculate the similarity z′ of different points in each sample i To better describe the specific meaning, the obtained z′ i can be considered as the sample h′ from the i-th i In addition, two bias terms are added to the inside and outside of the activation function, which are expressed as follows:
[0058] z′ i =f(h′ i ,q i )=W T σ(W′1 h′ i +W′2 q i +b′1)+b′
[0059] Among them, q i represents the intrinsic similarity of the i-th sEMG signal, q i is a linear transformation based on the eigenvector h′ i The generated alignment vector has the same dimension as the feature vector; the σ activation function is an exponential linear unit, W′ and b′ are the weight and bias terms of the σ function, W′1 and W′2 are weight parameters, and b′1 is the bias vector;
[0060] (2) The attention scores are normalized by the softmax function and converted into attention weights in the form of probability distribution, ensuring that the sum of the attention weights of all time steps is 1.
[0061] Furthermore, in step S6, the data fusion process includes:
[0062] The training results of the two subjects are used in sequence to perform data fusion through the hybrid attention mechanism to obtain the fused training results; then the training data of a new subject is used to obtain the fused data through the hybrid attention mechanism, and multiple experiments and training are carried out in sequence.
[0063] Furthermore, in step S7:
[0064] The formula for calculating the mean square error is:
[0065]
[0066] In the formula, represents the actual muscle strength estimation result, Represents the predicted muscle force estimation result; MSE represents the error between the actual muscle force estimation result and the predicted muscle force estimation result after denoising. The smaller the MSE, the better the prediction result.
[0067] The calculation formula of Pearson correlation coefficient is:
[0068]
[0069] In the formula, R 2 It indicates the similarity between the actual muscle force estimation result and the predicted muscle force estimation result. The larger the R is, the better the prediction effect is. F It is the average of the actual muscle strength estimation results.
[0070] The present invention has the following characteristics and beneficial effects:
[0071] The present invention collects multi-channel surface electromyography (sEMG) and force signal data from multiple subjects, uses long short-term memory network (LSTM) and attention mechanism for fusion analysis, applies channel attention, self-attention and hybrid attention mechanism to muscle strength assessment, effectively screens and strengthens key surface electromyography signal features, and suppresses noise and unimportant information. This allows the model to focus more on features that have a significant impact on muscle strength changes, improves the accuracy of muscle strength estimation, and has excellent accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a schematic diagram of the experiment of the present invention;
[0073] Figure 2 This is a flow chart of a muscle strength estimation method based on a long short-term memory network combined with an attention mechanism according to an embodiment of the present invention;
[0074] Figure 3 Schematic diagram of the long short-term memory model structure in an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0076] Implementation paradigm and experimental environment description:
[0077] Adjust the seat height so that the subject can sit comfortably on the experimental chair. Ask the subject to relax his waist and back to avoid body displacement caused by muscle fatigue. Let the subject's upper arm hang naturally, with the elbow joint slightly higher than the table, and the five fingers hold the grip device, and look at the binocular head-up display.
[0078] Before the experiment, the skin was wiped with alcohol, and then two multi-channel high-density sEMG electrodes were connected to the muscle peaks of the corresponding muscles of the subject's dominant hand. The subject was asked to pull and hold the hand dynamometer to the maximum extent to obtain the maximum voluntary contraction (MVC) of the corresponding subject.
[0079] The experiment required the subjects to perform a constant force grip at 50% MVC, and a reference line of 50% MVC was displayed on the screen. After determining the MVC of each subject, the healthy subjects were asked to perform 3 rounds of experiments using a handgrip. Each round of the experiment consisted of 5 trials, each trial included 5 seconds of gripping and 5 seconds of rest. The end was prompted by the computer audio signal. There was a 2-minute rest period between each experiment to avoid muscle fatigue.
[0080] Subject composition: 5 people in the youth group, aged 22±3, 3 male subjects and 2 female subjects.
[0081] In order to reduce the impact of environmental factors on the accuracy of experimental equipment, the data collection period for this experiment was selected in the afternoon, and the experimental collection environment temperature was 25±4℃. Figure 1 Schematic diagram of the experimental process.
[0082] Figure 2 To provide a flow chart of the invention method model, the following are the corresponding specific steps:
[0083] S1. High-density surface electromyographic signals and force data are collected synchronously and in real time at a sampling frequency of 2000 Hz through electromyographic sensors and force sensors. The force data is quantified by a 24-bit precision analog-to-digital converter (ADC) and transmitted to the microprocessor in real time via serial communication. The electromyographic sensors and force sensors communicate with the host computer software and display the collected grip force changes synchronously on the display.
[0084] Where S = {S1, S2, ..., S n} sEMG signal of the subject, n is the number of subjects;
[0085] S2. Perform denoising and filtering on the original signal. Specifically:
[0086] S2.1 performs wavelet denoising on the surface electromyography signal: the original signal is decomposed by wavelet. Given a signal f(k), k is the sampling point, its wavelet transform expression is:
[0087]
[0088] Among them, j is the scale parameter, J is the optimal scale, N is the length of the time series, and ψ represents the wavelet function.
[0089] In this embodiment, the Mallet algorithm is used to implement the wavelet transform, and the expression is:
[0090] Sf(j+1,k)=Sf(j,k)*h(j,k)
[0091] Wf(j+1,k)=Sf(j,k) * g(j,k)
[0092] Among them, h and g are the low-pass and high-pass filters corresponding to the scaling function and wavelet function respectively; Sf(0,k) refers to the original signal; Sf(j,k) refers to the scaling coefficient; Wf(j,k) refers to the wavelet coefficient, abbreviated as w j,k .
[0093] S2.2 Threshold quantization and soft threshold processing of wavelet coefficients: select the threshold as hard threshold, and perform soft threshold quantization processing on the wavelet coefficients of this layer. The soft threshold operation expression is:
[0094]
[0095] Among them, T is the threshold, and T is selected as 0.2.
[0096] S2.3 Signal reconstruction: Reconstruct the wavelet component after soft threshold processing to obtain the denoised surface electromyography signal. The reconstruction formula is expressed as:
[0097]
[0098] in, and are the conjugates of h and g respectively.
[0099] S3. Construct a channel attention mechanism module to perform weight estimation and channel screening for different channels of each subject. In this embodiment, in order to improve the generalization ability, two fully connected layers FC are added to the channel attention mechanism, one as a dimensionality reduction layer and the other as a dimensionality increase layer. The formula is expressed as follows:
[0100] y=Wx+b
[0101] Among them, W is the weight matrix, which contains the weights of all connections, and b is the bias vector, which is usually used to adjust the linear transformation of the output.
[0102] The channels in a set of processed sEMG signals for each subject are: S i =[s1,s2,…,s m ](i=1,2,…,m), i is the number of channels; the mean is applied to each channel in the module Merge to obtain channel statistics s - , m is the average value of the i-th channel. It is calculated as follows:
[0103]
[0104] Finally, the importance of different channels is obtained, and the formula is expressed as:
[0105] v = softmax(W2·(tanh(W1·s - +b1)+b2))
[0106] Among them, s - As channel statistics, W1 and b1 are used as weight parameters and bias vectors of the dimension reduction layer, the reduction rate r and tanh function are used as activation functions, and W2 and b2 are used as weight parameters and bias vectors of the dimension increase layer;
[0107] S4. Input the time series data of channel weights and spatial features processed by the channel attention mechanism module into the long short-term memory network LSTM model, which specifically includes three steps:
[0108] 1) LSTM network passes the forget gate (z f ) filters the data from the previous node and determines which information should be forgotten from the cell state, so that only necessary information is retained for subsequent processing. This process is achieved through the following formula:
[0109] f t =σ(W f·[h t-1 ,x t ]+b f )
[0110] Among them, σ represents the sigmoid activation function, W f and b f are the weight matrix and bias term of the forget gate, h t-1 is the hidden state of the previous time step, x t is the input for the current time step.
[0111] 2) Through the input gate (z i ) and candidate cell states To update the cell state. It includes two stages. In the first stage, the input gate controls the inflow of new information, while the candidate cell state stores the new information. The calculation formula is as follows:
[0112] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0113]
[0114] Among them, i t is the activation value of the input gate, W i and b i are the weight matrix and bias term of the input gate respectively, and tanh is the hyperbolic tangent activation function;
[0115] The second stage: Combine the results of the forgetting stage and the memory selection stage to update the cell state. The calculation formula is as follows:
[0116]
[0117] Among them, C t is the cell state at the current time step, C t-1 is the cell state at the previous time step.
[0118] 3) The output gate (z0) determines which information will be output to the next hidden state. The calculation of the output gate is as follows:
[0119] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0120] h t =o t *tanh(C t )
[0121] Among them, t is the activation value of the output gate, W o and b o are the weight matrix and bias term of the output gate, h t is the hidden state at the current time step.
[0122] S5. Construct a residual connection module and a self-attention mechanism module, add a residual connection between the LSTM model and the self-attention mechanism module, allow the output of the previous layer to be directly passed to the input of the next layer, and use the self-attention mechanism module to assign weights to each sEMG signal sample. Specifically: Use the self-attention mechanism module to assign weights to each sEMG signal sample by exploring the intrinsic importance of each sample, and the public representation is as follows:
[0123] z′ i =f(h′ i ,q i )=W T σ(W1h′ i +W2q i +b1)+b
[0124] Among them, q i represents the intrinsic similarity of the i-th sEMG signal, q i is a linear transformation based on the eigenvector h′ i The generated alignment vector has the same dimension as the feature vector. The σ activation function is an exponential linear unit, W and b are the weight and bias terms of the σ function, W1 and W2 are weight parameters, and b1 is the bias term.
[0125] The attention scores are normalized by the softmax function and converted into attention weights in the form of probability distribution, ensuring that the sum of the attention weights of all time steps is 1.
[0126] S6. Construct a hybrid attention mechanism module CBAM to fuse the training results of multiple subjects through the hybrid attention mechanism module. When fusion is performed, the training results A1 and A2 of two subjects are first fused by hybrid attention mechanism to obtain the fusion training result A. 12 , and then use the new subject's trained data A3 to obtain the fused data A through the hybrid attention mechanism 123 , and obtain the final fusion data A 123···n .
[0127] S7. Introduce mean square error (MSE) and Pearson correlation to calculate the result of data training fusion to measure the accuracy of muscle strength estimation. Among them:
[0128] Mean Square Error:
[0129]
[0130] In the formula, represents the actual muscle strength estimation result, Represents the predicted muscle force estimation result. Here, MSE represents the error between the actual muscle force estimation result and the predicted muscle force estimation result after denoising. The smaller the MSE, the better the prediction result.
[0131] Pearson correlation coefficient:
[0132]
[0133] In the formula, R 2 It indicates the similarity between the actual muscle strength estimation result and the predicted muscle strength estimation result. The larger the R is, the better the prediction effect is. F It is the average of the actual muscle strength estimation results.
[0134] Figure 3 The figure is a schematic diagram of the structure of the long short-term memory model. The long short-term memory model consists of three stages: Forgetting stage: In this process, the current node filters the data from the previous node and performs a forgetting operation on some of the data. This process is implemented by the following formula:
[0135] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0136] Among them, σ represents the sigmoid activation function, W f and b f are the weight matrix and bias term of the forget gate, h t-1 is the hidden state of the previous time step, x t is the input for the current time step.
[0137] Memory selection phase: This phase is complementary to the previous phase, in which the remaining data is “remembered” after filtering out the less important data in the forget phase. The calculations for this phase are as follows:
[0138] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0139]
[0140] Among them, it is the activation value of the input gate, W i and b i are the weight matrix and bias term of the input gate respectively, and tanh is the hyperbolic tangent activation function.
[0141] Output stage: This stage comes after the first two stages. After filtering and retention, this stage determines the data to be used for the current state output. The calculation of the output gate is as follows:
[0142] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0143] h t =o t *tanh(C t )
[0144] Among them, t is the activation value of the output gate, W o and b o are the weight matrix and bias term of the output gate, h t is the hidden state at the current time step.
[0145] The results are shown in Table 1. The results show that in the multi-channel fusion data set of multiple subjects, the multi-channel fusion muscle strength estimation method based on long short-term memory combined with attention mechanism proposed in the present invention is superior to the long short-term memory method without adding attention mechanism and the long short-term memory method with only adding single attention mechanism in all indicators, which improves the accuracy of muscle strength estimation and has excellent accuracy.
[0146] Table 1: Mean square error (MSE), Pearson correlation coefficient (R 2 )
[0147]
[0148] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A muscle strength estimation method based on long short-term memory network combined with attention mechanism, characterized in that: The following steps are involved: S1, synchronously collect high-density surface electromyographic signals and force data in real time at a sampling frequency of 2000 Hz through electromyographic sensors and force sensors to obtain original signals; S2, performing denoising and filtering processing on the original signal, including wavelet denoising, threshold quantization, soft threshold processing and signal reconstruction; S3, build a channel attention mechanism module to perform weight estimation and channel screening for different channels of each subject; S4, input the time series data of channel weights and spatial features processed by the channel attention mechanism module into the long short-term memory network LSTM model; S5. Construct a residual connection module and a self-attention mechanism module, add a residual connection between the LSTM model and the self-attention mechanism module, and use the self-attention mechanism module to assign weights to each sEMG signal sample; S6. Construct a hybrid attention mechanism module to fuse the training results of multiple subjects through the hybrid attention mechanism module; S7. The mean square error (MSE) and Pearson correlation coefficient are introduced to calculate the results of data training fusion to measure the accuracy of muscle force estimation.
2. A muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: The step S2 specifically includes the following steps: S2.1 performs wavelet decomposition on the original signal. Given a signal f(k), where k is a sampling point, its wavelet transform expression is: Among them, j is the scale parameter, J is the optimal scale, N is the length of the time series, and ψ represents the wavelet function; S2.2 performs threshold quantization on the wavelet coefficients, selects the threshold as the hard threshold, and performs soft threshold quantization on the wavelet coefficients of this layer. The soft threshold operation expression is: Among them, T is the threshold, and T is selected as 0.2; S2.3 reconstructs the wavelet component after soft threshold processing to obtain the denoised surface electromyography signal; the reconstruction formula is expressed as: in, and are the conjugates of h and g respectively.
3. A muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: The channel attention mechanism module includes two fully connected layers FC, one as a dimensionality reduction layer and the other as a dimensionality increase layer, and the formula is expressed as: y=Wx+b Among them, W is the weight matrix, which contains the weights of all connections, and b is the bias vector, which is usually used to adjust the linear transformation of the output. Finally, the importance of different channels is obtained, and the formula is expressed as: v=softmax(W2·(tanh(W1·s - +b1)+b2)) Among them, s - As channel statistics, W1 and b1 are used as weight parameters and bias vectors of the dimensionality reduction layer, the reduction rate r and tanh function are used as activation functions, and W2 and b2 are used as weight parameters and bias vectors of the dimensionality increase layer.
4. A muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: The long short-term memory network LSTM model includes a forget gate, an input gate, a candidate cell state and an output gate; wherein: The forget gate is used to filter the data from the previous node and decide which information should be forgotten from the cell state, so that only necessary information is retained for subsequent processing. The calculation formula is: f t =σ(W f ·[h t-1 ,x t ]+b f ) Among them, σ represents the sigmoid activation function, W f and b f are the weight matrix and bias term of the forget gate, h t-1 is the hidden state of the previous time step, x t is the input of the current time step; The input gate and candidate cell state are used to update the cell state; it includes two stages. In the first stage, the input gate controls the inflow of new information, while the candidate cell state stores the new information. The calculation formula is as follows: i t =σ(W i ·[h t-1 ,x t ]+b i ) Among them, i t is the activation value of the input gate, W i and b i are the weight matrix and bias term of the input gate respectively, and tanh is the hyperbolic tangent activation function; The second stage: Combine the results of the forgetting stage and the memory selection stage to update the cell state. The calculation formula is as follows: Among them, C t is the cell state at the current time step, C t-1 is the cell state at the previous time step; The output gate is used to determine what information will be output to the next hidden state. The calculation formula is as follows: the t =σ(W o ·[h t-1 ,x t ]+b o ) h t =o t *tanh(C t ) Among them, t is the activation value of the output gate, W o and b o are the weight matrix and bias term of the output gate, h t is the hidden state at the current time step.
5. The muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: In step S5, a weight is assigned to each sEMG signal sample by exploring the intrinsic importance of each sample, which specifically includes the following steps: (1) Calculate the similarity z of different points in each sample i ′ To describe a specific meaning, the obtained z i ′ As the sample h from the i-th i ′ The feature vector of , and two bias terms are added to the inside and outside of the activation function, which are expressed as follows: With i ′ =f(h i ′ ,q i )=In T σ(W1 ′ h i ′ +W2 ′ q i +b1 ′ )+b ′ Among them, q i represents the intrinsic similarity of the i-th sEMG signal, q i is a linear transformation based on the eigenvector h i ′ The generated alignment vector has the same dimension as the feature vector; the σ activation function is the exponential linear unit, W′ and b ′ are the weight and bias of the σ function, W1 ′ 、W2 ′ is the weight parameter, b1 ′ is the bias vector; (2) The attention scores are normalized by the softmax function and converted into attention weights in the form of probability distribution, ensuring that the sum of the attention weights of all time steps is 1.
6. A muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: The hybrid attention mechanism module combines the attention in two dimensions, channel and space, and achieves adaptive optimization of the feature map by multiplying the outputs of channel attention and spatial attention.
7. A muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: In step S6, the data fusion process includes: The training results of the two subjects are used in sequence to perform data fusion through the hybrid attention mechanism to obtain the fused training results; then the training data of a new subject is used to obtain the fused data through the hybrid attention mechanism, and multiple experiments and training are carried out in sequence.
8. The muscle strength estimation method based on long short-term memory network combined with attention mechanism as claimed in claim 1, characterized in that: In the step S7: The formula for calculating the mean square error is: In the formula, represents the actual muscle strength estimation result, represents the predicted muscle force estimation result; MSE represents the error between the actual muscle force estimation result and the predicted muscle force estimation result after denoising. The smaller the MSE, the better the prediction result. The calculation formula of Pearson correlation coefficient is: In the formula, R 2 It indicates the similarity between the actual muscle force estimation result and the predicted muscle force estimation result. The larger the R is, the better the prediction effect is. F It is the average of the actual muscle strength estimation results.
Citation Information
Patent Citations
Implementation method of myoelectricity mode recognition and muscle force estimation
CN114631820A
Video prediction method and system based on space-time decoupling and self-attention difference LSTM
CN116524419A
Cerebropathy detection system based on multi-field feature fusion and attention mechanism
CN117084693A
Upper arm muscle force estimation method based on double-branch self-attention mechanism network
CN119055216A
Hand joint angle estimation method
WO2024103371A1
Cited By
Luminosity curve anomaly detection method based on long and short term memory network
CN120451744A