Projects

EMG-based hand control

Reconstructing hand movements from muscle activity, including live control of a simulated hand with three EMG channels.

Real-time control of a simulated robotic hand using three channels of surface EMG.

I’m exploring continuous hand-movement decoding from surface electromyography (EMG), the electrical activity of muscles, including generalization across users and recording sessions.

Live control on Day 14

I used three channels from my NPG Lite at 500 Hz and recorded six two-minute blocks of hand movements alongside webcam video. I used MediaPipe to approximate hand-closure labels, and recorded separately for training, validation, and evaluation.

I then adapted the previous day’s 4.3M-parameter transformer to the new sensor, replacing its input layers and prediction head while retaining the pretrained transformer blocks. The new model takes three-channel EMG and predicts one continuous hand-closure command.

On two held-out recordings, it achieved a correlation of 0.75 and reduced closure MAE by about 38% compared with predicting the training average. It also beat an EMG-envelope ridge baseline. A fixed 4 Hz low-pass filter brought the correlation to 0.80 and made the output smoother. The pretrained model performed better on average than the same architecture trained from scratch, though this was only one seed and one electrode session.

After the offline checks, I connected the decoder to the live stream and recorded the demo above. The camera was used for training labels and comparison, while the simulated hand was controlled by EMG.

What it doesn’t show yet

This is coordinated opening and closing, so all five fingers move together. Independent finger control and reliable transfer after removing and reapplying the electrodes are still ahead. I’m also considering building a full prosthetic hand to take this into physical hardware.

Offline experiments

Separately, I’ve worked on predicting 20 hand joint angles from recorded EMG, using public emg2pose recordings and the EEG/EMG Foundation Challenge. For the challenge, I compared a causal transformer and a temporal convolutional network (TCN). The TCN tracked movement better and achieved lower validation error, including on the harder split with unseen users and movement conditions. Training on more users improved both models.

These are offline evaluations on recorded data, not live control, and a different task from the closure demo.

Target hand motion and the motion predicted from 16 channels of recorded EMG, for a familiar user in a new session. Not live control, and not the unseen-user evaluation described above.

Generative models

As an experimental direction, I explored generative models for decoding continuous hand trajectories from EMG. I trained an EMG-conditioned diffusion transformer, using flow matching, to generate continuous hand trajectories. The generated motion became smoother, but held-out users remained difficult, especially timing and amplitude. In this experiment, single-step estimates performed better than iterative sampling.

Smooth, plausible motion is not the same thing as accurate decoding.

Schematic animation with simulated data; no model training or inference is performed in it (labelled at the end of the clip).