Predicting Keystrokes from Electromyography Signals

Peike Li, Wenxuan Karen Li, Debajyoti Chakrabarti, Qizhao Chen

ECE C247A Course Research Project · Winter 2026
EMG Sequence Modeling LSTM Transformers CTC PyTorch

Overview

Surface electromyography (sEMG) contains muscle-activity signals that can be used to infer typed keystrokes without a physical keyboard. We studied neural sequence models for decoding keystroke sequences from multichannel EMG recordings, focusing on architectures that can capture temporal dependencies in noisy high-dimensional signals.

We compared a CNN baseline with LSTM and Transformer-based models and then studied how performance changes with training-data availability, electrode density, data augmentation, and temporal sampling rate.

Sequence Models for EMG Decoding

LSTM:

Transformer:

Model Performance

Bar chart comparing test character error rate: 23.21% for the CNN baseline versus 12.06% for the LSTM model.
Test character error rate across evaluated model architectures. Lower is better.
Method Test CER (%)
Baseline (CNN) 23.21
LSTM (RNN) 12.06
Transformer (no downsampling) 38.08
Transformer-only 100.00
TDSConv + Transformer 30.69

Under this dataset and training setup, the LSTM generalized best. This does not imply that Transformer architectures are generally worse for EMG decoding — only that, among the configurations tested here, the LSTM achieved the lowest test CER.

What Affected Decoding Performance?

Four-panel figure: model comparison, test CER vs. training-data size, vs. number of channels, and vs. sampling rate.
Evaluation of the LSTM-based model under different experimental settings.

Training Behavior

Training and validation CER curves across the evaluated architectures.
Training and validation CER across the evaluated architectures.

The LSTM showed the strongest validation behavior and the smallest generalization gap among the tested sequence models.

Key Takeaway

Temporal structure mattered more than model complexity: under this dataset and training setup, the LSTM substantially outperformed the CNN baseline and the tested Transformer variants.

  • LSTM reduced CER from 23.21% to 12.06%
  • CTC enabled sequence-level keystroke decoding
  • Performance depended strongly on training-data availability
  • Moderate sensor reduction remained viable
  • Sampling rate and augmentation had non-trivial effects on generalization