Myoelectricity and inertial sensor fused human body upper limb joint torque prediction method
By integrating electromyography and inertial sensors, a joint torque prediction model with cross attention mechanism is constructed, which solves the high cost and complexity problems of relying on load sensors in the prior art, and achieves efficient and accurate prediction of upper limb joint torque .
Patent Information
- Application Number
- CN202311000371.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2025-02-18
AI Technical Summary
The existing methods for predicting torque of upper limbs of human body mainly rely on load sensors, which have problems such as high cost, complex use, and limited range of motion.
Using the method of predicting joint torque of human upper limbs with fusion of electromyography and inertial sensors, preprocessing and training sample sets are performed to build joint torque with cross attention mechanisms Prediction model, real-time joint torque prediction.
The upper limb joint torque prediction without relying on load sensors is realized, which reduces costs, simplifies the use process, and expands the range of motion, so that the prediction results are closer to the real situation.
Smart Images

Figure CN119453998A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of biological signal processing, and in particular to a method for predicting the torque of human upper limb joints by fusing electromyography and inertial sensors. Background Art
[0002] With the development of artificial intelligence, computers, information, control, rehabilitation medicine engineering and other technologies, people have integrated advanced intelligent control technology, computer technology, microelectronics technology, mechanical design and manufacturing technology with biomedical engineering and rehabilitation medicine engineering technology.
[0003] There are many bionic prostheses on the market that can be controlled by electromyographic signals. Electromyographic signals are input into prostheses and other rehabilitation equipment as control input signals. The rehabilitation equipment simulates the movements of normal people through the built-in control program to help the prosthesis wearer achieve the desired movements. In the process, the patient's force prediction is needed to achieve movement drive.
[0004] Traditional force prediction methods mainly rely on load sensors, which have problems such as high cost, complex use, and limited range of motion. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a method for predicting the torque of human upper limb joints by fusing electromyography and inertial sensors, so as to solve the problems that the existing method for predicting the torque of human upper limb joints mainly relies on load sensors, which has the problems of high cost, complex use and limited range of motion.
[0006] On the one hand, an embodiment of the present invention provides a method for predicting the torque of a human upper limb joint by fusion of electromyography and inertial sensors, comprising:
[0007] Obtain the upper limb surface electromyography data, kinematic data and joint torque of the subjects;
[0008] Preprocessing the electromyographic data and kinematic data, and forming a training sample set based on the preprocessed electromyographic data, kinematic data and joint torque;
[0009] Construct a joint torque prediction model with cross-attention mechanism;
[0010] The model is trained using a training sample set to obtain a trained joint torque prediction model; the model uses electromyographic data and kinematic data to perform cross-attention calculations to form a cross-attention matrix;
[0011] Surface electromyography data and kinematics data are acquired in real time, and after preprocessing, they are input into the trained joint torque prediction model to realize the joint torque prediction of the upper limbs.
[0012] Furthermore, the acquisition of the subject's upper limb surface electromyography data, kinematic data and joint torque includes:
[0013] Collect the staticEMG surface electromyographic signal of the subject when the muscle is in the maximum static contraction state;
[0014] When the subjects performed upper limb movements, surface electromyographic signals (moveEMG), kinematic data, and joint torque were collected synchronously.
[0015] Further, the electromyographic data and kinematic data are preprocessed, and a training sample set is formed based on the preprocessed electromyographic data, kinematic data and joint torque, including:
[0016] Filtering and rectifying the surface electromyographic signals staticEMG and moveEMG, and using the maximum value of the filtered and rectified surface electromyographic signals staticEMG to normalize the surface electromyographic signals moveEMG;
[0017] The normalized surface electromyographic signal moveEMG is segmented by sliding window to obtain multiple segments of electromyographic signals nEMG AB ; n represents the nth segment, A is the starting point of the segment, and B is the end point of the segment;
[0018] The kinematic data with the same starting point and end point as each segment of the electromyographic signal are obtained in the kinematic data, and the nEMG AB The corresponding kinematic data of each segment nMove AB , and the kinematic data nMove of each segment AB Encoding is performed to obtain encoding vectors of each segment of kinematic data;
[0019] The electromyographic signal and encoding vector of each segment are used as input data, and the joint torque corresponding to the segment is used as a label to form a sample, thereby forming a training sample set.
[0020] Further, filtering and rectifying the surface electromyographic signals staticEMG and moveEMG, and using the maximum value of the filtered and rectified surface electromyographic signals staticEMG to normalize the surface electromyographic signals moveEMG include:
[0021] Perform bandpass filtering on the surface electromyographic signal staticEMG in the maximum static contraction state and the surface electromyographic signal moveEMG during the upper limb movement process, and filter out the power frequency interference to generate the electromyographic signal after bandpass filtering;
[0022] Full-wave rectifying the electromyographic signals staticEMG and moveEMG after bandpass filtering to generate rectified electromyographic signals staticEMG and moveEMG respectively;
[0023] The rectified electromyographic signal staticEMG is low-pass filtered to extract the envelope and calculate the maximum value mEMG of all sampling points;
[0024] The maximum value of mEMG is used to normalize the electromyographic signal moveEMG after rectification and envelope extraction by low-pass filtering.
[0025] Furthermore, the window size of the sliding window is t1, the step size is t2, and the electromyographic signal nEMG after multiple sliding window segmentation is obtained. AB , where t1 is the first time length, t2 is the second time length, and t1 is greater than t2.
[0026] Furthermore, the kinematic data nMove of each segment AB The encoding vectors of each segment of kinematic data obtained by encoding include:
[0027] Calculate the direction vector M of each segment of kinematic data:
[0028] M=(x B -x A ,y B -y A ,z B -z A );
[0029] Among them, x B ,y B ,z B are the Euler angles of the horizontal, pitch, and roll directions at the end point of each segment; x A ,y A ,z A are the Euler angles in the horizontal, pitch, and roll directions of the starting position of each segment;
[0030] The vector displacement of each segment of kinematic data is:
[0031]
[0032] Based on the direction vector and vector displacement of each segment of kinematic data, the encoding vector of each segment is obtained as follows:
[0033] [x B -x A ,y B -y A ,z B -z A ,||v|| 2 ].
[0034] Furthermore, the joint torque prediction model with the cross-attention mechanism includes a cross-attention module, a layer normalization module, and a fully connected layer connected in sequence;
[0035] The electromyographic signals nEMG of each segment after sliding window segmentation AB Multiply the query parameter matrix and the key vector parameter matrix to generate query vector samples Q and key vector samples K respectively; multiply the encoding vector of each segment of kinematic data by the value vector parameter matrix to generate value vector samples V; use the activation function Softmax to transform QK T After normalization, multiply it by the value vector sample V to output the cross attention matrix;
[0036] The cross attention matrix input layer normalization module completes the redistribution of the cross attention matrix;
[0037] The acquired joint torque and the redistributed cross attention matrix are input into the fully connected layer to output the predicted value of the joint torque of the upper limb.
[0038] Furthermore, the fully connected layer includes an input layer, a hidden layer and an output layer;
[0039] The hidden layer has 5 layers and the number of neurons in the hidden layer is 12;
[0040] The activation function is the sigmoid function.
[0041] Furthermore, the cross attention matrix input layer normalization module completes the redistribution of the cross attention matrix, including:
[0042] Using the layer normalization function LN(x i ), completing the redistribution of the cross-attention weight matrix:
[0043]
[0044] Take the cross attention matrix as sample x i , the mean value of the output of all neurons in each layer is μ L , the variance is α is the weight, β is the bias, and ε is the divisor adjustment constant.
[0045] Furthermore, HuberLoss was selected as the loss function during model training;
[0046] The formula of HuberLoss loss function is:
[0047]
[0048] Where y is the true value, f(x) is the predicted value, and σ is the threshold parameter of Huber Loss.
[0049] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0050] 1. In order to solve the problem of upper limb force prediction, the present invention provides an upper limb joint force prediction method based on surface electromyography and inertial sensors. The acquired electromyographic data and kinematic data are preprocessed and form a training sample set with joint torque; a joint torque prediction model with a cross-attention mechanism is constructed; the electromyographic data and kinematic data are used to perform cross-attention calculations in the model to form a cross-attention matrix; surface electromyographic data and kinematic data are acquired in real time, and the preprocessed data are input into the trained joint torque prediction model to realize the prediction of the joint torque of the upper limb. A force prediction method based on the fusion of surface electromyographic signals and inertial capture is realized. Compared with the prior art, the prediction method of the present invention takes into account the direction of force, so it is closer to the actual situation.
[0051] 2. The synchronously collected joint torque is used as the true value input into the Huber Loss function. The error formed by the predicted value and the true value is back-propagated to update the parameters of the cross-attention mechanism matrix. Through continuous iteration, the force prediction is increasingly accurate.
[0052] 3. The force prediction method of the present invention does not rely on load sensors, has low cost, is easy to use, and does not limit the range of motion.
[0053] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0055] Figure 1 The figure is a flow chart of a method for predicting the torque of human upper limb joints based on the fusion of electromyography and inertial sensors. DETAILED DESCRIPTION
[0056] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0057] A specific embodiment of the present invention, as Figure 1 As shown. A method for predicting the torque of human upper limb joints based on the fusion of electromyography and inertial sensors is disclosed. The method comprises the following steps:
[0058] Step S1, obtaining the upper limb surface electromyography data, kinematic data and joint torque of the subject, which specifically includes steps S11-S12.
[0059] S11, collecting the surface electromyographic signal staticEMG when the subject's muscles are in the state of maximum static contraction;
[0060] Specifically, when collecting electromyographic signals, surface electromyographic electrodes were attached to the biceps, triceps, brachioradialis, deltoid, and pectoralis major of the upper limbs to collect surface electromyographic signals (sEMG) of the five muscles, and the sampling frequency was set to 2000 Hz. The surface electromyographic data (staticEMG) of the subjects were collected when the muscles were in the maximum static contraction state for 3 seconds.
[0061] Since the myoelectric signal of the pectoralis major muscle may be mixed with the ECG signal, preferably, the surface ECG electrodes are attached to the chest, and the ECG signal is measured by an ECG monitoring module. The ECG signal of the pectoralis major muscle is filtered out by the measured ECG signal to obtain a pure myoelectric signal.
[0062] Step S12: The subject performs upper limb movements, and surface electromyographic signals moveEMG, kinematic data, and joint torque are synchronously collected.
[0063] The electromyographic signal was collected in the same way as in the static contraction state. Surface electromyographic electrodes were attached to the biceps, triceps, brachioradialis, deltoid, and pectoralis major of the upper limbs to collect surface electromyographic signals (sEMG) of the five muscles, and the sampling frequency was set to 2000 Hz.
[0064] Preferably, the electrocardiogram signal is collected synchronously during the upper limb movement. Specifically, the surface electrocardiogram electrodes are attached to the chest, and the electrocardiogram signal is measured by the electrocardiogram monitoring module. The electrocardiogram signal obtained by the measurement is used to filter the electromyogram signal at the pectoralis major muscle to obtain a pure electromyogram signal.
[0065] Inertial sensors are used to measure kinematic data. This acquisition system contains three sets of identical inertial sensors, each of which includes an accelerometer, a gyroscope and a magnetic field meter. One set is located on the forearm, one set is located on the upper arm, and one set is located on the shoulder. The kinematic data is obtained by processing the collected acceleration, angular velocity and direction data.
[0066] Specifically, the kinematic data includes Euler angles in horizontal, pitch, and roll directions.
[0067] The isokinetic muscle force system was used to measure the torque of the elbow and shoulder joints.
[0068] Step S2, preprocessing the electromyographic data and kinematics data, and forming a training sample set based on the preprocessed electromyographic data, kinematics data and joint torque, which specifically includes steps S21-S24.
[0069] Step S21, filtering and rectifying the surface electromyographic signals staticEMG and moveEMG, and using the maximum value of the filtered and rectified surface electromyographic signal staticEMG to normalize the surface electromyographic signal moveEMG. Specifically including steps S211-S214.
[0070] Step S211, band-pass filtering is performed on the surface electromyographic signal staticEMG in the maximum static contraction state and the surface electromyographic signal moveEMG during the upper limb movement process, and power frequency interference is filtered out to generate electromyographic signals after band-pass filtering.
[0071] Specifically, the surface electromyographic signal staticEMG in the maximum static contraction state and the surface electromyographic signal moveEMG during the upper limb movement process are subjected to 10-350Hz bandpass filtering, and the power frequency interference is removed by 50Hz notch filtering.
[0072] Step S212, performing full-wave rectification on the electromyographic signals staticEMG and moveEMG after bandpass filtering to generate rectified electromyographic signals staticEMG and moveEMG respectively;
[0073] Step S213: low-pass filter the rectified electromyographic signal staticEMG to extract the envelope and calculate the maximum value mEMG of all sampling points.
[0074] Specifically, mEMG = Max(staticEMGi),
[0075] Wherein staticEMGi represents the signal value of the i-th sampling point after the envelope of the rectified maximum static contraction electromyographic signal staticEMG processed in step S213 is extracted by low-pass filtering.
[0076] Step S214: using the maximum value mEMG, normalize the electromyographic signal moveEMG after rectification and envelope extraction through low-pass filtering.
[0077] Specifically, the maximum value mEMG of staticEMGi obtained in step 213 is used to normalize the surface electromyographic signal moveEMG after the envelope is extracted by low-pass filtering to obtain the normalized surface electromyographic signal moveEMGi':
[0078]
[0079] Among them, moveEMGi represents the signal value of the i-th sampling point of the surface electromyography signal moveEMG after the envelope is extracted by low-pass filtering.
[0080] Normalizing the electromyographic signals during exercise with the maximum value during static contraction allows the electromyographic signals during exercise to be compared and analyzed at the same scale, which is conducive to improving the performance, training speed and convergence effect of the model, reducing the risk of overfitting, improving generalization ability, and facilitating calculation and understanding. In addition, normalization can also help improve the robustness and stability of this prediction algorithm, reduce the interference of errors and noise, and thus improve the reliability and interpretability of the model.
[0081] Step S22: Segment the normalized surface electromyographic signal by sliding window to obtain multiple segments of electromyographic signals nEMG AB ; n represents the nth segment, A is the starting point of the segment, and B is the end point of the segment;
[0082] The window size of the sliding window is t1, the step size is t2, and the electromyographic signal nEMG after multiple sliding window segmentation is obtained. AB , where t1 is the first time length, t2 is the second time length, and t1 is greater than t2.
[0083] Specifically, t1=200ms, t2=100ms.
[0084] Step S23: Obtain kinematic data with the same starting point and end point as each segment of the electromyographic signal from the kinematic data to obtain the kinematic data with the same starting point and end point as each segment of the electromyographic signal nEMG AB The corresponding kinematic data of each segment nMove AB , and the kinematic data nMove of each segment AB Encoding is performed to obtain encoding vectors of each segment of kinematic data, which specifically includes steps S231-S233.
[0085] Step S231, calculate the direction vector M of each segment of kinematic data:
[0086] M=(x B -x A ,y B -y A ,z B -z A );
[0087] Among them, x B ,y B ,z B are the Euler angles of the horizontal, pitch, and roll directions at the end point of each segment; x A ,y A ,z Aare the Euler angles in the horizontal, pitch, and roll directions of the starting position of each segment;
[0088] Step S232: The vector displacement of each segment of kinematic data is:
[0089]
[0090] Step S233: Based on the direction vector and vector displacement of each segment of kinematic data, the encoding vector of each segment is obtained as follows:
[0091] [x B -x A ,y B -y A ,z B -z A ,||v|| 2 ].
[0092] Step S24: The electromyographic signal and encoding vector of each segment are used as input data, and the joint torque corresponding to the segment is used as a label to form a sample, thereby forming a training sample set.
[0093] Step S3, constructing a joint torque prediction model with a cross-attention mechanism. The joint torque prediction model with a cross-attention mechanism includes a cross-attention module, a layer normalization module, and a fully connected layer connected in sequence;
[0094] The fully connected layer includes an input layer, a hidden layer and an output layer;
[0095] The hidden layer has 5 layers and the number of neurons in the hidden layer is 12;
[0096] The activation function is the sigmoid function.
[0097] Specifically, the electromyographic signals nEMG of each segment after the sliding window segmentation AB Multiply the query parameter matrix and the key vector parameter matrix to generate query vector samples Q and key vector samples K respectively; multiply the encoding vector of each segment of kinematic data by the value vector parameter matrix to generate value vector samples V; use the activation function Softmax to transform QK T After normalization, multiply it by the value vector sample V to output the cross attention matrix;
[0098] Specifically, the Softmax function can be used to convert the output values of multiple categories into a probability distribution ranging from [0, 1] and 1.
[0099] Do a dot product of the matrix output by the Softmax function and V to get Cross_Attention(Q,K,V), which is the weighted sum of the value vector information, where the weight is the distribution of the correlation or similarity between each input sample and each piece of information.
[0100] In the cross attention module, the EMG signals of each segment after sliding window segmentation are AB Multiply the query parameter matrix and the key vector parameter matrix to generate query vector samples Q and key vector samples K respectively. The encoding vector of each segment of kinematic data is multiplied by the value vector parameter matrix to generate value vector samples V. Since the encoding vector of kinematic data contains x B -x A ,y B -y A ,z B -z A It can reflect the directionality of force. Therefore, the cross-attention module of the present invention takes the direction factor of force into consideration when calculating the joint torque prediction weight, so that the predicted value is closer to the actual situation.
[0101] The cross-attention matrix input layer normalization module completes the redistribution of the cross-attention matrix.
[0102] Using the layer normalization function LN(x i ), completing the redistribution of the cross-attention weight matrix:
[0103]
[0104] Take the cross attention matrix as sample x i , the mean value of the output of all neurons in each layer is μ L , the variance is α is the weight, β is the bias, and ε is the divisor adjustment constant.
[0105] For each input sample x i , calculate the mean μ of the output results of all neurons in each layer L and variance Use the mean and variance to normalize the output of the input sample, and then use a linear transformation to scale and offset the normalized result, where α is the weight, β is the bias, and ε is a very small number to prevent division by 0. Adjust the data distribution to be close to the normal distribution, making the data distribution more uniform and accelerating the training.
[0106] Specifically, the result of Cross_Attention(Q,K,V) is used as x i .
[0107] The acquired joint torque and the redistributed cross attention matrix are input into the fully connected layer to output the predicted value of the joint torque of the upper limb.
[0108] Specifically, the collected electromyographic signals of people with healthy upper limbs and the joint torque corresponding to the motion coding vector are input into the fully connected layer; the redistributed cross-attention mechanism matrix is input into the fully connected layer, and the predicted value of the torque emitted by the upper limb is output.
[0109] Step S4: train the model using a training sample set to obtain a trained joint torque prediction model; in the model, cross-attention calculation is performed using electromyographic data and kinematic data to form a cross-attention matrix.
[0110] Specifically, the cross attention model is:
[0111] Q=W Q I q ,
[0112] K=W k I k ,
[0113] V=W V I v ,
[0114] W Q ,W K ,W V is the parameter matrix to be trained, and each element of it is initialized to a randomly distributed value of 0-1. Then, the nEMG generated by preprocessing the upper limb surface electromyography data and kinematic data of the healthy subjects obtained in step S1 is AB , encoding vector as input, joint torque as label, for W Q , W k , W V Training is performed to obtain the weight parameter matrix of different electromyographic signals corresponding to stress, and training is performed for 200 epochs.
[0115] HuberLoss is selected as the loss function during model training.
[0116] When the gradient is descending, the mean square error (MSE) is more accurate than the mean absolute error (MAE), and when outliers appear, MAE is more robust than MSE. HuberLoss combines the advantages of both and avoids the disadvantages as much as possible.
[0117] The formula of HuberLoss loss function is:
[0118]
[0119] Where y is the true value, f(x) is the predicted value, and σ is the threshold parameter of HuberLoss.
[0120] The measured joint torque is taken as the true value and the error is obtained by subtracting it from the predicted value. The error back propagation algorithm calculates the gradient through the error function, and then adjusts the weight and bias to obtain the optimal solution in the adjustment group after repeated iterative training. The final prediction of human joint torque is achieved.
[0121] Step S5, acquiring surface electromyography data and kinematics data in real time, inputting the trained joint torque prediction model after preprocessing, and realizing the joint torque prediction of the upper limbs.
[0122] Specifically, the surface electromyography data and kinematic data collected in this step are the electromyography data and kinematic data collected from the prosthesis wearer. The above data are preprocessed according to the method of step S2 and then input into the joint torque prediction model to obtain the joint torque that the prosthesis should apply, so as to control the prosthesis to perform corresponding movements according to the torque value.
[0123] Compared with the prior art, the present embodiment provides an upper limb joint force prediction method based on surface electromyography and inertial sensors. The subject is in the state of maximum static contraction of the muscle for 3 seconds, and the surface electromyography signal staticEMG and electrocardiogram signal at this time are collected; the subject performs upper limb movements, and the surface electromyography signal moveEMG, electrocardiogram signal, kinematic signal of the inertial sensor and joint torque are synchronously collected. The result of normalizing the moveEMG collected during the upper limb movement using staticEMG is used to encode the vector and direction vector generated by the sliding window for cross-attention calculation, forming a cross-attention mechanism matrix, and inputting the fully connected layer to realize the prediction of the torque actively emitted by the human body. Compared with the prior art, the prediction method of the present invention takes into account the direction factor of the force, so it is closer to the actual situation. The synchronously collected joint torque is input as the true value into the HuberLoss function, and the error formed by the predicted value and the true value is back-propagated to update the parameters of the cross-attention mechanism matrix, and the prediction of force is increasingly accurate through continuous iteration. The force prediction method of the present invention does not rely on load sensors, has low cost, is simple to use, and does not limit the range of motion.
[0124] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0125] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for predicting human upper limb joint torque based on electromyography and inertial sensor fusion, characterized in that: include: Obtain the upper limb surface electromyography data, kinematic data and joint torque of the subjects; Preprocessing the electromyographic data and kinematic data, and forming a training sample set based on the preprocessed electromyographic data, kinematic data and joint torque; Construct a joint torque prediction model with cross-attention mechanism; The model is trained using a training sample set to obtain a trained joint torque prediction model; the model uses electromyographic data and kinematic data to perform cross-attention calculations to form a cross-attention matrix; Surface electromyography data and kinematics data are acquired in real time, and after preprocessing, they are input into the trained joint torque prediction model to realize the joint torque prediction of the upper limbs.
2. The method for predicting human upper limb joint torque according to claim 1, characterized in that: The obtaining of the subject's upper limb surface electromyography data, kinematic data and joint torque includes: Collect the staticEMG surface electromyographic signal of the subject when the muscle is in the maximum static contraction state; When the subjects performed upper limb movements, surface electromyographic signals (moveEMG), kinematic data, and joint torque were collected synchronously.
3. The method for predicting human upper limb joint torque according to claim 2, characterized in that: Preprocessing the electromyographic data and kinematic data, and forming a training sample set based on the preprocessed electromyographic data, kinematic data and joint torque, including: Filtering and rectifying the surface electromyographic signals staticEMG and moveEMG, and using the maximum value of the filtered and rectified surface electromyographic signals staticEMG to normalize the surface electromyographic signals moveEMG; The normalized surface electromyographic signal moveEMG is segmented by sliding window to obtain multiple segments of electromyographic signals nEMG AB ; n represents the nth segment, A is the starting point of the segment, and B is the end point of the segment; The kinematic data with the same starting point and end point as each segment of the electromyographic signal are obtained in the kinematic data, and the nEMG AB The corresponding kinematic data of each segment nMove AB , and the kinematic data nMove of each segment AB Encoding is performed to obtain encoding vectors of each segment of kinematic data; The electromyographic signal and encoding vector of each segment are used as input data, and the joint torque corresponding to the segment is used as a label to form a sample, thereby forming a training sample set.
4. The method for predicting human upper limb joint torque according to claim 3, characterized in that: The filtering and rectifying of the surface electromyographic signals staticEMG and moveEMG, and using the maximum value of the filtered and rectified surface electromyographic signal staticEMG to perform normalization processing on the surface electromyographic signal moveEMG comprises: Perform bandpass filtering on the surface electromyographic signal staticEMG in the maximum static contraction state and the surface electromyographic signal moveEMG during the upper limb movement process, and filter out the power frequency interference to generate the electromyographic signal after bandpass filtering; Full-wave rectifying the electromyographic signals staticEMG and moveEMG after bandpass filtering to generate rectified electromyographic signals staticEMG and moveEMG respectively; The rectified electromyographic signal staticEMG is low-pass filtered to extract the envelope and calculate the maximum value mEMG of all sampling points; The maximum value of mEMG is used to normalize the electromyographic signal moveEMG after rectification and envelope extraction by low-pass filtering.
5. The method for predicting human upper limb joint torque according to claim 3, characterized in that: The window size of the sliding window is t1, the step size is t2, and the electromyographic signal nEMG after multiple sliding window segmentation is obtained. AB , where t1 is the first time length, t2 is the second time length, and t1 is greater than t2.
6. The method for predicting human upper limb joint torque according to claim 3, characterized in that: The kinematic data nMove of each segment AB The encoding vectors of each segment of kinematic data obtained by encoding include: Calculate the direction vector M of each segment of kinematic data: M=(x B -x A ,y B -y A ,z B -z A ); Among them, x B ,y B ,z B are the Euler angles of the horizontal, pitch, and roll directions at the end point of each segment; x A ,y A ,z A are the Euler angles in the horizontal, pitch, and roll directions of the starting position of each segment; The vector displacement of each segment of kinematic data is: Based on the direction vector and vector displacement of each segment of kinematic data, the encoding vector of each segment is obtained as follows: [x B -x A ,y B -y A ,z B -z A ,||v||2]。 7. The method for predicting the torque of human upper limb joints according to claims 5 and 6, characterized in that: The joint torque prediction model with a cross-attention mechanism includes a cross-attention module, a layer normalization module, and a fully connected layer connected in sequence; The electromyographic signals nEMG of each segment after sliding window segmentation AB Multiply the query parameter matrix and the key vector parameter matrix to generate query vector samples Q and key vector samples K respectively; multiply the encoding vector of each segment of kinematic data by the value vector parameter matrix to generate value vector samples V; use the activation function Softmax to transform QK T After normalization, multiply it by the value vector sample V to output the cross attention matrix; The cross attention matrix input layer normalization module completes the redistribution of the cross attention matrix; The acquired joint torque and the redistributed cross attention matrix are input into the fully connected layer to output the predicted value of the joint torque of the upper limb.
8. The method for predicting human upper limb joint torque according to claim 7, characterized in that: The fully connected layer includes an input layer, a hidden layer and an output layer; The hidden layer has 5 layers and the number of neurons in the hidden layer is 12; The activation function is the sigmoid function.
9. The method for predicting human upper limb joint torque according to claim 7, characterized in that: The cross attention matrix input layer normalization module completes the redistribution of the cross attention matrix, including: Using the layer normalization function LN(x i ), completing the redistribution of the cross-attention weight matrix: Take the cross attention matrix as sample x i , the mean value of the output of all neurons in each layer is μ L , the variance is α is the weight, β is the bias, and ε is the divisor adjustment constant.
10. The method for predicting human upper limb joint torque according to claim 7, characterized in that: Huber Loss is selected as the loss function during model training; The Huber Loss loss function is: Where y is the true value, f(x) is the predicted value, and σ is the threshold parameter of Huber Loss.