Lower limb multi-joint angle prediction method, system, equipment and medium
Through the twin-tower Transformer architecture and embedding processing of multi-modal data, spatio-temporal features are constructed, which solves the problem of neglecting the synergistic correlation of muscles and joints in lower limb joint angle prediction, and improves prediction performance and accuracy.
Patent Information
- Application Number
- CN202410688697.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Existing lower limb joint angle prediction technology ignores the synergistic correlation between muscles and joints, which affects the prediction performance of the model.
It adopts the twin-tower Transformer architecture, combines multi-modal data, and builds spatio-temporal features through embedding processing and preset structure model training to improve prediction performance.
The accuracy of multi-joint angle prediction of the lower limbs and the adaptability of the model are improved, and higher prediction accuracy is shown through evaluation indicators such as root mean square error, mean absolute error, coefficient of determination and explainable variance.
Smart Images

Figure CN118643270A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gait planning, and in particular to a method, system, device and medium for predicting multiple joint angles of lower limbs. Background Art
[0002] Joint angle prediction technology is one of the key technologies to realize gait planning and active assistance of lower limb exoskeleton robots. It aims to recognize and predict human movement intentions before human movements, realize the synchronous movement of the lower limb exoskeleton robot and the wearer, and then complete gait planning.
[0003] At present, in the existing research on joint angle prediction, machine learning technology is usually applied to the joint angle prediction task. The common practice is to establish a mapping relationship from data sources such as sEMG signals and historical joint angles to future joint angles, so as to achieve continuous joint angle prediction. However, common machine learning technology is based on artificial feature engineering, highly dependent on the domain knowledge of experts and lacks generalization. With the improvement of computing power, the development of deep learning technology has injected new vitality into joint angle prediction. Neural networks can adaptively extract features and complete prediction tasks, effectively improving the prediction accuracy and adaptability of the model. However, the basic theory of free lower limb bone theory in anatomy reveals that the movement of the human lower limb is completed by the coordinated cooperation of multi-tissue muscles and joints. Existing research lacks modeling of the spatial relationship between muscles and joints, which affects the performance of the prediction model.
[0004] Based on the above analysis, the current lower limb joint angle prediction technology based on multimodal data ignores the problem of coordinated relationship between muscles and joints. How to provide a lower limb multi-joint angle prediction method and improve the prediction performance of the model is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a method, system, device and medium for predicting multiple joint angles of lower limbs that overcome the above problems or at least partially solve the above problems.
[0006] To achieve the above-mentioned object and other related objects, the present invention provides a method for predicting multiple joint angles of lower limbs, the method comprising:
[0007] Collecting multimodal data of the user and preprocessing the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence;
[0008] Dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set;
[0009] Using the embedded training set, the preset structure double-tower model is trained to obtain a lower limb multi-joint angle prediction model;
[0010] The test set is used to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain an evaluation result.
[0011] In one embodiment of the present invention, the collecting of multimodal data of the user includes:
[0012] Multiple surface electromyography sensors are used to collect N-channel surface electromyography signal data of multiple muscles when a user performs M continuous lower limb movements, and four inertial measurement units are used to collect the user's lower limb angle sequence; wherein the multimodal data includes N-channel surface electromyography signal data and 4-channel lower limb angle sequence, M≥1, N≥1.
[0013] In one embodiment of the present invention, preprocessing the multimodal data to obtain a data set includes:
[0014] The N-channel surface electromyography signal data is sequentially subjected to Butterworth high-pass and low-pass filtering, Butterworth band-stop filtering, discrete wavelet threshold processing and normalization processing to obtain an N-channel surface electromyography signal sequence;
[0015] Preprocessing and solving the 4-channel lower limb angle sequence to obtain a 4-channel joint angle sequence;
[0016] Aligning the clocks of the N-channel electromyographic signal sequence and the 4-channel joint angle sequence, and superimposing them in the channel dimension to obtain an N+4 channel data set;
[0017] The N+4 channel data set is segmented into samples using a preset sliding window to generate a data set.
[0018] In one embodiment of the present invention, the embedding process is performed on the training set to obtain the embedded training set, including:
[0019] Keeping the time dimension priority of the training set unchanged, obtaining a time dimension priority data set;
[0020] Performing matrix transposition on the training set to obtain a spatial dimension priority data set;
[0021] The time dimension priority dataset and the space dimension priority dataset are respectively embedded, and the embedded time dimension priority dataset is position-encoded to obtain a time embedded dataset and a space embedded dataset.
[0022] In one embodiment of the present invention, the embedded training set is used to train the preset double-tower model to obtain a lower limb multi-joint angle prediction model, including:
[0023] The time embedding dataset is processed and trained sequentially through a multi-head attention layer with a mask, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and a feature vector of the time dimension is output;
[0024] The spatial embedding dataset is processed and trained sequentially through a multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and a feature vector of a channel dimension is output;
[0025] Aggregating the feature vector of the time dimension and the feature vector of the channel dimension based on the aggregation layer to obtain a merged feature vector;
[0026] The merged feature vector is processed based on the fully connected layer to obtain a prediction result, and the training is stopped when a preset number of iterations is reached, and a lower limb multi-joint angle prediction model is output.
[0027] In one embodiment of the present invention, the time embedding data set is processed and trained sequentially through a multi-head attention layer with a mask, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and outputs a feature vector of the time dimension, including:
[0028] Processing the temporal embedding dataset through a masked multi-head attention layer to obtain a vector with long-range sequence dependencies;
[0029] The vector with long-distance sequence dependency is convolved through a CNN layer to capture the local features of the sequence;
[0030] Performing residual connection and standardization on the time embedding dataset and the local features, and outputting feature vectors of the residual and standardization layers;
[0031] Processing the residual and the feature vector of the normalization layer via a feed-forward connection layer to obtain a feature vector of the feed-forward connection layer;
[0032] The feature vector of the residual and normalization layer is residually connected and normalized with the feature vector of the feedforward connection layer, and a feature vector of the time dimension is output.
[0033] In one embodiment of the present invention, the use of the test set to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain the evaluation results includes:
[0034] Inputting the test set into the lower limb multi-joint angle prediction model and outputting a test value;
[0035] The true value corresponding to the test value is obtained, and the root mean square error, mean absolute error, determination coefficient and explained variance are calculated using the test value and the true value.
[0036] To achieve the above-mentioned and other related purposes, the present invention provides a lower limb multi-joint angle prediction system, comprising:
[0037] A collection module, used to collect multimodal data of users and pre-process the multimodal data to obtain a data set;
[0038] An embedding module, used for dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set;
[0039] A training module, used to train a preset structure double-tower model using the embedded training set to obtain a lower limb multi-joint angle prediction model;
[0040] An evaluation module is used to evaluate the prediction results of the lower limb multi-joint angle prediction model using the test set to obtain an evaluation result.
[0041] To achieve the above-mentioned object and other related objects, the present invention provides an electronic device, the electronic device comprising: a memory and a processor;
[0042] The memory is used to store computer programs;
[0043] The processor is used to execute the computer program stored in the memory so that the electronic device performs the lower limb multi-joint angle prediction method.
[0044] To achieve the above-mentioned purpose and other related purposes, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an electronic device, implements the lower limb multi-joint angle prediction method as described above.
[0045] As described above, the lower limb multi-joint angle prediction method, system, device and medium of the present invention, the method includes: collecting multimodal data of the user, and preprocessing the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence; dividing the data set into a training set and a test set, and embedding the training set to obtain an embedded training set; using the embedded training set to train a preset structure twin-tower model to obtain a lower limb multi-joint angle prediction model; using the test set to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain an evaluation result. In response to the problem that the current lower limb joint angle prediction technology based on multimodal data ignores the coordination of muscles and joints, the present invention provides a lower limb multi-joint angle prediction method based on twin-tower Transformer and multimodal data, using the twin-tower Transformer architecture to model spatiotemporal features to improve the prediction performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Shown is a schematic flow chart of a method for predicting multiple joint angles of lower limbs in one embodiment of the present invention;
[0047] Figure 2 Shown is a flow chart of the attachment positions of the surface electromyography sensor and the IMU in one embodiment of the present invention;
[0048] Figure 3 Shown is a schematic diagram of a dual-tower Transformer architecture in one embodiment of the present invention;
[0049] Figure 4 Shown is a schematic diagram of the prediction of multiple joint angles of lower limbs in one embodiment of the present invention;
[0050] Figure 5 Shown is a schematic diagram of joint angle sequence solution (right lower limb) in one embodiment of the present invention;
[0051] Figure 6 A schematic diagram showing the evaluation results of a test set in one embodiment of the present invention;
[0052] Figure 7 Shown is a schematic diagram of a comparison between a predicted curve and a true curve in one embodiment of the present invention;
[0053] Figure 8 Shown is a schematic diagram of the functional modules of a lower limb multi-joint angle prediction system according to an embodiment of the present invention;
[0054] Fig. 9 Shown is a schematic block diagram of an electronic device in one embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0056] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0057] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0058] The terms "first", "second", etc. in the specification and claims of the disclosed embodiments and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the disclosed embodiments described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0059] Unless otherwise stated, the term "plurality" means two or more.
[0060] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0061] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0062] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:
[0063] <1> , Butterworth high-pass filter transfer function Where s is the complex frequency domain variable (the variable in the Laplace transform); wc is the cutoff frequency, which can be defined as T is the time constant of the filter; n is the order of the filter, which determines the slope of the filter at the cutoff frequency.
[0064] <2> , Butterworth low-pass filter transfer function Where s is a complex frequency domain variable; wc is the cutoff frequency, and n is the order of the filter.
[0065] <3> , Butterworth bandstop filter transfer function Where s is a complex frequency domain variable; wc is the cutoff frequency, and n is the order of the filter.
[0066] <4> , Discrete wavelet threshold denoising is divided into two parts: discrete wavelet transform and threshold denoising. Discrete wavelet transform can be expressed as:
[0067] c j,k =∑ n x[n]·ψ j,k [n]
[0068] d j,k =∑ n x[n]·φ j,k [n]
[0069] Among them, c j,k represents the approximation coefficient of the jth layer; d j,k represents the kth detail coefficient of the jth layer; x[n] represents the discrete sample of the original signal; ψ j,k [n] represents the wavelet function used to extract the high-frequency part of the signal; φ j,k [n] represents the scale function used to extract the low-frequency part of the signal; j represents the number of decomposition layers; k represents the index of the wavelet function; the signal is transformed by discrete wavelet transform to obtain a series of wavelet functions, and then the wavelet functions are thresholded: it can be used by formula:
[0070]
[0071] Among them, coeff represents the original wavelet coefficient, θ represents the set threshold, and Thr(coeff) is the wavelet coefficient after threshold processing; finally, the processed wavelet coefficient is inversely transformed to reconstruct the denoised signal.
[0072] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0073] See also Figure 1 An embodiment of the present invention provides a method for predicting multiple joint angles of lower limbs, and the method may include the following steps:
[0074] Step S10, collecting multimodal data of the user, and preprocessing the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence.
[0075] Among them, the multimodal data may include N-channel surface electromyographic signal data of eight muscles of the user's lower limbs, including the extensor digitorum longus (EDL), medial gastrocnemius (MG), tibialis anterior (AT), peroneus longus (PL), vastus medialis (VM), vastus lateralis (VL), rectus femoris (RF) and biceps femoris (BF), as well as 4-channel lower limb angle sequences of the user's lower limbs, including the sagittal plane of the thigh and calf, the coronal plane of the thigh, and the instep.
[0076] The eight muscles, including the extensor digitorum longus (EDL), medial gastrocnemius (MG), tibialis anterior (AT), peroneus longus (PL), vastus medialis (VM), vastus lateralis (VL), rectus femoris (RF) and biceps femoris (BF), are a series of important muscles in the human lower limbs; these eight muscles play a key role in various lower limb activities such as walking, running, jumping and balance, and the functions of these eight muscles are very important for sports training, rehabilitation therapy and understanding of lower limb movement disorders.
[0077] The data set can be obtained by aligning the clocks of the preprocessed N-channel surface electromyography signal data and the 4-channel lower limb angle sequence data, superimposing them in the channel dimension, and segmenting them through a preset sliding window.
[0078] In a specific implementation, the user's multimodal data can be first collected and acquired, wherein the multimodal data includes N-channel surface electromyographic signal data and 4-channel lower limb angle sequences; then, the N-channel surface electromyographic signal data can be preprocessed by denoising, filtering, and normalization to obtain an N-channel electromyographic signal sequence; and the 4-channel lower limb angle sequence can be preprocessed and solved to obtain a 4-channel joint angle sequence; finally, the two data types, the N-channel electromyographic signal sequence and the 4-channel joint angle sequence, are clock-aligned and superimposed in the channel dimension, and segmented through a preset sliding window to obtain a data set.
[0079] Furthermore, in one embodiment, step S10 may include the following sub-steps:
[0080] Sub-step S101, using multiple surface electromyography sensors to collect N-channel surface electromyography signal data of multiple muscles when the user performs M continuous movements of the lower limbs, and using 4 inertial measurement units to collect the user's lower limb angle sequence; wherein the multimodal data includes N-channel surface electromyography signal data and 4-channel lower limb angle sequence, M≥1, N≥1.
[0081] In a specific implementation, surface electromyography sensors can be attached to the skin surface of eight muscles of the user's lower limbs, including the extensor digitorum longus, medial gastrocnemius, tibialis anterior, peroneus longus, vastus medialis, vastus lateralis, rectus femoris and biceps femoris, and the surface electromyography sensors can be used to collect N-channel surface electromyography signal data of multiple muscles when the user performs M lower limb continuous movements; and inertial measurement units (IMUs) can be placed at four positions of the user's lower limbs, namely the sagittal plane of the thigh and calf, the coronal plane of the thigh, and the instep, and four IMUs can be used to collect the user's lower limb angle sequence; wherein the multimodal data includes N-channel surface electromyography signal data and 4-channel lower limb angle sequence, M≥1, N≥1.
[0082] As an example, surface electromyography sensors can be attached to the skin surface of eight muscles of the user's lower limbs, including the extensor digitorum longus (EDL), medial gastrocnemius (MG), tibialis anterior (AT), peroneus longus (PL), vastus medialis (VM), vastus lateralis (VL), rectus femoris (RF) and biceps femoris (BF), to collect 8-channel surface electromyography signal data during continuous movement; and IMUs can be placed at four locations of the user's lower limbs, namely the sagittal plane of the thigh and calf, the coronal plane of the thigh, and the instep, to collect 4-channel lower limb angle sequences. The gait during data collection includes three lower limb movements: walking, jogging, and uphill.
[0083] See also Figure 2 , Figure 2 It is a schematic diagram of the attachment positions of the surface electromyography sensor and the IMU; the sampling frequency can be set to 1000 Hz during data collection, and each action is repeated 3 times by 3 subjects (i.e., users), each time lasting 60 seconds, with an interval of 5 minutes to avoid muscle fatigue.
[0084] Step S20, dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set.
[0085] The embedded training set can be obtained by embedding the training set through the embedding processing layer.
[0086] In a specific implementation, after obtaining a data set, the data set can be divided into a training set and a test set; then, the training set can be input into a preset structural dual-tower model, and the training set can be embedded using the embedding processing layer of the preset structural dual-tower model to obtain an embedded training set.
[0087] As an example, the dataset can be divided into a training set and a test set in a ratio of 7:3.
[0088] Further, in one embodiment, step S20 may include the following sub-steps:
[0089] Sub-step S201, keeping the time dimension priority of the training set unchanged, to obtain a time dimension priority data set;
[0090] Sub-step S202, performing matrix transposition on the training set to obtain a space dimension priority data set;
[0091] Sub-step S203, embedding the time dimension priority dataset and the space dimension priority dataset respectively, and position encoding the embedded time dimension priority dataset to obtain a time embedded dataset and a space embedded dataset.
[0092] Among them, the time dimension priority data set can be obtained by prioritizing the time dimension and keeping the original training set unchanged.
[0093] The spatial dimension priority data set can be obtained by transposing the original training set samples as a matrix with the spatial dimension priority, so that the channel is the horizontal axis of the sample and the time is the vertical axis of the sample.
[0094] The time-embedded dataset can be obtained by embedding and position encoding the time-priority dataset.
[0095] As an example, a fully connected layer is used as the embedding processing layer to embed the time dimension priority dataset; because the time dimension in the prediction task needs to maintain strict time sequence, it is also necessary to add trigonometric function position encoding to the time dimension dataset, so as to obtain a time embedded dataset.
[0096] Among them, the position encoding can be adopted by the formula:
[0097]
[0098] Among them, PE represents the position vector of a data point after encoding; pos represents the position of the data point in the sequence; d model Indicates the length of the sequence to be encoded.
[0099] As an example, set d model is 500. In this embodiment, the position encoding of the first data point of a sample can be expressed as follows:
[0100]
[0101] The spatial embedding dataset can be obtained by embedding the spatial dimension priority dataset.
[0102] In the specific implementation, for the priority of time dimension, the original training set remains unchanged, and the time dimension priority data set can be obtained; in order to reduce the time complexity and combine the characteristics of electromyographic signals, a fully connected layer is used as the embedding processing layer; because the time dimension needs to maintain strict time order in the prediction task, it is also necessary to add trigonometric function position encoding to the time dimension data, so that the time embedding data set can be obtained. For the priority of spatial dimension, the original training set samples are transposed as a matrix, so that the channel is the horizontal axis of the sample and the time is the vertical axis of the sample; because the channel does not care about the order between channels, there is no need for position encoding, and then embedding processing is performed through a fully connected layer, so that the spatial embedding data set can be obtained. Thus, by embedding the training set to obtain the time embedding data set and the spatial embedding data set, the preparation of the training data of the preset structure double tower model is completed.
[0103] Step S30, using the embedded training set to train the preset structure double-tower model to obtain a lower limb multi-joint angle prediction model.
[0104] Among them, the preset structural dual-tower model can be a pre-set dual-tower Transformer model, which may include: a tower for modeling the time dimension based on the Transformer encoder architecture and a tower for modeling the space dimension based on the Transformer decoder architecture.
[0105] See also Figure 3 , Figure 3 The figure is a schematic diagram of the preset double-tower model architecture; the tower for modeling the time dimension is based on the Transformer encoder architecture, which can pass the time dimension priority dataset that has been embedded and positionally encoded through a masked multi-head self-attention layer, calculate the multi-head attention vector representation and splice it into an output vector to capture the long-distance dependency of the input sequence; the attention layer is followed by a CNN layer to make up for the problem that the Transformer model is good at capturing global features but ignores local features; the CNN layer is followed by a residual and normalization layer, a feedforward connection layer, and a residual and normalization layer; Figure 4 The time dimension tower in the dual-tower Transformer architecture is the basic structure in Transformer.
[0106] The tower for modeling spatial dimensions is based on the Transformer decoder architecture, which can pass through a multi-head self-attention layer for the spatial dimension-first dataset after embedding, followed by a CNN layer, a residual and normalization layer, a feed-forward connection layer, and a residual and normalization layer.
[0107] The difference between the spatial dimension tower and the temporal dimension tower is that the multi-head attention layer of the spatial dimension tower does not have a mask.
[0108] Finally, the feature vectors output by the two towers (time dimension tower and space dimension tower) are aggregated through 1D-CNN to obtain a merged feature vector; then the merged feature vector is processed based on the fully connected layer, and the 4-channel joint angle prediction results are output. The training is stopped until the preset number of iterations is reached, and the lower limb multi-joint angle prediction model is output.
[0109] Among them, the training parameters of the preset structure double tower model can be set as follows:
[0110] The ratio of training set to test set is 7:3, the number of training iterations epoch is set to 400, the learning rate lr is set to 0.0002, the batch size is 5, the hidden layer dimension is 2048, the number of attention mechanism heads is 6, the optimizer is Adam, the loss function is cross entropy MSELoss, 10-fold cross validation is used for training, and GPU acceleration is used for training.
[0111] In a specific implementation, a preset structure twin-tower model can be constructed first, and then the preset structure twin-tower model can be iteratively trained using the embedded training set until the training is stopped when the preset number of iterations is reached, and the lower limb multi-joint angle prediction model is output. The process of training the preset structure twin-tower model can include steps S30-S40: the training set can be embedded using the embedding processing layer of the preset structure twin-tower model; and then the preset structure twin-tower model can be iteratively trained using the embedded training set to obtain the lower limb multi-joint angle prediction model.
[0112] In addition, the loss can be calculated in the training preset structure dual-tower model until the loss function reaches convergence and the training is stopped to output the lower limb multi-joint angle prediction model.
[0113] Step S40, using the test set to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain an evaluation result.
[0114] The evaluation results can be evaluation indicators for evaluating the joint angle prediction performance of the lower limb joint multi-angle prediction model using the test set, which may include but are not limited to: root mean square error (RESE), mean absolute error (MAE), determination coefficient (R 2 ) and explained variance (EVS). It should be noted that when selecting evaluation indicators, the specific application scenarios and data characteristics of the multi-angle prediction model of lower limb joints also need to be considered.
[0115] The root mean square error (RESE) and mean absolute error (MAE) can provide the size of the prediction error of the lower limb multi-joint angle prediction model.
[0116] Coefficient of determination (R 2) and explained variance (EVS), which can provide information on the goodness of fit of the lower limb multi-joint angle prediction model.
[0117] In a specific implementation, after obtaining the lower limb multi-joint angle prediction model, the prediction results of the lower limb multi-joint angle prediction model can be evaluated using a test set to obtain an evaluation result; and then the prediction performance of the lower limb multi-joint angle prediction model can be verified based on the evaluation result.
[0118] As an example, see Figure 3 , Figure 3 A schematic diagram of the dual-tower Transformer architecture; Figure 3 The process steps of lower limb multi-joint angle prediction can be seen in the figure: first, the user's multimodal data is collected, and the multimodal data is preprocessed to obtain a data set; then, the data set is divided into a training set and a test set; the training set is then input into the preset structure dual-tower model, and the embedding processing layer of the preset structure dual-tower model is used to embed the training set (including dual-tower data, time dimension data and space dimension data) to obtain an embedded training set; then, the preset structure dual-tower model (dual-tower Transformer model) is trained using the embedded training set to obtain a lower limb multi-joint angle prediction model; finally, the test set is used to evaluate the results of the lower limb multi-joint angle prediction model to evaluate the prediction performance of the lower limb multi-joint angle prediction model.
[0119] In this embodiment, a data set is obtained by collecting multimodal data of the user and preprocessing the multimodal data; the data set is divided into a training set and a test set, and the training set is embedded to obtain an embedded training set; the preset structure twin-tower model is trained using the embedded training set to obtain a lower limb multi-joint angle prediction model; the test set is used to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain an evaluation result. In response to the problem that the current lower limb joint angle prediction technology based on multimodal data ignores the coordination of muscles and joints, the present invention provides a lower limb multi-joint angle prediction method based on twin-tower Transformer and multimodal data, using the twin-tower Transformer architecture to model spatiotemporal features to improve the prediction performance of the model.
[0120] Based on the above embodiments, a second embodiment of the method for predicting multiple joint angles of lower limbs of the present invention is proposed. In this embodiment, step S10 may further include the following sub-steps:
[0121] Sub-step A10, subjecting the N-channel surface electromyography signal data to Butterworth high-pass and low-pass filtering, Butterworth band-stop filtering, discrete wavelet threshold processing and normalization processing in sequence to obtain an N-channel surface electromyography signal sequence.
[0122] Among them, Butterworth high-pass and low-pass filtering can be used to remove high-frequency noise and low-frequency trends in the data, while retaining the signal of the intermediate frequency (ie, the effective frequency). In this embodiment, a 4th-order Butterworth high-pass and low-pass filtering of 20 to 450 Hz is preferred.
[0123] The Butterworth band-stop filter can effectively remove interference in a specific frequency band in the data, including power frequency interference. In this embodiment, a 50 Hz Butterworth band-stop filter is preferred.
[0124] Power frequency interference usually refers to the interference caused by the power grid frequency; in China, the frequency of power frequency interference is usually 50Hz or 100Hz.
[0125] The discrete wavelet threshold can be used to remove noise from the data while retaining detailed information of the signal. In this embodiment, the wavelet function is preferably sym7, and the threshold is preferably 0.05.
[0126] Normalization is used to adjust the numerical range of data to a specific interval, usually [0, 1]. It can speed up the convergence of the learning algorithm, prevent the gradient from vanishing or exploding during the training process, and help improve the generalization ability of the model. It can be done using the formula:
[0127]
[0128] Among them, X represents the original data, X max and X min Represents the minimum and maximum values in the data set, respectively.
[0129] In a specific implementation, the N-channel surface electromyography signal data may be sequentially processed through Butterworth high-pass and low-pass filtering, Butterworth band-stop filtering, discrete wavelet threshold processing, and normalization processing to obtain an N-channel surface electromyography signal sequence.
[0130] Sub-step A20, preprocessing and solving the 4-channel lower limb angle sequence to obtain a 4-channel joint angle sequence.
[0131] The lower limb angle sequence sent back by the IMU needs to be preprocessed and solved. Figure 5 , Figure 5 The diagram is a diagram of the joint angle sequence solution of the right lower limb. The IMUs located in the sagittal plane of the thigh, the coronal plane of the thigh, the sagittal plane of the calf and the instep are numbered 1, 2, 3 and 4. The formula can be used:
[0132] angle1=IMU1 measuring angle+90°
[0133] angle2=IMU2 measuring angle+90°
[0134] angle3=IMU3 measuring angle+90°
[0135] angle4=IMU4 measuring angle
[0136] Subsequently, the joint angles of the four channels of the right lower limb can be calculated. The angles of the coronal plane abduction of the hip joint, the sagittal plane of the hip joint, the knee joint and the ankle joint are a1, a2, a3 and a4 respectively, which can be calculated using the formula:
[0137] al=aanglel
[0138] a2=angle2
[0139] a3=180°-angle2+angle3
[0140] a4=90°-angle3+angle4
[0141] In a specific implementation, the 4-channel lower limb angle sequence can be preprocessed and solved to obtain a 4-channel joint angle sequence.
[0142] Sub-step A30, aligning the clocks of the N-channel electromyographic signal sequence and the 4-channel joint angle sequence, and superimposing them in the channel dimension to obtain an N+4 channel data set.
[0143] In a specific implementation, after obtaining an N-channel electromyographic signal sequence and a 4-channel joint angle sequence, the N-channel electromyographic signal sequence and the 4-channel joint angle sequence can be clock-aligned and superimposed in the channel dimension to obtain an N+4 channel data set.
[0144] As an example, an 8-channel electromyographic signal sequence and a 4-channel joint angle sequence are obtained, aligned in the time dimension, and then superimposed in the channel dimension to obtain a 12-channel data set.
[0145] Sub-step A40, using a preset sliding window to perform sample segmentation on the N+4 channel data set to generate a data set.
[0146] The preset sliding window may be a sliding window with a preset fixed length L and a step size J.
[0147] As an example, a sliding window with a fixed length of 1000 and a step length of 50 may be preset to perform sample segmentation on the N+4 channel data set using the sliding window.
[0148] In a specific implementation, after obtaining the N+4 channel data set, the preset sliding window can be used to perform sample segmentation on the N+4 channel data set to generate a data set. The label of the data set is a 4×1 dimensional vector that is P sampling points away from the last data point of the current window sample, representing the 4-channel joint angle of the point.
[0149] As an example, a 12-channel data set is segmented by a sliding window with a fixed length of 1000 and a step size of 50 to form a data set. The label of the data set is a 4×1 dimensional vector that is 10 sampling points away from the last data point of the current window sample, representing the 4-channel joint angle of the point.
[0150] In this embodiment, the N-channel surface electromyographic signal data is sequentially subjected to Butterworth high- and low-pass filtering, Butterworth band-stop filtering, discrete wavelet threshold processing, and normalization processing to obtain an N-channel surface electromyographic signal sequence; the 4-channel lower limb angle sequence is preprocessed and solved to obtain a 4-channel joint angle sequence; the N-channel electromyographic signal sequence and the 4-channel joint angle sequence are clock-aligned and superimposed in the channel dimension to obtain an N+4 channel data set; the N+4 channel data set is sampled and segmented using a preset sliding window to generate a data set. Thus, by preprocessing the multimodal data to obtain the data set, a foundation is laid for subsequently improving the training efficiency and model performance of the preset structure double-tower model.
[0151] Based on the above embodiments, a third embodiment of the method for predicting multiple joint angles of lower limbs of the present invention is proposed. In this embodiment, step S30 may include the following sub-steps:
[0152] Sub-step S301, the time embedding data set is processed and trained in sequence through a masked multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, and a residual and normalization layer to output a feature vector of the time dimension.
[0153] The training set that has undergone embedding processing may include a time embedding dataset and a space embedding dataset.
[0154] Residual and normalization layers are used to alleviate the gradient vanishing and gradient exploding problems that may occur during model training. Normalization speeds up the training process and prevents overfitting by normalizing the output.
[0155] In the specific implementation, for the tower in the time dimension, the time-embedded data can be passed through a masked multi-head attention layer to obtain a vector with long-distance sequence dependencies, and then passed through the CNN layer through convolution to capture the local features of the sequence; in this process, the input data (that is, the time-embedded data) skips the attention layer and the CNN layer through the residual network, and is residually connected and normalized with the feature vector output by the CNN layer; then, the feature vector is processed by the feedforward connection layer and the vector that skips this layer is residually connected and normalized to obtain the output of the tower (that is, the feature vector in the time dimension).
[0156] Further, in one embodiment, sub-step S301 may include the following sub-steps:
[0157] Sub-step B10, processing the time embedding dataset through a multi-head attention layer with a mask to obtain a vector with a long-distance sequence dependency;
[0158] Sub-step B20, capturing the local features of the sequence by convolution of the vector with the long-distance sequence dependency through a CNN layer;
[0159] Sub-step B30, performing residual connection and standardization on the time embedding data set and the local features, and outputting feature vectors of the residual and standardization layers;
[0160] Sub-step B40, processing the feature vectors of the residual and normalized layers via a feed-forward connection layer to obtain a feature vector of the feed-forward connection layer;
[0161] Sub-step B50, performing residual connection and standardization on the feature vector of the residual and normalization layer and the feature vector of the feedforward connection layer, and outputting the feature vector of the time dimension.
[0162] In the specific implementation, the time embedding dataset can be processed by a multi-head attention layer with a mask, and the multi-head attention vector representation is calculated and concatenated into an output vector to capture the long-distance dependency of the input sequence and obtain a vector with long-distance sequence dependency; then the local features of the sequence are captured by convolution through the CNN layer; in this process, the time embedding dataset skips the attention layer and the CNN layer through the residual network, and is residually connected and standardized with the local features output by the CNN layer, and the feature vector of the residual and standardized layer is output; then, the feature vector of the residual and standardized layer is processed by the feedforward connection layer to obtain the feature vector of the feedforward connection layer, and the feature vector of the feedforward connection layer and the feature vector of the residual and standardized layer that skips this layer are residually connected and standardized, and finally the feature vector of the time dimension is output.
[0163] Sub-step S302, the spatial embedding data set is processed and trained in sequence through a multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, and a residual and normalization layer, and a feature vector of a channel dimension is output.
[0164] In the specific implementation, for the channel dimension tower, the spatial embedding dataset processing steps are basically the same as the temporal embedding dataset processing steps. The difference is that the self-attention calculation processing of the spatial embedding dataset does not require a mask, and the multi-head attention layer with a mask can be modified to a multi-head attention layer. For details of the temporal embedding dataset processing steps, please refer to the above sub-steps S301 and sub-steps B10 to B50. Finally, for the channel dimension tower, the channel dimension feature vector is output.
[0165] Sub-step S303, performing aggregation processing on the feature vector of the time dimension and the feature vector of the channel dimension based on the aggregation layer to obtain a merged feature vector.
[0166] The aggregation layer may adopt a 1D-CNN structure to play the role of an "aggregation gate" for the feature vectors of the time dimension and the feature vectors of the channel dimension, and the formula may be used:
[0167]
[0168] Among them, F represents the merged feature vector; R represents the feature vector dimension of the dual tower output; and They represent the feature vectors output by the time dimension Transformer and the channel dimension Transformer respectively.
[0169] In the specific implementation, after both the time dimension priority and channel dimension priority dual towers output feature vectors, 1D-CNN can be used to aggregate the feature vectors output by the dual towers to obtain a merged feature vector.
[0170] Sub-step S304, processing the merged feature vector based on the fully connected layer to obtain a prediction result, stopping training when a preset number of iterations is reached, and outputting a lower limb multi-joint angle prediction model.
[0171] In the specific implementation, after obtaining the merged feature vector, the merged feature vector is processed through a fully connected layer in a learnable manner to output a 4×1 dimensional vector (i.e., the prediction result of the 4-channel joint angle), and the training is stopped when the preset number of iterations is reached, and the lower limb multi-joint angle prediction model is output.
[0172] In this embodiment, the time embedding data set is processed and trained sequentially through a masked multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, and a residual and normalization layer to output a feature vector of the time dimension; the space embedding data set is processed and trained sequentially through a multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, and a residual and normalization layer to output a feature vector of the channel dimension; the feature vector of the time dimension and the feature vector of the channel dimension are aggregated based on the aggregation layer to obtain a merged feature vector; the merged feature vector is processed based on the fully connected layer to obtain a prediction result, and the training is stopped when the preset number of iterations is reached, and a prediction model for multiple joint angles of the lower limbs is output. Thus, by inputting the time embedding data set and the space embedding data set into the preset structure double-tower model for training, the training efficiency of the double-tower model is improved and the prediction accuracy of the model is improved.
[0173] Based on the above embodiments, a fourth embodiment of the method for predicting multiple joint angles of lower limbs of the present invention is proposed. In this embodiment, step S40 may further include the following sub-steps:
[0174] Sub-step S41, inputting the test set into the lower limb multi-joint angle prediction model, and outputting the test value;
[0175] Sub-step S42, obtaining the true value corresponding to the test value, and using the test value and the true value to calculate the root mean square error, mean absolute error, determination coefficient and explained variance.
[0176] Among them, the root mean square error (RESE) can be used to measure the difference between the predicted value and the true value in the prediction task, evaluate the accuracy of the regression or prediction model, and provide a quantifiable error measure, which shows the average deviation of the model prediction in numerical form; it can be expressed as:
[0177]
[0178] Where n is the number of samples; y i is the i-th true value; is the i-th test value; i=1,2,...,n. The smaller the root mean square error (RESE), the higher the prediction accuracy of the model.
[0179] Mean absolute error (MAE) can be used to measure the accuracy of the model in the prediction task. It evaluates the error by the absolute value of the difference between the predicted value and the true value. It is equally sensitive to positive and negative errors and can provide an intuitive and unbiased estimate of the model error. It is suitable as a fair comparison standard between models. The formula used is:
[0180]
[0181] Where n is the number of samples; y i is the i-th true value; is the i-th test value; i=1,2,...,n. The smaller the mean absolute error (MAE), the higher the prediction accuracy of the model.
[0182] Coefficient of determination (R 2 ), which reflects the proportion of the model's variability to the total variability, can be used to evaluate the model's predictive ability in prediction tasks, and provides an indicator for evaluating the model's potential accuracy when predicting unknown data; it can be expressed as:
[0183]
[0184] Where n is the number of samples; SS res is the residual sum of squares, that is, the sum of squares of the errors between the true value and the predicted value, SS tot is the total sum of squares, that is, the sum of squares of the errors between the true value and the average of the test values. 2 ) ranges from 0 to 1. The closer the value is to 1, the higher the degree of explanation of the model.
[0185] Explained variance (EVS) can be used to measure the accuracy of models in regression or prediction tasks, indicating the proportion of data variability that the model can explain to the total variability. Variance is usually used to quantify variation in statistics, which can help understand the extent to which the model can explain the changes in the dependent variable through its independent variables; it can be expressed in the following formula:
[0186]
[0187] Among them, ESS is the explained variance; TSS is the total variance, which can be expressed as:
[0188]
[0189] Where n is the number of samples; y i is the i-th true value; is the i-th test value; is the average of all true values; i = 1, 2, ..., n. The value of the explained variance (EVS) ranges from 0 to 1. The closer the value is to 1, the higher the prediction accuracy of the model.
[0190] In the specific implementation, after obtaining the lower limb multi-joint angle prediction model, the test set can be input into the lower limb multi-joint angle prediction model, and the test value corresponding to the test set can be output; then the true value corresponding to the test value can be obtained, and the test value and the true value can be used to calculate the root mean square error, mean absolute error, determination coefficient and explained variance; thus, the four indicators of root mean square error, mean absolute error, determination coefficient and explained variance can be used to evaluate the prediction performance of the lower limb multi-joint angle prediction model.
[0191] As an example, see Figure 6-7 , Figure 6 A schematic diagram of the evaluation results of the test set. Figure 7 It is a schematic diagram comparing the predicted curve (test value) and the true curve (true value); Figure 6 It can be seen that the method for predicting the angles of multiple joints of the lower limbs of the present invention can achieve relatively accurate prediction results, among which the root mean square error (RESE) is 0.0239, the mean absolute error (MAE) is 0.015, and the determination coefficient (R 2 ) is 0.9544, the explained variance (EVS) is 0.958; and from Figure 7 It can be seen from the figure that the comparison between the true curve and the predicted curve shows a high degree of fit; in addition, it can be seen that the curve fitting degree of the coronal plane of the hip joint is relatively poor, which needs to be optimized later.
[0192] It should be noted that in this embodiment, the root mean square error (RESE), mean absolute error (MAE), and determination coefficient (R 2 ) and the calculation of explained variance (EVS) rely on the built-in calculation functions of the sklearn package.
[0193] In this embodiment, the test set is input into the lower limb multi-joint angle prediction model, and the test value is output; the true value corresponding to the test value is obtained, and the root mean square error, mean absolute error, determination coefficient and explained variance are calculated using the test value and the true value. Thus, the prediction performance of the lower limb multi-joint angle prediction model is evaluated by four indicators, namely, the root mean square error, mean absolute error, determination coefficient and explained variance. It not only evaluates the overall error predicted by the lower limb multi-joint angle prediction model on the test set, but also evaluates the potential performance of the lower limb multi-joint angle prediction model when predicting new data, making the prediction model more practical.
[0194] Based on the same inventive concept, the fifth embodiment of the present invention also provides a lower limb multi-joint angle prediction system corresponding to the lower limb multi-joint angle prediction method of the previous embodiment. Since the principle of solving the problem by the system in the fifth embodiment of the present invention is similar to the lower limb multi-joint angle prediction method of the previous embodiment of the present invention, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 8 , the lower limb multi-joint angle prediction system of the present invention may include:
[0195] The acquisition module 10 is used to acquire multimodal data of the user and preprocess the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence;
[0196] An embedding module 20, used for dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set;
[0197] A training module 30 is used to train a preset structure double-tower model using the embedded training set to obtain a lower limb multi-joint angle prediction model;
[0198] The evaluation module 40 is used to evaluate the prediction results of the lower limb multi-joint angle prediction model using the test set to obtain an evaluation result.
[0199] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned lower limb multi-joint angle prediction method is implemented.
[0200] According to the method provided by an embodiment of the present invention, the present invention also provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, the computer implements the above-mentioned lower limb multi-joint angle prediction method when executing.
[0201] According to the method provided by an embodiment of the present invention, the present invention also provides an electronic device. Specifically, the electronic device includes at least: a memory and a processor connected via a bus, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to execute all or part of the steps in the aforementioned method embodiment.
[0202] See also Fig. 9 , Fig. 9 Schematic block diagram of an electronic device provided by an embodiment of the present invention. Fig. 9As shown, the computer device includes: at least one processor 401, a memory 402, at least one network interface 403 and a user interface 405. The various components in the device are coupled together through a bus system 404. It can be understood that the bus system 404 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 In the specification, various buses are labeled as bus systems.
[0203] The user interface 405 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0204] It is understood that the memory 402 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.
[0205] The memory 402 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic terminal 400. Examples of these data include: any executable program used to operate on the electronic terminal 400, such as an operating system 4021 and an application 4022; the operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 4022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The implementation of the XX method provided in the embodiment of the present invention can be included in the application 4022.
[0206] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 401 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 401 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0207] In an exemplary embodiment, the electronic terminal 400 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.
[0208] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0209] In summary, the present invention aims to address the problem that the current lower limb joint angle prediction technology based on multimodal data ignores the coordinated relationship between muscles and joints. A lower limb multi-joint angle prediction method based on a twin-tower transformer and multimodal data is proposed, and spatiotemporal features are constructed using a twin-tower transformer architecture to improve the prediction performance of the model.
[0210] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for predicting multiple joint angles of lower limbs, characterized in that: The method comprises: Collecting multimodal data of the user and preprocessing the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence; Dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set; Using the embedded training set, the preset structure double-tower model is trained to obtain a lower limb multi-joint angle prediction model; The test set is used to evaluate the prediction results of the lower limb multi-joint angle prediction model to obtain an evaluation result.
2. The method according to claim 1, characterized in that The collecting of multimodal data of the user includes: Multiple surface electromyography sensors are used to collect N-channel surface electromyography signal data of multiple muscles when a user performs M continuous lower limb movements, and four inertial measurement units are used to collect the user's lower limb angle sequence; wherein the multimodal data includes N-channel surface electromyography signal data and 4-channel lower limb angle sequence, M≥1, N≥1.
3. The method according to claim 2, characterized in that The preprocessing of the multimodal data to obtain a data set includes: The N-channel surface electromyography signal data is sequentially subjected to Butterworth high-pass and low-pass filtering, Butterworth band-stop filtering, discrete wavelet threshold processing and normalization processing to obtain an N-channel surface electromyography signal sequence; Preprocessing and solving the 4-channel lower limb angle sequence to obtain a 4-channel joint angle sequence; Aligning the clocks of the N-channel electromyographic signal sequence and the 4-channel joint angle sequence, and superimposing them in the channel dimension to obtain an N+4 channel data set; The N+4 channel data set is segmented into samples using a preset sliding window to generate a data set.
4. The method according to claim 1, characterized in that: The embedding process is performed on the training set to obtain the embedded training set, including: Keeping the time dimension priority of the training set unchanged, obtaining a time dimension priority data set; Performing matrix transposition on the training set to obtain a spatial dimension priority data set; The time dimension priority dataset and the space dimension priority dataset are respectively embedded, and the embedded time dimension priority dataset is position-encoded to obtain a time embedded dataset and a space embedded dataset.
5. The method according to claim 4, characterized in that The method of using the embedded training set to train the preset structure double-tower model to obtain a lower limb multi-joint angle prediction model includes: The time embedding dataset is processed and trained sequentially through a multi-head attention layer with a mask, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and a feature vector of the time dimension is output; The spatial embedding dataset is processed and trained sequentially through a multi-head attention layer, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and a feature vector of a channel dimension is output; Aggregating the feature vector of the time dimension and the feature vector of the channel dimension based on the aggregation layer to obtain a merged feature vector; The merged feature vector is processed based on the fully connected layer to obtain a prediction result, and the training is stopped when a preset number of iterations is reached, and a lower limb multi-joint angle prediction model is output.
6. The method according to claim 5, characterized in that The time embedding data set is processed and trained in sequence through a multi-head attention layer with a mask, a CNN layer, a residual and normalization layer, a feedforward connection layer, a residual and normalization layer, and a feature vector of the time dimension is output, including: Processing the temporal embedding dataset through a masked multi-head attention layer to obtain a vector with long-range sequence dependencies; The vector with long-distance sequence dependency is convolved through a CNN layer to capture the local features of the sequence; Performing residual connection and standardization on the time embedding dataset and the local features, and outputting feature vectors of the residual and standardization layers; Processing the residual and the feature vector of the normalization layer via a feed-forward connection layer to obtain a feature vector of the feed-forward connection layer; The feature vector of the residual and normalization layer is residually connected and normalized with the feature vector of the feedforward connection layer, and a feature vector of the time dimension is output.
7. The method according to claim 1, characterized in that The step of evaluating the prediction results of the lower limb multi-joint angle prediction model using the test set to obtain the evaluation results includes: Inputting the test set into the lower limb multi-joint angle prediction model and outputting a test value; The true value corresponding to the test value is obtained, and the root mean square error, mean absolute error, determination coefficient and explained variance are calculated using the test value and the true value.
8. A lower limb multi-joint angle prediction system, characterized in that: The system comprises: An acquisition module, used to acquire multimodal data of a user and preprocess the multimodal data to obtain a data set; wherein the multimodal data includes surface electromyography signal data and lower limb angle sequence; An embedding module, used for dividing the data set into a training set and a test set, and performing embedding processing on the training set to obtain an embedded training set; A training module, used to train a preset structure double-tower model using the embedded training set to obtain a lower limb multi-joint angle prediction model; An evaluation module is used to evaluate the prediction results of the lower limb multi-joint angle prediction model using the test set to obtain an evaluation result.
9. An electronic device, characterized in that: The electronic device comprises: a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device performs the lower limb multi-joint angle prediction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, it implements the lower limb multi-joint angle prediction method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Human body gait predicting device based on multi-modality deep study
CN110236550A
Lower limb motion intention prediction method based on attention mechanism
CN112906673A
Underwater robot human body lower limb motion prediction method and system, medium and equipment
CN114879499A
Joint angle prediction method and device, equipment and medium
CN116522234A
Cited By
Gait anomaly detection method and device, medium and product
CN119326405A
Control method, device and equipment, computer readable storage medium and computer program product
CN119427359A
Lower limb gait data acquisition and processing method and system for auxiliary diagnosis of Parkinson's disease
CN119564159A
