A surface myoelectric signal end-side adaptive decoding method and system
Patent Information
- Application Number
- CN202610994319.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-10-30
AI Technical Summary
当肌电信号分布发生变化时,系统难以实现自适应调整
[0035]本发明采用端侧在线自适应训练机制,通过人机协同方式生成运动意图标签并构建训练样本,在可编程逻辑器件侧直接完成模型的反向传播与参数更新。当电极位移、肌肉疲劳等干扰因素引起肌电信号特征漂移时,系统无需离线重训练即可在线恢复解码性能。经6名受试者实验验证,在电极位置偏移扰动下,系统可快速恢复较高的识别性能,任务完成率保持在99%以上,路径效率达78%以上,表明本发明具备良好的在线自适应能力、鲁棒性及长期连续控制能力。
Smart Images

Figure CN123012564A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electromyography decoding and online adaptive technology, specifically relating to a method and system for end-side adaptive decoding of surface electromyography signals. Background Technology
[0002] In recent years, electromyography (EMG) decoding has been widely used in the field of medical rehabilitation. Surface electromyography (EMG) signals, as bioelectrical signals reflecting muscle activity, can decode a user's motor intentions, providing a natural and convenient control method for patients with movement disorders. Currently, EMG decoding technology has been applied to systems such as intelligent prosthetic limb control, rehabilitation robot-assisted training, exoskeleton assistive devices, and virtual reality rehabilitation, significantly improving the patient's rehabilitation experience and enhancing the recovery of limb function.
[0003] However, surface electromyography (EMG) signals exhibit significant non-stationarity: affected by various factors such as changes in limb posture, electrode position deviation, sensor contact changes, and muscle fatigue, the amplitude and spectral characteristics of EMG signals drift significantly over time, leading to a decrease in model recognition accuracy, a deterioration in system control stability, and an impact on the user experience of the device.
[0004] In addition, electromyography (EMG) decoding systems have high real-time requirements and involve sensitive data such as human physiological electrical signals. Traditional solutions mostly rely on cloud processing or high-performance computing platforms, which not only suffer from communication latency and network fluctuations but also face security risks such as leakage of physiological data privacy. Therefore, deploying EMG decoding algorithms on edge platforms such as wearable devices to complete signal processing, motion intention recognition, and control decisions locally has become the mainstream direction of industry development. This can effectively reduce system latency, reduce communication power consumption, and enhance device portability and privacy security.
[0005] Most current edge-side EMG decoding systems only support fixed model inference and lack online parameter updates and continuous learning capabilities. When the distribution of EMG signals changes, the system struggles to adaptively adjust. Existing adaptive solutions typically rely on high-performance devices such as CPUs or GPUs for online or offline training, resulting in high computational resource consumption, high power consumption, and high storage requirements, making them difficult to deploy directly on resource-constrained edge devices. Summary of the Invention
[0006] Technical Problem: To address the aforementioned technical problems, this invention proposes an electromyography (EMG) decoding system and method that can be deployed on edge devices and possesses both low-power real-time inference capabilities and adaptive update capabilities, thereby improving the system's stability, robustness, and continuous control capabilities during long-term use.
[0007] Technical solution: To achieve the above objectives, the technical solution of the present invention is as follows:
[0008] An end-to-end adaptive decoding method for surface electromyography signals includes the following steps:
[0009] S1: Acquire surface electromyographic signals of the wrist joint muscle group;
[0010] S2: The collected surface electromyography signals are preprocessed and feature extracted to obtain multi-channel electromyography feature values;
[0011] S3: The motion intention decoding model based on a multilayer perceptron deployed on a programmable logic device is used to infer the electromyographic feature values to obtain the motion intention prediction result, and the motion of the controlled object is controlled according to the motion intention prediction result;
[0012] S4: Calculate the position deviation vector based on the current position coordinates of the controlled object and the preset target position coordinates, and generate a two-dimensional motion intention label based on the position deviation vector; construct training samples for the motion intention decoding model based on the electromyographic feature values and the two-dimensional motion intention label, and update the motion intention decoding model based on the error between the motion intention prediction result and the two-dimensional motion intention label.
[0013] S5: Using the training samples, the motion intent decoding model is trained and its parameters are updated online on the programmable logic device side, and the updated motion intent decoding model is used for subsequent inference of the electromyographic feature values.
[0014] Furthermore, the preprocessing and feature extraction described in S2 include: segmenting the surface electromyography signal using a sliding window, and calculating the root mean square value of the time window for each channel as the electromyography feature value of that channel.
[0015] Furthermore, the motion intent decoding model is a multilayer perceptron, including an input layer, a hidden layer, and an output layer; the input layer is used to receive the electromyographic feature values, the hidden layer uses ReLU as the activation function, and the output layer outputs two-dimensional continuous motion velocity information.
[0016] Furthermore, the generation of motion intent tags based on the current position of the controlled object and the preset target position in S4 specifically includes:
[0017] The user's intention direction is inferred in real time based on the current position of the controlled object and the preset target position. The user's intention direction is represented as a unit vector pointing from the current position to the target position.
[0018] ;
[0019] in: Indicates the current position; Indicates the target location;
[0020] The muscle activation intensity of the surface electromyography signal is used to characterize the cursor's movement speed, and combined with the unit vector to generate continuous motion intention labels:
[0021] ;
[0022] in, Tags indicating the user's continuous movement intentions Let be the root mean square value of the i-th channel.
[0023] Furthermore, in S5, the backpropagation, gradient calculation, and model parameter update operations during model training are all deployed and executed in a programmable logic hardware unit; the triggering conditions for online training and parameter updates are: automatic triggering when the control precision is detected to be lower than a preset threshold, or manual triggering by the user.
[0024] Furthermore, fixed-point quantization technology is adopted to convert the weight parameters and bias parameters of the motion intent decoding model from 32-bit floating-point numbers to fixed-point numbers. The integer width of the fixed-point number is 3 bits and the decimal width is 7 bits, which is used to reduce the model storage resource consumption and hardware computational complexity.
[0025] Furthermore, the programmable logic device described in step S3 is equipped with a reconfigurable multiply-accumulate array; the reasoning process of the motion intent decoding model and the matrix multiplication operation in the online training process are both parallelized by performing block calculations on the weight matrix through the reconfigurable multiply-accumulate array. Furthermore, the programmable logic device employs an inter-layer pipelined parallel mechanism to decouple the computation process of each layer in the multilayer perceptron, and directly transmits data between layers through a data flow interface, enabling computational tasks at different layers to be executed in parallel in a pipelined manner.
[0026] Furthermore, the programmable logic device is an FPGA, and the motion intent decoding model is deployed on the programmable logic side of the ZYNQ series FPGA; the training samples are stored in the off-chip storage medium of the end-side device.
[0027] Another aspect of this invention proposes an end-to-end adaptive decoding system for surface electromyography (EMG) signals, comprising a top-level controller, an inference unit, a backpropagation unit, and a model update engine, wherein...
[0028] The top-level controller is deployed on the processor side of the system and is used to control the scheduling of inference tasks and the activation of model update tasks.
[0029] The inference unit, backpropagation unit, and model update engine are all deployed on the FPGA programmable logic side.
[0030] The inference unit is used to preprocess the surface electromyography signal and use the preprocessed data to infer the motion intention decoding model to obtain the motion intention prediction result.
[0031] The backpropagation unit is used to compute the loss function, bias gradient, and weight gradient using the training set.
[0032] The model update engine is used to update the model parameters based on the bias gradient and weight gradient.
[0033] Furthermore, the interface between the processor side and the FPGA programmable logic side adopts the AXI-Stream protocol and is equipped with a DMA-based double buffering mechanism to hide the waiting time for data transmission and data processing through ping-pong operation; the inference unit uses fixed-point format to perform model inference, and the backpropagation unit and the model update engine use floating-point format to perform model parameter updates.
[0034] Beneficial Effects: This invention proposes an end-to-end adaptive decoding method and system for surface electromyography (EMG) signals. It employs a multilayer perceptron to achieve real-time decoding of EMG signals and utilizes a human-machine collaborative adaptive method to enable continuous model updates. Compared to existing technologies, this invention offers the following advantages:
[0035] This invention employs an edge-side online adaptive training mechanism, generating motion intent labels and constructing training samples through human-machine collaboration. Backpropagation and parameter updates of the model are directly performed on the programmable logic device side. When electromyographic signal characteristics drift due to interference factors such as electrode displacement and muscle fatigue, the system can recover decoding performance online without offline retraining. Experiments with six subjects verified that, under electrode position shift perturbations, the system can quickly recover high recognition performance, maintaining a task completion rate above 99% and a path efficiency above 78%, indicating that this invention possesses excellent online adaptive capability, robustness, and long-term continuous control capability.
[0036] This invention deploys the motion intent decoding model on the FPGA programmable logic side, employing fixed-point quantization technology and hardware parallel acceleration mechanisms to effectively reduce the computational complexity and power consumption of model inference. Experimental data shows that the FPGA-side inference power consumption is 0.131 W, and the average time for a single inference is 14.08 μs. Compared to the software execution method on the same platform processor, the inference power consumption is reduced by approximately 95%, which can meet the dual requirements of low power consumption and real-time performance for edge devices.
[0037] In a preferred embodiment of the present invention, the weight matrix is computed in blocks by constructing a reconfigurable processing unit array, and an inter-layer pipelined parallel mechanism is adopted, which can further reduce memory access overhead and module idle time, and improve computational throughput. Experimental data shows that online training of 1000 training samples in 200 iterations takes approximately 4.94 seconds, with a training power consumption of 0.365 W, which is about 87% lower than the processor-side software execution method. This demonstrates that the present invention has efficient online training capabilities on resource-constrained edge devices. Attached Figure Description
[0038] Figure 1 This is the overall architecture diagram of the surface electromyography signal end-side online adaptive decoding system;
[0039] Figure 2 This is a schematic diagram of the human-computer interaction control interface;
[0040] Figure 3 This is an overall hardware structure diagram, which shows the system hardware architecture;
[0041] Figure 4 This is the hardware design diagram of the PE array;
[0042] Figure 5 This is a schematic diagram of the interlayer pipeline parallel mechanism; Figure 6 This is a graph showing the changes in cursor control performance at different experimental stages; Figure 7 These are representative cursor movement trajectory diagrams corresponding to different experimental stages. Detailed Implementation
[0043] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0044] Example 1:
[0045] An online adaptive decoding method for surface electromyography signals is proposed, the implementation process of which is as follows:
[0046] First, the subject puts on the Myo armband to the middle of his right forearm, places the electrodes close to the skin, connects the Myo armband to the Zynq development board, and connects the Zynq development board to the Unity interactive environment.
[0047] The specific steps include the following:
[0048] S1: Acquire surface electromyographic signals of the wrist joint muscle group;
[0049] S2: Preprocess and extract features from the acquired signals to obtain eight-channel electromyography feature values;
[0050] S3: Use a motion intent decoding model to predict motion intent from electromyographic features and output two-dimensional motion velocity information;
[0051] S4: Generate motion intent labels based on the current control target and control object positions, and construct online training samples;
[0052] S5: Use online training samples to train and update the parameters of the motion intent decoding model online, and use the updated model to continue performing subsequent motion intent prediction tasks.
[0053] In step S2, the preprocessing and feature extraction process includes: segmenting the surface electromyography signal using a sliding window and calculating the root mean square value (RMS) of each channel time window to measure the muscle activation level of that channel, and using it as input to the subsequent model for speed decoding.
[0054] As a further preferred embodiment of the above method, the sliding window length is 200 ms and the window step size is 50 ms.
[0055] In step S3, the motion intent decoding model adopts a multilayer perceptron (MLP) structure, including an input layer, a hidden layer, and an output layer. The input layer receives multi-channel electromyographic feature input; the hidden layer uses a modified linear unit (ReLU) as the activation function; and the output layer outputs two-dimensional motion velocity information for continuous motion control. The motion intent decoding model is deployed on an edge hardware platform and performs motion intent prediction tasks in real time.
[0056] In step S4, the online adaptive mechanism generates motion intention labels using a human-machine collaborative adaptive approach. The user controls a two-dimensional control object to move towards the target object via wrist joint movements, and the system simultaneously infers the user's intention in real time using both the control object's position and the target's position. Assuming the user expects the control object to move along a straight line to the target, the user's intended direction of motion can be represented as a unit vector pointing from the current control object's position to the target position:
[0057] ;
[0058] in:
[0059] Indicates the current position;
[0060] Indicates the target location.
[0061] The intensity of muscle activation using surface electromyography (EMG) signals is used to characterize the movement speed of the controlled object, thereby obtaining a complete and continuous movement intention label:
[0062] ;
[0063] in, This label represents the user's continuous movement intention.
[0064] Using the methods described above, the system can generate continuous motion intention labels in real time during the interaction process. In each round of the interaction task, the system records the user's electromyographic signal characteristics and the corresponding motion intention labels, forming new training samples. These training samples are added to the training set for subsequent online updates of the model.
[0065] In step S5, the motion intent decoding model is trained online using online training samples. The gradient calculation, backpropagation, and model parameter update operations during the online training process are executed within a programmable logic hardware unit. The system calculates the loss function based on the model prediction results and motion intent labels, and uses the backpropagation algorithm to calculate the gradient of the model parameters. Subsequently, an optimizer iteratively updates the model parameters to achieve continuous adaptive learning of the model.
[0066] Furthermore, the edge-side online adaptive decoding method described in this embodiment employs quantization technology to convert the model's weights and bias parameters from 32-bit floating-point numbers to fixed-point numbers, thereby reducing the storage overhead and computational complexity of the model parameters.
[0067] To reduce storage access conflicts and computational latency during online training, a reconfigurable PE array is constructed to parallelize matrix multiplication operations. By dividing the weight matrix into blocks for computation, memory access overhead is reduced and computational throughput is improved.
[0068] A pipelined parallel mechanism is established between layers to decouple the computation processes of different layers in the neural network. Direct data transfer between layers is achieved through a data flow interface, enabling different layers to process input data from different time stages simultaneously. Combined with reconfigurable PE arrays and parallel optimization strategies such as Pipeline and Unroll, the execution latency differences between modules are minimized, allowing computations in preceding and following layers to be executed in parallel. This reduces memory access overhead and module idle time, lowers edge inference latency, and improves the system's real-time responsiveness.
[0069] Example 2:
[0070] An on-device online adaptive decoding system for surface electromyography (EMG) signals includes a top-level controller, an inference unit, a backpropagation unit, and a model update engine. The top-level controller, deployed on the system's processor side, is responsible for the overall system control logic, including scheduling inference tasks and enabling online model update tasks. The inference unit, backpropagation unit, and model update engine are all deployed on an FPGA. The inference unit preprocesses the EMG signals and uses the preprocessed data to infer an MLP model, employing a Corrected Linear Unit (ReLU) as the model's activation function. The backpropagation unit calculates the loss function, bias gradient, and weight gradient using the training set. The model update engine updates the model parameters.
[0071] The processor-side interface with the FPGA uses the AXI-Stream protocol for transmitting surface electromyography signals and a DMA-based double buffering mechanism is designed to hide the waiting time for data transmission and data processing through ping-pong operations.
[0072] The overall architecture of the surface electromyography signal end-side online adaptive decoding system of the present invention is shown in the figure below. Figure 1 As shown. The Unity user interface is designed with a "center-outer" cursor task, as follows. Figure 2 As shown, the subject needs to manipulate the blue cursor in the center of the screen to hit the target, and complete each trial as quickly as possible by flexing and extending the wrist (controlling horizontal movement) and adducting / abducting the wrist joint (controlling vertical movement).
[0073] This example demonstrates online adaptive decoding of electromyography by following the steps below:
[0074] S1: The user wears the Myo armband on their right forearm to verify the communication between the Myo armband, the Zynq development board, and the Unity interactive system. Electromyography (EMG) signals are transmitted wirelessly from the Myo armband to the mobile device, and then via TCP to the Zynq platform for further processing. The Zynq platform sends the EMG signals to the FPGA's model inference unit via DMA. Its interface uses the AXI-Stream protocol for EMG signal transmission. A DMA-based double-buffering mechanism is also designed.
[0075] State 0: In the initial state, the DMA transfers data to buffer A. When the buffer is full, it enters state 1.
[0076] State 1: The DMA automatically switches to buffer B for data transfer, while the inference unit reads and processes the data in buffer A; when buffer B is full and the data in buffer A is read out, it enters state 2.
[0077] State 2: DMA automatically switches to buffer A to transfer data, and the inference unit reads data from buffer B;
[0078] The system then continuously switches between states 1 and 2 without manual intervention. This operation hides the waiting time for data transmission and processing.
[0079] S2: Preprocessing and feature extraction of electromyographic signals: A 200ms window length is selected, and the root mean square (RMS) of each channel is calculated as an indicator of muscle activation level. For a window containing N sampling points, the RMS value of the i-th channel is defined as follows:
[0080] ;
[0081] in This represents the j-th sample point of the i-th channel. This RMS sequence will be used as input to the subsequent model for speed decoding.
[0082] S3: A multilayer perceptron (MLP) is used as the motion velocity prediction model: the model takes the root mean square values of eight channels as input and outputs the motion velocity in both horizontal and vertical directions. A modified linear unit (ReLU) is used as the activation function.
[0083] As a further preferred embodiment of the above method, the hidden layer contains 50 neurons, and the specific implementation steps are as follows:
[0084] S3.1: Input 8-channel surface electromyography signal characteristic values;
[0085] S3.2: Perform a linear transformation on the input layer, multiply the current input layer by the corresponding weight matrix, and add it to the bias vector to obtain a weighted sum; introduce the nonlinear unit ReLU as the activation function, and output a hidden layer containing 50 neurons;
[0086] S3.2: Using 50 hidden units as input, perform linear transformation and activation processing sequentially to obtain the output layer of the network; then perform a further linear transformation to output the predicted velocity values in the horizontal and vertical directions, which are used for cursor motion control.
[0087] All parameters of the electromyography (EMG) decoding model are randomly initialized. Weight parameters are generated using the Xavier uniform distribution initialization method, while bias parameters are initialized to 0. The randomly initialized EMG decoding model is then deployed to the ZYNQ processing system for motion intent prediction. The prediction results are transmitted to the processor via the AXI bus and then sent to the Unity interactive interface via serial port to control cursor movement in a two-dimensional plane. A fixed data frame format is used during communication to ensure transmission reliability. The received data is parsed in Unity, mapping wrist joint movement to cursor movement. The user observes the cursor position in real time and adjusts their wrist posture accordingly to guide the cursor to move along a straight line towards the target.
[0088] S4: Deploy the model training algorithm onto the ZYNQ processing system, use the Adam optimizer to train the network, and calculate the loss to update the model parameters. The model training part adopts a human-machine collaborative adaptive training framework. Assuming that the user always expects the cursor to move in a straight line to the target, the system can simultaneously use the cursor position and the target position to infer the user's intention in real time. The direction of the user's intention can be represented as a unit vector from the current cursor position to the target position:
[0089] ;
[0090] in:
[0091] Indicates the current position;
[0092] Indicates the target location.
[0093] Muscle activation intensity using electromyography signal array ( The cursor's movement speed is represented by a vector, and the product of its speed and the unit vector of its direction of movement represents the user's true movement intention, thus obtaining a complete and continuous movement intention label.
[0094] ;
[0095] in, This represents the user's continuous movement intention labels. In each interaction task, the system records the user's electromyographic signal features and the corresponding movement intention labels, forming new training samples. These training samples are added to the training set for the next round of online model updates.
[0096] The specific steps for model training are as follows:
[0097] S4.1: Calculate the prediction results using the current parameters of the model. The specific steps are the same as in S3.
[0098] S4.2: The mean squared error loss is used to quantify the degree of error in the prediction results; the gradient of each parameter with respect to the loss is calculated backward from the output layer to the input layer; after obtaining the gradient, all parameters are updated using gradient descent.
[0099] S4.3: Repeat steps S4.1 to S4.2.
[0100] When the user notices insufficient precision in controlling the cursor, they can manually press the custom model update trigger button, and the system will automatically call up the training set to update the model. The updated parameters will be promptly transmitted to the model's inference unit, and the model will use the new parameters for subsequent inference tasks.
[0101] In this example, the training set is stored on an external storage medium (SD card) provided with the Zynq terminal, and the "space bar" is defined as the model update trigger interface. Manually pressing the space bar will automatically call the training set from the external storage medium to update the model.
[0102] Figure 3 This is a diagram of the overall hardware structure of the system. It includes a top-level controller, an inference unit, a backpropagation unit, and a model update engine. The top-level controller is deployed on the processor side of the system and is responsible for the overall system control logic, including scheduling inference tasks and enabling online model updates. The inference unit, backpropagation unit, and model update engine are all deployed in an FPGA. The inference unit is used to preprocess surface electromyography (EMG) signals and perform MLP model inference using the preprocessed data to generate continuous velocity prediction results. The backpropagation unit calculates the model's loss function using the training set and calculates the bias gradient and weight gradient through backpropagation to generate the gradient information needed for model parameter optimization. The model update engine uses the weights and bias gradients stored in BRAM to update the model parameters, enabling the edge model to continuously adapt to individual differences in EMG signals and environmental disturbances, thereby ensuring control accuracy and system stability.
[0103] The system inference unit employs model quantization technology to convert 32-bit floating-point numbers into fixed-point representations. This example, while ensuring model inference accuracy, minimizes model storage overhead and computational complexity by systematically analyzing the quantization bit width. The specific steps are as follows:
[0104] (1) To determine the required number of integer digits, set the decimal digit width to a sufficiently large value (10 bits) and change the integer digit width. Keep the decimal digits unchanged at 10 bits, modify the integer digits, and observe the impact of different integer digit widths on the accuracy of the results;
[0105] (2) To determine the required number of decimal places, set the integer digit width to a sufficiently large value (10 bits) and change the decimal digit width. Keep the integer digit width unchanged at 10 bits, modify the decimal digit width, and observe the effect of the number of decimal places on the accuracy of the result.
[0106] The results show that the accuracy reaches its maximum when the integer bit width reaches 3 bits, and further increasing the integer bit width does not affect the accuracy. However, as the fractional bit width increases, the accuracy of the calculation results gradually increases and tends to converge. It is evident that 3 integer bits are sufficient to meet the numerical range and precision requirements of this invention, while the fractional bit width has a more significant impact on the calculation results. Furthermore, when the fractional bit width reaches 7 bits, the success rate of the "center-outer" cursor task designed in this example reaches 100%, and the user can precisely control the cursor movement in real time, meeting the accuracy requirements of this example. Therefore, this example uses a fixed-point number with 3 integer bits and 7 fractional bits as the data format for the inference unit. To ensure the model's convergence stability, this example only uses the fixed-point number format for the inference unit; the training unit still retains high-precision floating-point numbers for updating model parameters in the FPGA.
[0107] This example uses a multilayer perceptron (MLP) as the intent decoding model. For the two fully connected neural networks in this example, a reconfigurable PE array is proposed. The network structure has 8 input electromyographic signal features, 50 hidden layers, and 2 output velocity values. For any output neuron in the network, it can be represented as the sum of the weighted sum of the input features and the bias term. That is, for the j-th output neuron, we have:
[0108] ;
[0109] in Indicates the first Each input feature Representing input features With the The weight parameters between the output neurons For the corresponding bias term, The dimension of the input feature.
[0110] To achieve efficient data flow mapping for multilayer perceptron computation, a reconfigurable PE array is employed. The weight matrix is divided into small blocks, and matrix multiplication is performed on a block-by-block basis. In this embodiment, the two linear transformation layers utilize PE arrays of sizes 4×5 and 5×2, respectively.
[0111] The first layer weight matrix is 8×50, and a 4x5 PE array is used to perform multiply-accumulate (MAC) calculations. Each row processes 4 input features in parallel, and each column computes 5 output neurons in parallel. This means the array can perform a 4×5 matrix multiplication operation in a single pass. Figure 4As shown, during computation, the 8-dimensional input features are divided into two groups of 4-dimensional features, and the 8×50 weights are divided into 20 small 4×5 matrices. The 8×50 matrix operations are completed using a small-scale 4×5 array through input time-division multiplexing and segmented weight loading. After all MAC results are accumulated, bias addition and ReLU activation are performed sequentially and then fed into the hidden layer buffer. In this architecture, the total number of DSP units required is related to the PE array size, which is 4×5.
[0112] The second-layer weight matrix is 50×2, and a 5x2 PE array is used to complete the final inference computation. Each row processes 5 hidden layer input features in parallel, and the two columns correspond to 2 output neurons for parallel computation. The parallel mechanism is the same as the previous stage. After the MAC results are accumulated, bias addition is performed and the final inference result is output.
[0113] This invention also proposes an interlayer pipeline parallel mechanism, such as... Figure 5 As shown. The core idea of this mechanism is to decouple the two fully connected computations of the MLP at a hierarchical level, construct corresponding hardware computation modules for each, and execute these modules in parallel through a pipelined approach, thereby eliminating memory access latency and computational idleness caused by data dependencies between layers. The specific steps are as follows:
[0114] (1) The MLP network structure is decoupled hierarchically into two independent hardware units. The first computation module corresponds to the matrix multiplication calculation from the input layer to the hidden layer, and the second computation module corresponds to the mapping from the hidden layer to the output layer. Each computation module is implemented based on the aforementioned reconfigurable PE array.
[0115] (2) Based on step (1), combine parallel optimization strategies such as pipeline and unroll to minimize the difference in execution latency between modules.
[0116] (3) Connect the input and output interfaces of each module through the AXI4-Stream interface to realize direct data transmission between layers.
[0117] The devices used in this invention include: the Myo armband, the Unity interactive environment, and the Zynq UltraScale+ MPSOCs development board. The Myo armband, launched in early 2013 by ThalmicLabs of Canada, is a control terminal device that collects bioelectrical signals of the user's arm muscle activity through its built-in electromyography (EMG) sensor. After being parsed by an embedded processor, the corresponding control commands are wirelessly transmitted to the controlled terminal via Bluetooth. The Unity interactive environment, built on a computer, serves as the visual feedback center for the entire system. The Zynq development board is the core component of the system, deploying the model's inference and update algorithms.
[0118] This invention provides an end-to-end online adaptive decoding system for surface electromyography (EMG) signals, comprising an EMG signal acquisition module, a signal preprocessing and feature extraction module, a motion intent decoding module, an online training and parameter update module, a data transmission module, and an interactive control module.
[0119] The electromyography (EMG) signal acquisition module is used to acquire multi-channel surface EMG signals from the human forearm.
[0120] As a further preferred embodiment of the above system, the present invention utilizes the gesture control Myo armband launched by Thalmic Labs of Canada. Users only need to put the armband on their forearms, and its built-in electrodes can read the bioelectrical signals of the muscles when the user makes a stretching gesture. The signals are then transmitted wirelessly via Bluetooth and processed to achieve motion intention recognition and wireless control.
[0121] The interactive control module is built on the Unity interactive environment and is used to receive the motion intent decoding result and control the movement of the target object in the interactive interface according to the predicted two-dimensional motion speed.
[0122] The edge computing platform adopts a heterogeneous hardware architecture based on Zynq UltraScale+ MPSoC to complete tasks such as electromyography signal decoding, online model training, and parameter updates. The model inference results are transmitted to the interactive control module via a communication interface to achieve real-time human-computer interaction control.
[0123] Experimental results show that, under the same test data and model structure, the power consumption of the system inference part on the FPGA is 0.131 W, and the power consumption of the online training part is 0.365 W. For comparison, using the dynamic power consumption corresponding to the PS-side software execution method in Vivado Power Report as a reference power consumption, the power consumption of the FPGA-side hardware implementation method and the PS-side software execution method of this invention are compared. The power consumption of the inference module and the online training module is reduced by 95.37% and 87.10%, respectively. The above power consumption data are estimated power consumption obtained based on Vivado Power Report, used to illustrate the relative power consumption differences under different implementation methods. Meanwhile, the single inference latency was measured by the PS-side start / end timing function, with an average latency of 14.08 μs; the online training phase was set with 200 training iterations, and the online training of 1000 training samples took a total of 4.94 s. These results demonstrate that this system can achieve real-time inference and online training under low power consumption conditions, verifying its effectiveness and feasibility in edge deployment scenarios.
[0124] To evaluate the real-time control performance and online adaptive capability of the proposed system, this paper designs an experimental procedure consisting of four stages: calibration, evaluation, cooperative adaptation, and aftereffects.
[0125] During the calibration phase, subjects interacted with the system by controlling tasks using a real-time cursor, and online model updates were triggered after each round of tasks to promote model convergence and establish a stable human-computer control mapping. The subsequent evaluation phase assessed the converged model under undisturbed conditions to test the system's motion intent decoding performance.
[0126] In the co-adaptation phase, an electrode offset perturbation was introduced by laterally rotating the MYO armband by one electrode spacing. Subjects continued to complete a cursor control task to assess the model's online adaptability under perturbation conditions. Finally, the post-effect phase was conducted, consisting of four rounds: the first two rounds assessed control performance after perturbation removal, and the latter two rounds restored the armband to its calibration position to further examine the model's anti-forgetting ability.
[0127] Figure 6 This demonstrates the changes in cursor control performance at different experimental stages. Figure 7 The representative cursor motion trajectories for each stage are then presented. During the calibration phase, after one round of cooperative adaptive control, the task completion time significantly decreased, indicating that the model began to converge gradually. Figure 7 (a) and Figure 7 (b) further reflects this process: the initially unstable cursor trajectory gradually becomes more targeted, indicating that the system gradually learns the mapping relationship between surface electromyography signals and motor intention.
[0128] During the evaluation phase, the converged model achieved stable control performance under perturbation-free conditions, such as... Figure 7 As shown in (c), the task completion rate (CR) was 99.22 ± 2.21%, the task completion time (CT) was 1.39 ± 0.23 s, the path efficiency (PathEff) was 77.21 ± 4.11%, and the throughput (TP) was 0.507 ± 0.050 bit / s. After introducing the electrode shift perturbation, the previously converged model showed a significant trajectory shift, such as... Figure 7 As shown in (d), the change in signal distribution leads to a decrease in decoding accuracy.
[0129] In the subsequent cooperative adaptive phase, online updates gradually reduced the aforementioned trajectory deviation, such as... Figure 7 As shown in (e), this demonstrates the model's adaptive capability to disturbances. In the after-effect stage, the system maintains stable control performance after the disturbance is removed, as shown in [example data]. Figure 7As shown in (f), its task completion rate (CR) is 99.22 ± 2.21%, task completion time (CT) is 1.65 ± 0.60 s, path efficiency (PathEff) is 78.52 ± 4.80%, and throughput (TP) is 0.446 ± 0.073 bit / s.
[0130] Experiments conducted on six subjects verified that the surface electromyography signal end-side adaptive decoding system proposed in this invention can achieve stable motor intention recognition and real-time control, with a motor intention recognition accuracy of over 98%. Under interference conditions such as electrode position displacement, the system can quickly recover high recognition performance, indicating that this invention possesses good online adaptive capability, robustness, and long-term continuous control capability.
[0131] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.
Claims
1. A method for end-to-end adaptive decoding of surface electromyography (EMG) signals, characterized in that, Includes the following steps: S1: Acquire surface electromyographic signals of the wrist joint muscle group; S2: The collected surface electromyography signals are preprocessed and feature extracted to obtain multi-channel electromyography feature values; S3: The motion intention decoding model based on a multilayer perceptron deployed on a programmable logic device is used to infer the electromyographic feature values to obtain the motion intention prediction result, and the motion of the controlled object is controlled according to the motion intention prediction result; S4: Calculate the position deviation vector based on the current position coordinates of the controlled object and the preset target position coordinates, and generate a two-dimensional motion intention label based on the position deviation vector; construct training samples for the motion intention decoding model based on the electromyographic feature values and the two-dimensional motion intention label, and generate model training feedback based on the error between the motion intention prediction result and the two-dimensional motion intention label; S5: Using the training samples and the model training feedback, the motion intention decoding model is trained and its parameters are updated online on the programmable logic device side, and the updated motion intention decoding model is used for subsequent inference of the electromyographic feature values.
2. The adaptive decoding method for surface electromyography signals according to claim 1, characterized in that, The preprocessing and feature extraction described in S2 include: segmenting the surface electromyography signal using a sliding window, and calculating the root mean square value of the time window for each channel as the electromyography feature value of that channel.
3. The surface electromyography signal end-side adaptive decoding method according to claim 1, characterized in that, The motion intent decoding model is a multilayer perceptron, including an input layer, a hidden layer, and an output layer; the input layer is used to receive the electromyographic feature values, the hidden layer uses ReLU as the activation function, and the output layer outputs two-dimensional continuous motion velocity information.
4. The surface electromyography signal end-side adaptive decoding method according to claim 1, characterized in that, The generation of motion intent tags based on the current position of the controlled object and the preset target position, as described in S4, specifically includes: The user's intention direction is inferred in real time based on the current position of the controlled object and the preset target position. The user's intention direction is represented as a unit vector pointing from the current position to the target position. ; in: Indicates the current position; Indicates the target location; The muscle activation intensity of the surface electromyography signal is used to characterize the cursor's movement speed, and combined with the unit vector to generate continuous motion intention labels: ; in, Tags indicating the user's continuous movement intentions Let be the root mean square value of the i-th channel.
5. The surface electromyography signal end-side adaptive decoding method according to claim 1, characterized in that, In S5, backpropagation, gradient calculation, and model parameter update operations during model training are all deployed and executed in a programmable logic hardware unit; the triggering conditions for online training and parameter updates are: automatic triggering when the control precision is detected to be lower than a preset threshold, or manual triggering by the user.
6. The adaptive decoding method for surface electromyography signals according to claim 1, characterized in that: The weight parameters and bias parameters of the motion intent decoding model are subjected to fixed-point quantization processing, converting the 32-bit floating-point format weight parameters and bias parameters into a fixed-point format, which includes 3 integer bits and 7 decimal bits, in order to reduce the model's storage resource consumption and hardware computational complexity.
7. The adaptive decoding method for surface electromyography signals according to claim 1, characterized in that: The programmable logic device described in step S3 is equipped with a reconfigurable multiply-accumulate array; the reasoning process of the motion intent decoding model and the matrix multiplication operation in the online training process are both processed in parallel by performing block calculations on the weight matrix through the reconfigurable multiply-accumulate array. Furthermore, the programmable logic device employs an inter-layer pipelined parallel mechanism to decouple the computation process of each layer in the multilayer perceptron, and directly transmits data between layers through a data flow interface, enabling computational tasks at different layers to be executed in parallel in a pipelined manner.
8. The surface electromyography signal end-side adaptive decoding method according to claim 1, characterized in that: The programmable logic device is an FPGA, and the motion intent decoding model is deployed on the programmable logic side of the ZYNQ series FPGA; the training samples are stored in the off-chip storage medium of the edge device.
9. A surface electromyography (EMG) signal end-side adaptive decoding system, characterized in that, It includes a top-level controller, inference unit, backpropagation unit, and model update engine, among which, The top-level controller is deployed on the processor side of the system and is used to control the scheduling of inference tasks and the activation of model update tasks. The inference unit, backpropagation unit, and model update engine are all deployed on the FPGA programmable logic side. The inference unit is used to preprocess the surface electromyography signal and use the preprocessed data to infer the motion intention decoding model to obtain the motion intention prediction result. The backpropagation unit is used to compute the loss function, bias gradient, and weight gradient using the training set. The model update engine is used to update the model parameters based on the bias gradient and weight gradient.
10. The surface electromyography signal end-side adaptive decoding system according to claim 9, characterized in that: The interface between the processor and the FPGA programmable logic side adopts the AXI-Stream protocol and is equipped with a DMA-based double buffering mechanism to hide the waiting time for data transmission and data processing through ping-pong operation; the inference unit performs model inference in fixed-point format, and the backpropagation unit and the model update engine perform model parameter updates in floating-point format.
