A method and system for constructing a universal electromyography movement intention recognition model
Through the deep generalized correlation analysis model and deep learning algorithm, a general electromyography motor intention recognition model was constructed, which solved the problem of poor universality in the stroke rehabilitation training system, and achieved effective motor intention recognition for multiple users and new users.
Patent Information
- Application Number
- CN202210759790.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-06-30
AI Technical Summary
The existing stroke rehabilitation training system lacks a general electromyography exercise intention recognition model, which leads to poor usage versatility and is unable to achieve the same good exercise intention recognition effect as before users for new users.
Using the personalized feature extraction method, common features are extracted from the electromyography signals of multiple users through a deep generalized correlation analysis model, a general electromyography motion intention recognition model is constructed, and the corresponding relationship between feature parameters and motion intention is constructed using deep learning algorithms. , optimize the model to achieve universal motion intention recognition.
The exercise intention recognition effect of multiple users and new users is achieved, the universality and reliability of the rehabilitation training system is improved, and the dependence on specific users is reduced.
Smart Images

Figure CN115050452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer biological signal processing and training technology, and in particular to a method and system for constructing a universal myoelectric motion intention recognition model. Background Art
[0002] "Stroke", also known as "infarction" or "cerebrovascular accident", is an acute cerebrovascular disease. It is a group of diseases that cause brain tissue damage due to sudden rupture of brain blood vessels or blood vessel blockage that prevents blood from flowing into the brain, including ischemic and hemorrhagic strokes. The incidence of ischemic stroke is higher than that of hemorrhagic stroke, accounting for 60% to 70% of the total number of strokes. Occlusion and stenosis of the internal carotid artery and vertebral artery can cause ischemic stroke. Most patients are over 40 years old, and more men than women. Severe cases can cause death. The mortality rate of hemorrhagic stroke is higher. Surveys show that urban and rural stroke has become the number one cause of death in my country and the leading cause of disability among Chinese adults. Stroke has the characteristics of high incidence, high mortality and high disability rate. Among them, wrist varus is a common clinical manifestation of stroke. The user's arm muscles atrophy and the loss of the hand's grasping function are very inconvenient. The existing hand rehabilitation training includes two methods:
[0003] The first is to use manual methods, which require the assistance of nurses, doctors or family members. This requires a lot of financial support and also takes up the family’s time. During training, the rapid extension and contraction of the palms is not good for the user.
[0004] The second type is the assisted rehabilitation system. However, the premise of using this system is to bind it to a specific user and implement assisted rehabilitation training for the user. The system does not have a general model for electromyographic signal pickup and corresponding electromyographic movement intention recognition. Therefore, it is impossible to achieve the same good movement intention recognition effect for new users as for previous users, resulting in poor versatility of the entire assisted rehabilitation system.
[0005] Therefore, there is currently no rehabilitation therapy assistance system for stroke users that has the ability to build a universal electromyographic movement intention recognition model. Summary of the invention
[0006] In order to solve the problems existing in the prior art, the present invention provides the following method for constructing a universal electromyographic motion intention recognition model, which constructs the user's personality characteristics for individual users using the method of time-frequency domain feature extraction; collects and extracts the personality characteristics of multiple users, uses a deep generalized correlation analysis model to realize common feature extraction, and sets a criterion objective function to represent the correlation between the personality characteristics of multiple users. Finally, a common feature data set is constructed by obtaining the projection vector when the objective function is maximum; the common feature data set is divided into a training set and a test set; a deep learning algorithm is used to deeply mine the intrinsic correlation of feature parameters in the training set, and a corresponding model between feature parameters and motion intention is constructed; and a validation set is used to repeatedly test and optimize the model to construct a complete and reliable universal motion intention recognition model.
[0007] On the one hand, the present invention provides a method for constructing a universal myoelectric motion intention recognition model, comprising:
[0008] S1, collecting electromyographic signals of multiple users, and preprocessing the electromyographic signals of the multiple users respectively;
[0009] S2, constructing a deep generalized correlation analysis model based on the preprocessed electromyographic signals of the multiple users, and extracting common features of the multiple users based on the deep generalized correlation analysis model;
[0010] S3, collecting electromyographic signals of new users, extracting electromyographic signal features of the new users based on the electromyographic signals of the new users, extracting common features of the new users from the electromyographic signal features of the new users based on the deep generalized correlation analysis model, and fusing the common features of the new users with the extracted common features of multiple users to obtain fused features;
[0011] S4, constructing a general model data set based on the fusion features, inputting the general model data set into the motion intention classification network to construct a general electromyographic motion intention recognition model, and the general electromyographic motion intention recognition model is used to achieve motion intention recognition effect for multiple users and new users.
[0012] Preferably, the S2 may also be: S2', extracting multi-user individual features based on the preprocessed electromyographic signals of the multiple users; constructing a deep generalized correlation analysis model based on the extracted multi-user individual features; and extracting multi-user common features based on the deep generalized correlation analysis model.
[0013] Preferably, the electromyographic signals of S1 are electromyographic signals when the multiple users mobilize their limbs to perform various limb movements according to their own movement intentions, and the collection is repeated multiple times for each limb movement.
[0014] Preferably, the preprocessing in S1 includes noise reduction, normalization, taking absolute value and data segmentation, wherein:
[0015] The noise reduction comprises: setting the filter type and coefficient and the blind source separation method according to the characteristics of the electromyographic signal; filtering out the noise caused by power frequency interference, motion artifacts and / or multi-channel crosstalk in the original electromyographic signal based on the filter and the blind source separation method, thereby obtaining the electromyographic signal after the noise is filtered out;
[0016] The normalization includes: limiting the electromyographic signal after the noise is filtered out to a suitable size that is conducive to model training based on a Z-score or maximum and minimum normalization method to obtain a normalized electromyographic signal;
[0017] The taking of absolute values comprises: taking absolute values of all sequences of the normalized electromyographic signals;
[0018] Data segmentation: The entire sequence of normalized EMG signals after taking the absolute value is cut into multiple EMG time series windows.
[0019] Preferably, the step of extracting personality features of multiple users based on the preprocessed electromyographic signals of the multiple users in S2′ comprises:
[0020] Extract multiple time-frequency domain signals from the preprocessed signal to form a feature vector;
[0021] Calculating the intra-class distance and inter-class distance of the feature vector as a criterion for feature separability; dividing the feature vector into a high-separability feature vector and a low-separability feature vector according to the criterion;
[0022] The highly separable feature vector is used as a result of extracting personality features of multiple users, wherein the highly separable feature vector contains multiple myoelectric features related to each individual of the multiple users.
[0023] Preferably, in S2′, constructing a deep generalized correlation analysis model based on the extracted individual characteristics of multiple users, and extracting common characteristics of multiple users based on the deep generalized correlation analysis model comprises:
[0024] Performing feature clipping on the extracted multi-user personality features so that the data dimensions of the multi-user personality features are unified;
[0025] Input the multi-user personality features of the same dimension into the multi-layer deep neural network MLP (MultilayerPerceptron) to obtain new features after nonlinear representation transformation;
[0026] Calculating the intra-class scatter matrix of the new feature, the intra-class scatter matrix is a positive definite matrix, designing a criterion objective function according to the intra-class scatter matrix, and when the criterion objective function is the largest, the similarity of the electromyographic signals between users is the highest;
[0027] When calculating the maximum of the criterion objective function, the projection vectors in the criterion objective function are connected based on the projection vectors of multiple users to construct a projection vector set, and the projection vector set serves as the weight of the deep generalized correlation analysis model, corresponding one-to-one to the individual characteristics of the multiple users. A common feature extraction model is established based on the weight of the deep generalized correlation analysis model, and based on the common feature extraction model, the projection vector set is multiplied by the individual characteristics of the multiple users to form a maximum correlation feature set, and the maximum correlation feature set is used as the extracted common features of the multiple users.
[0028] Preferably, S3 includes:
[0029] Acquire the common features of the multiple users, and collect all or part of the electromyographic data of the new user;
[0030] Determining personality characteristics of the new user based on all or part of the electromyographic data of the new user;
[0031] Extracting common features between the new user and multiple users based on calculation of the projection vector set in the deep generalized correlation analysis model;
[0032] The common features of the new user and multiple users are combined with the common features between multiple users to obtain fused features.
[0033] Preferably, S4 includes:
[0034] Divide the common feature data set into a training set and a test set;
[0035] The training set is input into the motion intention classification network, and the intrinsic correlation between the feature parameters of the training set is learned using a deep learning algorithm, a corresponding relationship between the feature parameters and the motion intention is constructed, and a general recognition model is obtained based on the corresponding relationship.
[0036] Preferably, the motion intention classification network is a motion intention recognition network based on a cross-attention multi-scale dual-stream Transformer encoder, comprising a dual-stream Transformer encoder, a long-short sequence feature cross-attention module, a multi-scale feature fusion module, and a motion intention classification module, wherein:
[0037] The dual-stream Transformer encoder includes a channel attention module, a long sequence slice transformation module, a short sequence slice transformation module, a multi-head re-attention mechanism module and a feedforward neural network module;
[0038] The long-short sequence feature cross attention module is used to simultaneously learn the long sequence branch recognition information and the short sequence branch recognition information obtained by the long sequence slice transformation module and the short sequence slice transformation module;
[0039] The multi-scale feature fusion module is used to fuse the long sequence branch identification information and the short sequence branch identification information and then output a multi-scale fusion feature;
[0040] The motion intention classification module is used to use full connection to perform motion intention classification on the multi-scale fusion features to obtain a motion intention output result;
[0041] Building the dual-stream Transformer encoder includes:
[0042] Establishing a channel attention module, including: calculating the connection between each channel according to the temporal characteristics of sample information and the spatial characteristics of multi-channel electromyographic signals, learning the importance of the signal characteristics of each channel in the spatial distribution to the recognition of rehabilitation movements, and adaptively adjusting the recognition weight of each channel so that the sample timing window passing through the channel attention module forms channel attention;
[0043] Establishing a long sequence slicing transformation module and a short sequence slicing transformation module, including: slicing the sample time sequence window forming the channel attention according to the number of sampling points within a certain period of time to form a long sequence with more sampling points and a short sequence with fewer sampling points; transforming the long sequence and the short sequence of each slice into a long sequence slice one-dimensional vector and a short sequence slice one-dimensional vector through a long sequence slicing module and a short sequence slicing module respectively;
[0044] A multi-head attention mechanism module or a multi-head re-learning attention mechanism module is established, wherein the calculation formula of each head in the multi-head attention mechanism module is as shown in formula (1). The calculation formula of the attention mechanism can be used to learn the correlation between each slice in the same layer:
[0045]
[0046] Among them, Attention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Softmax is a normalized exponential function, Softmax function is a single-layer neural network, which is a generalization of the binary classification function sigmoid in multi-classification, and is used to display the results of multi-classification in the form of probability. The calculation method of Softmax is: Softmax converts the prediction results from negative infinity to positive infinity into probabilities in two steps: the first step is to convert the prediction results of the model to the exponential function to ensure the non-negativity of the probability; the second step is to ensure that the sum of the probabilities of each prediction result is equal to 1, and the converted results are normalized, that is, the converted results are divided by the sum of all converted results, and the percentage of the converted results in the total is taken as the approximate probability;
[0047] The multi-head re-learning attention mechanism module adds a re-learning attention mechanism to the dual-stream Transformer encoder: by using a transformation matrix with learnable parameters between the multi-head attentions, the mathematical expression of the multi-head re-learning attention mechanism is shown in formula (2):
[0048] Re-Attention(Q',K',V')=Norm(θ T MultiHead(Q',K',V')) (2);
[0049] in,
[0050] MultiHead(Q',K',V')=concat(head 1,...,head h);
[0051]
[0052] Where Re-Attention is a multi-head re-attention mechanism, Attention is a single-head attention transformation, Q', K', V' are the transformed query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Softmax is a normalized exponential function, and the transformation matrix is θ T , Norm function is a normalization function, including finding the maximum singular value or norm; MultiHead(Q', K', V') is the original multi-head attention matrix; head i is the i-th single-head attention matrix; concat function can connect multiple matrices along the specified axis to form a concatenated matrix;
[0053] A feedforward neural network is established, wherein the feedforward neural network is composed of a plurality of fully connected layers and is used to learn the linear features of the electromyographic signal.
[0054] A second aspect of the present invention provides a general myoelectric motion intention recognition model construction system, comprising:
[0055] The electromyographic signal acquisition and preprocessing module is used to acquire electromyographic signals of multiple users and preprocess the electromyographic signals of the multiple users respectively;
[0056] A common feature extraction module, which constructs a deep generalized correlation analysis model based on the preprocessed electromyographic signals of the multiple users, and extracts common features of multiple users based on the deep generalized correlation analysis model;
[0057] A common feature fusion module is used to collect electromyographic signals of new users, extract electromyographic signal features of the new users based on the electromyographic signals, extract common features of the new users from the electromyographic signal features of the new users based on the deep generalized correlation analysis model, and fuse the common features of the new users with the extracted common features of multiple users to obtain fused features;
[0058] A motion intention recognition model construction module is used to construct a general model data set based on the fusion features, and input the general model data set into the motion intention classification network to construct a general electromyographic motion intention recognition model. The general electromyographic motion intention recognition model is used to achieve motion intention recognition effects for multiple users and new users.
[0059] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is configured to read the instructions and execute the method described in the first aspect.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the plurality of instructions can be read by a processor and execute the method described in the first aspect.
[0061] The general myoelectric motion intention recognition model construction method, system, electronic device and computer-readable storage medium provided by the present invention have the following beneficial technical effects:
[0062] Construct user personality characteristics based on individual user electromyography signals; collect and extract personality characteristics of multiple users, use deep generalized correlation analysis model to realize common feature extraction, set the criterion objective function to represent the correlation between personality characteristics of multiple users; finally, construct a common feature data set by obtaining the projection vector when the objective function is maximum; divide the common feature data set into training set and test set; use deep learning algorithm to deeply mine the intrinsic correlation of feature parameters in the training set, and construct a corresponding model between feature parameters and motion intention; use validation set to repeatedly test and optimize the model to build a complete and reliable general motion intention recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 This is a flow chart of the method for constructing a universal myoelectric motion intention recognition model described in the present invention.
[0064] Figure 2 The present invention is a flowchart of the common feature construction method.
[0065] Figure 3 This is a schematic diagram of the process flow of extracting common features using deep generalized correlation analysis taking two users as an example as described in the present invention.
[0066] Figure 4 This is a flow chart of a method for a preferred embodiment of common feature fusion according to the present invention.
[0067] Figure 5 This is a flow chart of the method for training a motion intention classification network to obtain a general recognition model according to the present invention.
[0068] Figure 6 A schematic diagram of the system structure for constructing the universal myoelectric movement intention recognition model described in the present invention.
[0069] Figure 7 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0070] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0071] The method provided by the present invention can be implemented in the following terminal environment, and the terminal may include one or more of the following components: a processor, a memory, and a display screen. The memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the following embodiment.
[0072] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory.
[0073] The memory may include random access memory (RAM) or read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instructions.
[0074] The display screen is used to display the user interface of each application.
[0075] In addition, those skilled in the art can understand that the structure of the above terminal does not constitute a limitation on the terminal, and the terminal may include more or fewer components, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, and a power supply, which will not be described in detail here.
[0076] Embodiment 1
[0077] See also Figure 1 The present embodiment provides a method for constructing a universal electromyographic motion intention recognition model, including: S1, collecting electromyographic signals of multiple users, and preprocessing the electromyographic signals of the multiple users respectively; S2, constructing a deep generalized correlation analysis model based on the preprocessed electromyographic signals of the multiple users, and extracting common features of multiple users based on the deep generalized correlation analysis model; S3, collecting electromyographic signals of new users, extracting electromyographic signal features of the new user based on the electromyographic signals of the new user, extracting common features of the new user from the electromyographic signal features of the new user based on the deep generalized correlation analysis model, and fusing the common features of the new user with the extracted common features of multiple users to obtain fused features; S4, constructing a universal model data set based on the fused features, inputting the universal model data set into a motion intention classification network to construct a universal electromyographic motion intention recognition model, and the universal electromyographic motion intention recognition model is used to achieve motion intention recognition effects for multiple users and new users.
[0078] As a preferred implementation, the S2 may also be: S2' extracts personality features of multiple users based on the preprocessed electromyographic signals of the multiple users; and constructs a deep generalized correlation analysis model based on the extracted personality features of the multiple users.
[0079] As a preferred implementation, the electromyographic signals of S1 are electromyographic signals when the multiple users mobilize their limbs to perform various limb movements according to their own movement intentions, and the collection is repeated multiple times for each limb movement.
[0080] As a preferred implementation, the preprocessing in S1 includes noise reduction, normalization, taking absolute value and data segmentation, wherein:
[0081] The noise reduction includes: setting the filter type and coefficients and the blind source separation method according to the characteristics of the electromyographic signal; filtering out the noise caused by power frequency interference, motion artifacts and / or multi-channel crosstalk in the original electromyographic signal based on the filter and the blind source separation method, thereby obtaining the electromyographic signal after noise is filtered out.
[0082] The normalization includes: limiting the electromyographic signal after the noise is filtered out to a suitable size that is beneficial to model training based on a Z-score or maximum and minimum normalization method to obtain a normalized electromyographic signal.
[0083] Taking the absolute value includes: taking the absolute value of the entire sequence of the normalized electromyographic signal; the implementation of step S13 is because in the normalized electromyographic signal, the signal amplitude of each action segment is positive or negative, but both positive and negative can represent muscle contraction, and not performing absolute value processing may offset useful information.
[0084] Data segmentation: This is because the electromyographic signal is a time series. According to the sampling rate of the sampling device, a long sequence will be collected. Since the data is too long, it is impossible to train and identify the data. Therefore, the entire sequence of the normalized electromyographic signal after taking the absolute value is cut into multiple electromyographic time series windows, that is, windowing.
[0085] As a preferred embodiment, the multi-user personality feature extraction based on the preprocessed electromyographic signals of the multiple users in S2' includes: extracting a variety of time-frequency domain signals from the preprocessed signals to form a feature vector; calculating the intra-class distance and inter-class distance of the feature vector as a criterion for feature separability; dividing the feature vector into a high-separability feature vector and a low-separability feature vector according to the criterion; and using the high-separability feature vector as the result of multi-user personality feature extraction, wherein the high-separability feature vector contains multiple electromyographic features related to each individual among the multiple users.
[0086] The Deep Generalized Canonical Correlation Analysis (DGCCA) model learns a nonlinear mapping for each view to maximize the correlation between representations learned across views. In training, DGCCA passes the input vector in each view through multiple layers of nonlinear transformations and back-propagates the gradient of the GCCA objective with respect to the network parameters to adjust the network for each view. The goal is to train the network to reduce the GCCA reconstruction error between its outputs. New data can be provided to each view through its respective network to be projected.
[0087] As a preferred implementation, the step of constructing a deep generalized correlation analysis model based on the extracted individual characteristics of multiple users in S2', and extracting common characteristics of multiple users based on the deep generalized correlation analysis model includes: Figure 2 As shown, the extracted multi-user personality features are subjected to feature clipping so that the data dimensions of the multi-user personality features are unified. The multi-user personality features of the same dimension are input into a multi-layer deep neural network MLP (Multilayer Perceptron) to obtain new features after nonlinear characterization transformation.
[0088] For this embodiment, the number of multiple users is set to L; the deep generalized correlation analysis model is used to realize common feature extraction. After step S33, the deep network can be used to convert the multi-user electromyographic individual features A, B...L into nonlinear deep representations to obtain new features A′, B′.....L′.
[0089] The intra-class scatter matrix of the new feature is calculated, the intra-class scatter matrix is a positive definite matrix, and a criterion objective function is designed according to the intra-class scatter matrix. When the criterion objective function is the largest, the similarity of the electromyographic signals between users is the highest.
[0090] When the criterion objective function is calculated to be maximum, the projection vectors in the criterion objective function are connected based on the projection vectors of multiple users to construct a projection vector set, and the projection vector set serves as the weight of the deep generalized correlation analysis model, corresponding one-to-one to the individual characteristics of the multiple users. A common feature extraction model is established based on the weights of the deep generalized correlation analysis model, and based on the common feature extraction model, the projection vector set is multiplied with the individual characteristics of the multiple users (in the form of the original signal matrix) to form a maximum correlation feature set, and the maximum correlation feature set is used as the extracted common features of the multiple users.
[0091] The constructed deep generalized correlation analysis model (GGCCA, Deep Generalized CCA) includes a multi-layer deep neural network, which transfers the input vector in each feature through multi-layer nonlinear transformation, and back-propagates the gradient of the generalized correlation analysis target relative to the parameters of the multi-layer deep neural network to adjust the network of each feature, thereby converting personality characteristics into nonlinear deep representations.
[0092] See also Figure 3 In this embodiment, two users are used as an example to specifically introduce the process of extracting common features using deep generalized correlation analysis. The individual features of two users numbered 1 and 2 are used to obtain the common features of users 1 and 2 and the deep generalized correlation analysis model through the deep generalized correlation analysis algorithm.
[0093] First, through the nonlinear representation transformation realized by the multi-layer neural network MLP, new features A' and B' are obtained: the dimension of personality feature A is N1*M, and the dimension of personality feature B is N2*M. Since the DGCCA model can only receive data with the same dimension and the dimension is (N*M), N=min(N1, N2) is taken to unify the data dimension. After the data clipping in step S32, the dimensions of personality features A and B are the same and are both N*M, where N represents the data volume, which is related to the length of the personality feature, and M represents the data dimension, which is related to the number of electromyographic channels. Figure 4S represents the number of the electromyographic subject. After step S33, new features A' and B' are obtained. Then, they are transformed into the common projection space.
[0094] The transformation process is as follows: Assume that the feature vectors of the two users are: x∈A' and y∈B', let the intra-class scatter matrix of sample space A and B be S A and S B , and S A and S B is a positive definite matrix, then the criterion objective function J(ξ,η) is:
[0095]
[0096] Where n is the number of users. In this embodiment, n=2, L AB =nS AB .
[0097] When the value of the objective function J(ξ,η) reaches the maximum, the projection vector (ξ,η) is obtained. At this time, the following projection vector set of generalized correlation is obtained after calculation:
[0098] The projection vector set from A to A′ is: w1 = W x T x;
[0099] The projection vector set from B to B′ is: w2 = W y T y;
[0100] Among them, W x =(ξ1,ξ2,…ξd),W y =(η1, η2, ..., ηd), d is the vector dimension; finally, the common feature Z is obtained:
[0101] Z = (w1, w2);
[0102] At this time, the representations of the projected feature samples of the two users satisfy the minimum intra-class discreteness and maximum correlation, and are regarded as common features.
[0103] As a preferred implementation, S3 includes: obtaining the common features of multiple users and collecting all or part of the electromyographic data of the new user at the same time; determining the personality features of the new user based on all or part of the electromyographic data of the new user; extracting the common features between the new user and multiple users based on the calculation of the projection vector set in the deep generalized correlation analysis model; splicing and fusing the common features between the new user and multiple users with the common features between multiple users to obtain fused features.
[0104] See also Figure 4When there is a new user (such as the user personality feature C of number 3 in this embodiment), the common features of the new user are calculated by the projection vector set in the above common feature extraction model, such as according to w1=W x T x obtains the common feature C′ of C and A, according to w2=W y T y obtains the common feature C″ of C and B, and concatenates and fuses them (C′, C″) to form a general model data set. (When the number of myoelectric users used in step S3 is large enough, the most similar common feature C can always be found. X ).
[0105] As a preferred implementation, S4 includes: dividing the common feature data set into a training set and a test set; inputting the training set into a motion intention classification network, using a deep learning algorithm to learn the intrinsic correlation between the feature parameters of the training set, constructing a correspondence between the feature parameters and the motion intention, and obtaining a general recognition model based on the correspondence.
[0106] As a preferred implementation, the motion intention classification network is a motion intention recognition network based on a cross-attention multi-scale dual-stream Transformer encoder, including a dual-stream Transformer encoder, a long-short sequence feature cross-attention module, a multi-scale feature fusion module, and a motion intention classification module, wherein:
[0107] The dual-stream Transformer encoder includes a channel attention module, a long sequence slice transformation module, a short sequence slice transformation module, a multi-head re-attention mechanism module and a feedforward neural network module.
[0108] The long-short sequence feature cross-attention module is used to simultaneously learn the long sequence branch identification information and the short sequence branch identification information obtained by the long sequence slice transformation module and the short sequence slice transformation module.
[0109] The multi-scale feature fusion module is used to fuse the long sequence branch identification information and the short sequence branch identification information and then output the multi-scale fusion feature. The specific method is to first use the classification slice (CLStoken, classification token) of each branch as an agent to exchange information between the sequence slices (patch token) of another branch, and then project it to its own branch. Since the CLS token has learned the abstract information between all patch tokens in its own branch, the interaction with the patch token in another branch helps to fuse information of different scales. After fusing with other branch tokens, the CLS token interacts with its own patch token again on the next layer of Transformer encoder. In this step, it can pass the learning information from another branch to its own patch token to enrich the feature representation of each patch token.
[0110] The motion intention classification module uses full connection to perform motion intention classification on the multi-scale fusion features to obtain a motion intention output result.
[0111] As a preferred implementation, establishing the dual-stream Transformer encoder includes:
[0112] A channel attention module is established, including: calculating the connection between channels according to the timing characteristics of electromyographic signals and the spatial characteristics of multi-channel electromyographic signals, where one channel corresponds to one electromyographic sensor, and multiple electromyographic sensors are distributed on different muscle groups; learning the importance of the signal characteristics of each channel in the spatial distribution to action recognition, and adaptively adjusting the recognition weight of each channel so that the electromyographic timing window passing through the channel attention module forms channel attention, thereby enabling the movement intention recognition network to better extract the action information contained in the electromyography.
[0113] A long sequence slicing transformation module and a short sequence slicing transformation module are established, including: slicing the sample time window that forms the channel attention according to the number of sampling points within a certain period of time to form a long sequence with more sampling points and a short sequence with fewer sampling points respectively; transforming the long sequence and the short sequence of each slice into a long sequence slice one-dimensional vector and a short sequence slice one-dimensional vector respectively through a long sequence slicing module and a short sequence slicing module; extracting long-time electromyographic sequence features will cause information redundancy for simple signal recognition, and extracting short-time electromyographic sequence feature information is not sufficient to recognize complex signals, so simultaneously slicing long sequences and short sequences is beneficial to the recognition efficiency and effect of signals of various properties.
[0114] Establishing a multi-head attention mechanism module or a multi-head re-learning attention mechanism module is because when using a convolutional neural network to build a model, increasing the network depth can extract more detailed features, which is an effective way to improve model performance. However, how to design the connection between network layers so that the performance of deep convolutional networks is better than that of shallow convolutional neural networks is a problem that relevant researchers have been studying. For this reason, networks such as Resnet, Mobilenet, and Efficientnet have been proposed to improve network performance by increasing network depth.
[0115] The calculation formula of each head in the multi-head attention mechanism module is as shown in formula (1). The calculation formula of the attention mechanism can be used to learn the correlation between each slice in the same layer:
[0116]
[0117] Among them, Attention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Softmax is a normalized exponential function, Softmax function is a single-layer neural network, which is the generalization of the binary classification function sigmoid in multi-classification, and is used to display the results of multi-classification in the form of probability. The calculation method of Softmax is: Softmax converts the prediction results from negative infinity to positive infinity into probabilities in two steps: the first step is to convert the prediction results of the model to the exponential function to ensure the non-negativity of the probability; the second step is to ensure that the sum of the probabilities of each prediction result is equal to 1, and the converted results are normalized, that is, the converted results are divided by the sum of all converted results, and the percentage of the converted results in the total is used as the approximate probability. Through this attention calculation formula, the correlation between each slice in the same layer can be learned.
[0118] The multi-head re-learning attention mechanism module adds a re-learning attention mechanism to the dual-stream Transformer encoder: by using a transformation matrix with learnable parameters between the multi-head attentions, the mathematical expression of the multi-head re-learning attention mechanism is shown in formula (2):
[0119] Re-Attention(Q',K',V')=Norm(θ T MultiHead(Q',K',V')) (2);
[0120] in,
[0121] MultiHead(Q',K',V')=concat(head 1,...,head h);
[0122]
[0123] Where Re-Attention is a multi-head re-attention mechanism, Attention is a single-head attention transformation, Q', K', V' are the transformed query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Softmax is a normalized exponential function, and the transformation matrix is θ T , Norm function is a normalization function, including obtaining the maximum singular value or norm; MultiHead(Q', K', V') is the original multi-head attention matrix; headi is the i-th single-head attention matrix; concat function can connect multiple matrices along the specified axis to form a concatenated matrix.
[0124] Compared with the multi-head attention module, the relearning attention module adds a transformation matrix to collect complementary information through the interaction between the multi-head attentions, which better improves the diversity of attention features. Moreover, compared with the multi-head self-attention mechanism, it only requires negligible computational overhead. The multiple heads of the multi-head self-attention mechanism in each layer learn different features to increase the diversity of features learned at different layers, so that the model can achieve the expected performance improvement.
[0125] A feedforward neural network is established, which is composed of multiple fully connected layers and fully learns the linear characteristics of the electromyographic signal.
[0126] See also Figure 5 , when there are L users, the fusion features C′, C″…C L Directly input the public mapping space after DGCCA conversion, build a universal model dataset, and input the universal model dataset into the two-stream Transformer motion intention classification network for learning to obtain the universal recognition model construction parameters. After saving the universal recognition model construction parameters locally, a universal electromyography motion intention recognition model is constructed based on the universal recognition model construction parameters. The universal electromyography motion intention recognition model can achieve good motion intention recognition effects for both multiple users and new users.
[0127] It should be noted that the two-stream Transformer motion intent classification network can also be replaced by CNN or LSTM, etc., as long as it is a model that can complete the classification task in deep learning. It is within the protection scope of the present invention. The key to the method of constructing a universal recognition model in this patent lies in how to extract common features and construct a universal model dataset. The two-stream Transformer motion intent classification network used has the best effect.
[0128] Embodiment 2
[0129] See also Figure 6 , this embodiment provides a general electromyographic motion intention recognition model construction system, including:
[0130] The electromyographic signal collection and preprocessing module 101 is used to collect electromyographic signals of multiple users and preprocess the electromyographic signals of the multiple users respectively.
[0131] The common feature extraction module 102 constructs a deep generalized correlation analysis model based on the preprocessed electromyographic signals of the multiple users, and extracts common features of multiple users based on the deep generalized correlation analysis model.
[0132] The common feature fusion module 103 is used to collect the electromyographic signal of the new user, extract the electromyographic signal features of the new user based on the electromyographic signal, extract the common features of the new user from the electromyographic signal features of the new user based on the deep generalized correlation analysis model, and fuse the common features of the new user with the extracted common features of multiple users to obtain fused features.
[0133] The motion intention recognition model construction module 104 is used to construct a general model data set based on the fusion features, and input the general model data set into the motion intention classification network to construct a general electromyographic motion intention recognition model, and the general electromyographic motion intention recognition model is used to achieve motion intention recognition effects for multiple users and new users.
[0134] The present invention also provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method described in the first embodiment.
[0135] like Figure 7 As shown, the present invention also provides an electronic device, including a processor 501 and a memory 502 connected to the processor 501, wherein the memory 502 stores a plurality of instructions, which can be loaded and executed by the processor so that the processor can execute the method described in Example 1.
[0136] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for constructing a universal electromyography motion intention recognition model. It is characterized in that include: S1, collecting electromyographic signals of multiple users, and preprocessing the electromyographic signals of the multiple users respectively; S2, constructing a deep generalized correlation analysis model based on the preprocessed electromyographic signals of the multiple users, and extracting common features of the multiple users based on the deep generalized correlation analysis model; S3, collecting electromyographic signals of new users, extracting electromyographic signal features of the new users based on the electromyographic signals of the new users, extracting common features of the new users from the electromyographic signal features of the new users based on the deep generalized correlation analysis model, and fusing the common features of the new users with the extracted common features of multiple users to obtain fused features; S4, constructing a general model data set based on the fusion features, inputting the general model data set into a motion intention classification network to construct a general electromyographic motion intention recognition model, wherein the general electromyographic motion intention recognition model is used to achieve motion intention recognition effect for multiple users and new users; The S4 includes: Divide the general model dataset into training set and test set; Inputting the training set into a motion intention classification network, using a deep learning algorithm to learn the intrinsic associations between the feature parameters of the training set, constructing a correspondence between the feature parameters and the motion intention, and obtaining a general recognition model based on the correspondence; The motion intention classification network is a motion intention recognition network based on a cross-attention multi-scale dual-stream Transformer encoder, including a dual-stream Transformer encoder, a long-short sequence feature cross-attention module, a multi-scale feature fusion module, and a motion intention classification module, wherein: The dual-stream Transformer encoder includes a channel attention module, a long sequence slice transformation module, a short sequence slice transformation module, a multi-head re-attention mechanism module and a feedforward neural network module; The long-short sequence feature cross attention module is used to simultaneously learn the long sequence branch recognition information and the short sequence branch recognition information obtained by the long sequence slice transformation module and the short sequence slice transformation module; The multi-scale feature fusion module is used to fuse the long sequence branch identification information and the short sequence branch identification information and then output a multi-scale fusion feature; The motion intention classification module is used to use full connection to perform motion intention classification on the multi-scale fusion features to obtain a motion intention output result; Building the dual-stream Transformer encoder includes: Establishing a channel attention module, including: calculating the connection between each channel according to the temporal characteristics of sample information and the spatial characteristics of multi-channel electromyographic signals, learning the importance of the signal characteristics of each channel in the spatial distribution to the recognition of rehabilitation movements, and adaptively adjusting the recognition weight of each channel so that the sample timing window passing through the channel attention module forms channel attention; Establishing a long sequence slicing transformation module and a short sequence slicing transformation module, including: slicing the sample time sequence window forming the channel attention according to the number of sampling points within a certain period of time to form a long sequence with more sampling points and a short sequence with fewer sampling points; transforming the long sequence and the short sequence of each slice into a long sequence slice one-dimensional vector and a short sequence slice one-dimensional vector through a long sequence slicing module and a short sequence slicing module respectively; A multi-head attention mechanism module or a multi-head re-learning attention mechanism module is established, wherein the calculation formula of each head in the multi-head attention mechanism module is as shown in formula (1). The calculation formula of the attention mechanism can be used to learn the correlation between each slice in the same layer: ; in Attention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, Soft ma x The function is a single-layer neural network, which is a binary classification function sigmoid The generalization of multi-classification is used to display the results of multi-classification in the form of probability. Soft The calculation method of max is :Soft max converts the prediction results from negative infinity to positive infinity into probabilities in two steps: the first step is to convert the prediction results of the model to an exponential function to ensure the non-negativity of the probability; the second step is to normalize the converted results to ensure that the sum of the probabilities of each prediction result is equal to 1, that is, to divide the converted results by the sum of all converted results, and take the percentage of the converted results in the total as the approximate probability; The multi-head re-learning attention mechanism module adds a re-learning attention mechanism to the dual-stream Transformer encoder: by using a transformation matrix with learnable parameters between the multi-head attentions, the mathematical expression of the multi-head re-learning attention mechanism is shown in formula (2): ; in, ; ; in Re-Attention It is a multi-head re-attention mechanism. Attention is a single-head attention transformation, Q', K', V’ are the converted query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, and the transformation matrix is , the Norm function is a normalization function, including finding the maximum singular value or norm; is the original multi-head attention matrix; head i is the i-th single-head attention matrix; , , are the i-th single-head attention matrices respectively head i The corresponding transformed query matrix, key matrix and value matrix; the concat function can connect multiple matrices along the specified axis to form a concatenated matrix; A feedforward neural network is established, wherein the feedforward neural network is composed of a plurality of fully connected layers and is used to learn the linear features of the electromyographic signal.
2. A method for constructing a universal electromyographic motion intention recognition model according to claim 1, It is characterized in that The electromyographic signals of S1 are electromyographic signals when the multiple users mobilize their limbs to perform various limb movements according to their own movement intentions, and the collection is repeated multiple times for each limb movement.
3. A method for constructing a universal electromyographic motion intention recognition model according to claim 1, It is characterized in that The preprocessing in S1 includes noise reduction, normalization, taking absolute value and data segmentation, wherein: The noise reduction comprises: setting the filter type and coefficient and the blind source separation method according to the characteristics of the electromyographic signal; filtering out the noise caused by power frequency interference, motion artifacts and / or multi-channel crosstalk in the original electromyographic signal based on the filter and the blind source separation method, thereby obtaining the electromyographic signal after the noise is filtered out; The normalization includes: limiting the electromyographic signal after the noise is filtered out to a suitable size that is conducive to model training based on a Z-score or maximum and minimum normalization method to obtain a normalized electromyographic signal; The taking of absolute values comprises: taking absolute values of all sequences of the normalized electromyographic signals; Data segmentation: The entire sequence of normalized EMG signals after taking the absolute value is cut into multiple EMG time series windows.
4. A general method for constructing an electromyographic motion intention recognition model. It is characterized in that include: S1, collecting electromyographic signals of multiple users, and preprocessing the electromyographic signals of the multiple users respectively; S2', extracting personality features of multiple users based on the pre-processed electromyographic signals of the multiple users; Constructing a deep generalized correlation analysis model based on the extracted multi-user personality features; Extracting multi-user common features based on the deep generalized correlation analysis model; S3, collecting electromyographic signals of new users, extracting electromyographic signal features of the new users based on the electromyographic signals of the new users, extracting common features of the new users from the electromyographic signal features of the new users based on the deep generalized correlation analysis model, and fusing the common features of the new users with the extracted common features of multiple users to obtain fused features; S4, constructing a general model data set based on the fusion features, inputting the general model data set into a motion intention classification network to construct a general electromyographic motion intention recognition model, wherein the general electromyographic motion intention recognition model is used to achieve motion intention recognition effect for multiple users and new users; The S4 includes: Divide the general model dataset into training set and test set; Inputting the training set into a motion intention classification network, using a deep learning algorithm to learn the intrinsic associations between the feature parameters of the training set, constructing a correspondence between the feature parameters and the motion intention, and obtaining a general recognition model based on the correspondence; The motion intention classification network is a motion intention recognition network based on a cross-attention multi-scale dual-stream Transformer encoder, including a dual-stream Transformer encoder, a long-short sequence feature cross-attention module, a multi-scale feature fusion module, and a motion intention classification module, wherein: The dual-stream Transformer encoder includes a channel attention module, a long sequence slice transformation module, a short sequence slice transformation module, a multi-head re-attention mechanism module and a feedforward neural network module; The long-short sequence feature cross attention module is used to simultaneously learn the long sequence branch recognition information and the short sequence branch recognition information obtained by the long sequence slice transformation module and the short sequence slice transformation module; The multi-scale feature fusion module is used to fuse the long sequence branch identification information and the short sequence branch identification information and then output a multi-scale fusion feature; The motion intention classification module is used to use full connection to perform motion intention classification on the multi-scale fusion features to obtain a motion intention output result; Building the dual-stream Transformer encoder includes: Establishing a channel attention module, including: calculating the connection between each channel according to the temporal characteristics of sample information and the spatial characteristics of multi-channel electromyographic signals, learning the importance of the signal characteristics of each channel in the spatial distribution to the recognition of rehabilitation movements, and adaptively adjusting the recognition weight of each channel so that the sample timing window passing through the channel attention module forms channel attention; Establishing a long sequence slicing transformation module and a short sequence slicing transformation module, including: slicing the sample time sequence window forming the channel attention according to the number of sampling points within a certain period of time to form a long sequence with more sampling points and a short sequence with fewer sampling points; transforming the long sequence and the short sequence of each slice into a long sequence slice one-dimensional vector and a short sequence slice one-dimensional vector through a long sequence slicing module and a short sequence slicing module respectively; A multi-head attention mechanism module or a multi-head re-learning attention mechanism module is established, wherein the calculation formula of each head in the multi-head attention mechanism module is as shown in formula (1). The calculation formula of the attention mechanism can be used to learn the correlation between each slice in the same layer: ; in Attention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, Soft The max function is a single-layer neural network and a binary classification function. sigmoid The generalization of multi-classification is used to display the results of multi-classification in the form of probability. Soft The calculation method of max is :Soft max converts the prediction results from negative infinity to positive infinity into probabilities in two steps: the first step is to convert the prediction results of the model to an exponential function to ensure the non-negativity of the probability; the second step is to normalize the converted results to ensure that the sum of the probabilities of each prediction result is equal to 1, that is, to divide the converted results by the sum of all converted results, and take the percentage of the converted results in the total as the approximate probability; The multi-head re-learning attention mechanism module adds a re-learning attention mechanism to the dual-stream Transformer encoder: by using a transformation matrix with learnable parameters between the multi-head attentions, the mathematical expression of the multi-head re-learning attention mechanism is shown in formula (2): ; in, ; ; in Re-Attention It is a multi-head re-attention mechanism. Attention is a single-head attention transformation, Q', K', V’ are the converted query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, and the transformation matrix is , the Norm function is a normalization function, including finding the maximum singular value or norm; is the original multi-head attention matrix; head i is the i-th single-head attention matrix; , , are the i-th single-head attention matrices respectively head i The corresponding transformed query matrix, key matrix and value matrix; the concat function can connect multiple matrices along the specified axis to form a concatenated matrix; A feedforward neural network is established, wherein the feedforward neural network is composed of a plurality of fully connected layers and is used to learn the linear features of the electromyographic signal.
5. A method for constructing a universal electromyographic motion intention recognition model according to claim 4, It is characterized in that The extraction of multi-user personality features based on the pre-processed electromyographic signals of the multiple users in S2′ comprises: Extract multiple time-frequency domain signals from the preprocessed signal to form a feature vector; Calculating the intra-class distance and inter-class distance of the feature vector as a criterion for feature separability; dividing the feature vector into a high-separability feature vector and a low-separability feature vector according to the criterion; The highly separable feature vector is used as a result of extracting personality features of multiple users, wherein the highly separable feature vector contains multiple myoelectric features related to each individual of the multiple users.
6. A method for constructing a universal electromyographic motion intention recognition model according to claim 5, It is characterized in that The step of constructing a deep generalized correlation analysis model based on the extracted individual characteristics of multiple users in S2′, and extracting common characteristics of multiple users based on the deep generalized correlation analysis model includes: Performing feature clipping on the extracted multi-user personality features so that the data dimensions of the multi-user personality features are unified; Input the multi-user personality features of the same dimension into the multi-layer deep neural network MLP to obtain new features after nonlinear representation transformation; Calculating the intra-class scatter matrix of the new feature, the intra-class scatter matrix is a positive definite matrix, designing a criterion objective function according to the intra-class scatter matrix, and when the criterion objective function is the largest, the similarity of the electromyographic signals between users is the highest; When calculating the maximum of the criterion objective function, the projection vectors in the criterion objective function are connected based on the projection vectors of multiple users to construct a projection vector set, and the projection vector set serves as the weight of the deep generalized correlation analysis model, corresponding one-to-one to the individual characteristics of the multiple users. A common feature extraction model is established based on the weight of the deep generalized correlation analysis model, and based on the common feature extraction model, the projection vector set is multiplied by the individual characteristics of the multiple users to form a maximum correlation feature set, and the maximum correlation feature set is used as the extracted common features of the multiple users.
7. A method for constructing a universal electromyographic motion intention recognition model according to claim 6, It is characterized in that The S3 includes: Acquire the common features of the multiple users, and collect all or part of the electromyographic data of the new user; Determining personality characteristics of the new user based on all or part of the electromyographic data of the new user; Extracting common features between the new user and multiple users based on calculation of the projection vector set in the deep generalized correlation analysis model; The common features of the new user and multiple users are combined with the common features between multiple users to obtain fused features.
8. A universal electromyographic motion intention recognition model construction system, used to implement the construction method described in any one of claims 1 to 7, It is characterized in that include: The electromyographic signal collection and preprocessing module (101) is used to collect electromyographic signals of multiple users and preprocess the electromyographic signals of the multiple users respectively; A common feature extraction module (102) constructs a deep generalized correlation analysis model based on the pre-processed electromyographic signals of the multiple users, and extracts common features of multiple users based on the deep generalized correlation analysis model; A common feature fusion module (103) is used to collect electromyographic signals of new users, extract electromyographic signal features of the new users based on the electromyographic signals, extract common features of the new users from the electromyographic signal features of the new users based on the deep generalized correlation analysis model, and fuse the common features of the new users with the extracted common features of multiple users to obtain fused features; A motion intention recognition model construction module (104) is used to construct a general model data set based on the fusion feature, and input the general model data set into the motion intention classification network to construct a general electromyographic motion intention recognition model, wherein the general electromyographic motion intention recognition model is used to achieve the motion intention recognition effect for multiple users and new users, and comprises: Divide the common feature data set into a training set and a test set; Inputting the training set into a motion intention classification network, using a deep learning algorithm to learn the intrinsic associations between the feature parameters of the training set, constructing a correspondence between the feature parameters and the motion intention, and obtaining a general recognition model based on the correspondence; The motion intention classification network is a motion intention recognition network based on a cross-attention multi-scale dual-stream Transformer encoder, including a dual-stream Transformer encoder, a long-short sequence feature cross-attention module, a multi-scale feature fusion module, and a motion intention classification module, wherein: The dual-stream Transformer encoder includes a channel attention module, a long sequence slice transformation module, a short sequence slice transformation module, a multi-head re-attention mechanism module and a feedforward neural network module; The long-short sequence feature cross attention module is used to simultaneously learn the long sequence branch recognition information and the short sequence branch recognition information obtained by the long sequence slice transformation module and the short sequence slice transformation module; The multi-scale feature fusion module is used to fuse the long sequence branch identification information and the short sequence branch identification information and then output a multi-scale fusion feature; The motion intention classification module is used to use full connection to perform motion intention classification on the multi-scale fusion features to obtain a motion intention output result; Building the dual-stream Transformer encoder includes: Establishing a channel attention module, including: calculating the connection between each channel according to the temporal characteristics of sample information and the spatial characteristics of multi-channel electromyographic signals, learning the importance of the signal characteristics of each channel in the spatial distribution to the recognition of rehabilitation movements, and adaptively adjusting the recognition weight of each channel so that the sample timing window passing through the channel attention module forms channel attention; Establishing a long sequence slicing transformation module and a short sequence slicing transformation module, including: slicing the sample time sequence window forming the channel attention according to the number of sampling points within a certain period of time to form a long sequence with more sampling points and a short sequence with fewer sampling points; transforming the long sequence and the short sequence of each slice into a long sequence slice one-dimensional vector and a short sequence slice one-dimensional vector through a long sequence slicing module and a short sequence slicing module respectively; A multi-head attention mechanism module or a multi-head re-learning attention mechanism module is established, wherein the calculation formula of each head in the multi-head attention mechanism module is as shown in formula (1). The calculation formula of the attention mechanism can be used to learn the correlation between each slice in the same layer: ; in Attention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, Soft The max function is a single-layer neural network and a binary classification function. sigmoid The generalization of multi-classification is used to display the results of multi-classification in the form of probability. Soft The calculation method of max is :Soft max converts the prediction results from negative infinity to positive infinity into probabilities in two steps: the first step is to convert the prediction results of the model to an exponential function to ensure the non-negativity of the probability; the second step is to normalize the converted results to ensure that the sum of the probabilities of each prediction result is equal to 1, that is, to divide the converted results by the sum of all converted results, and take the percentage of the converted results in the total as the approximate probability; The multi-head re-learning attention mechanism module adds a re-learning attention mechanism to the dual-stream Transformer encoder: by using a transformation matrix with learnable parameters between the multi-head attentions, the mathematical expression of the multi-head re-learning attention mechanism is shown in formula (2): ; in, ; ; in Re-Attention It is a multi-head re-attention mechanism. Attention is a single-head attention transformation, Q', K', V’ are the converted query matrix, key matrix and value matrix respectively, d is the row vector dimension of the matrix, Soft max is the normalized exponential function, and the transformation matrix is , the Norm function is a normalization function, including finding the maximum singular value or norm; is the original multi-head attention matrix; head i is the i-th single-head attention matrix; , , are the i-th single-head attention matrices respectively head i The corresponding transformed query matrix, key matrix and value matrix; the concat function can connect multiple matrices along the specified axis to form a concatenated matrix; A feedforward neural network is established, wherein the feedforward neural network is composed of a plurality of fully connected layers and is used to learn the linear features of the electromyographic signal.
9. An electronic device comprising a processor and a memory, wherein the memory stores a plurality of instructions. It is characterized in that The processor is used to read the instruction and execute the construction method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a plurality of instructions. It is characterized in that The multiple instructions can be read by a processor and execute the construction method as described in any one of claims 1-7.
Citation Information
Patent Citations
Surface electromyogram signal classification method and system based on Transformer model
CN113397572A
Emotion recognition method and emotion recognition model based on electroencephalogram data
CN114209323A
