Feasibility Analysis of sEMG Recognition via
Channel-Wise Transformer
Jiaxuan Zhang†∗ , Yuki Matsuda† , Manato Fujimoto‡ , Hirohiko Suwa† , and Keiichi Yasumoto†† Nara Institute of Science and Technology, Ikoma, Nara 630-0101, Japan‡ Osaka Metropolitan University, Osaka, Osaka 558-8585, Japan

Abstract—Surface Electromyography (sEMG) features asobjective biomarkers have the potential to facilitate a refined diagnosis, appropriate treatment/rehabilitation, andmeasurements of Human-Computer Interfaces (HCI). Precisely recognizing the informative features in EMG data isa staple challenge due to its massive, noise-involved, andnonstationary nature. In this paper, we build a channel-wisemethod assembling the recent powerful Transformer model
for recognizing muscle activation. The gesture classification
benchmark is demonstrated for proof-of-concept by introducing Ninapro sEMG datasets with the 17 gestures recorded
from 40 subjects. From experiment results, our proposed
method achieves a competitive overall accuracy of 85.6% byleveraging the sole channel-Transformer.

I. I NTRODUCTION
Studying neurophysiological processes is an important step toward understanding the control mechanism inhuman. Surface Electromyography (sEMG) as a major
skeletal muscle imaging tool, exhibits the activation of themuscle cells with millisecond resolution [1]. The sEMG
recognition is tough research typically, since the sEMG
data is temporal-random, redundant, and noise-involved
from the signal perspective [2]. Also, the spontaneous
characteristics recorded in signals are transient without any
pre-indicator [3]. Therefore, the above traits lead to thedemands of precise methodologies in sEMG recognition
for refining and distilling more important features.
Numerous studies make effort to yield reliable features
for machine-learning in various sEMG-based applications.
Conventionally, extraction of features is done by manually selecting/crafting features from the frequency ortime-frequency domain. However, manual processing islaborious and practitioners seldom consider the feature
extraction problem from a physiological viewpoint: thedifferent channel of sEMG detects the electric potential
generated by muscle cells when a specific muscle iselectrically or neurologically activated.
It has been demonstrated that combining with theautomatic feature extraction using deep neural network,
especially convolutional neural networks (CNNs) could
improve the feature mapping and the downstream task
performance [4]. Those works typically leveraged a set ofCNNs as filters to capture more informative local featuresfrom sEMG recordings and generate several channel-wisefeature maps. However, though the convolution operation
can express the channel connectivity of different muscle
signals, the local inductive bias of CNNs leads to the lossof global context. Different from the CNNs, the recurrent
neural networks (RNNs) pay attention to the information
This work was partly supported by JSPS KAKENHI JP21K19828.
* Corresponding author (e-mail: zhang.jiaxuan.ze4@is.naist.jp)

of global context by allowing sequential modeling ofdependency and transfer of temporal influence. However,while periodic components of sEMG can be captured byRNNs, other components such as transiently burst rhythms
activated by muscle cells are generally unpredictable.
Further, the inherently sequential attribute (time-invariant)of RNNs precludes the possibility of parallelization infeature capture.
Considering the parallel computation in finding thespecific activated muscle and the corresponding sensing
channel, this study introduces recent attention-mechanismbased model, i.e., the Transformer to sEMG recognition.
Specifically, we follow the most of existing sEMG-based
works to extract the time-frequency domain features torepresent each channel information of sEMG, and thenadopt the Transformer to importance of channels in parallel. For proof-of-concept, we experiment a proposal
with the gesture classification problem and the results arepromising comparing with the existing works.
II. M ETHOD
A. Dataset&Preprocessing
In this study, we evaluated the proposal on the second
Ninapro benchmark dataset (termed by DB2) [5] for
17 gesture recognition. The DB2 consists of 40 healthy
subjects while each subject collects the 12 channels sEMG
signal with the 2 kHz sample rate. A Butterworth bandpass(5-500 kHz) filter within 3-order is applied to each subject
signal. Then a 200 msec moving window with half overlapping is utilized for segmentation and sample generation
by referring to [2]. Hence, a total of 81,732 sEMG samples
are used in this work.
B. Time-Frequency Feature ExtractionWe adopt the dual-tree complex transformation, to eachraw data that transform the time-domain to time-frequency
domain signal. Then, a feature matrix is generated byfollowing six classical sEMG feature extraction methods
for each sample.
Mean absolute valueStandard deviation• Zero crossing

Average energy
Waveform length• Max fractal length

••

•

•

In summary, each row of the feature matrix illuminates
one channel feature vector of sample, and the initial feature
is denoted as x ∈ RC×F , where C denotes the channels(12) and F denotes the six classical features.P12

Position Embedding

Softmax

0.8

0.46

0.7

0.44
Transformer
EncoderGestureClassification

0.42

0.6

0.40

0.50.38

Transformer Model

0.3
040

12080
#Epoch1602000(a) Training loss

Fig. 1. Proposal overview

C. Channel-Wise Transformer
In this study, we assume the Transformer [6] is anappropriate candidate that can distill the important channel
for the precise classification of each gesture. Therefore,
we view each row (channel) of matrix x as one featurepatch (well-known embedding operation) for the inputof the Transformer where each patch is demonstrated byextracted six statistical features from the wavelet signal.
Then a patch-wise linear layer σ(·) expands the dimensionof each patch to a more informative space. An extra
class token xCls is inserted to each patch sequence at thebeginning and used for the final classification decision [7].
The above steps can be formulated as below:
xch = Concat(xCls , σ(x)),

0.4

0.36
0.34

6 features

0.90.48

P1 P2 P3

12 channel

12 channel

200ms sEMG
filtered by (5-500Hz) bandpass filter
WaveletFeaturetransform extraction

Linear Projection0.50(1)(12+1)×D

where xseq ∈ R
is the output sequence, whereD is the dimension of the linear layer output and we set
to 32, here.
The patches pass through the network architecture asshown in Fig. 1. The attention network associates theindividual patches and maps the relevance to the gesturelabel yi ,i ∈ R17 with three components: the query (Q),key (K), and value (V ) matrices, which are the projectedmatrices of the input Xch . Here, K is the same as Q, andthe attention is utilized to calculate relevance among thepatches. The resultant relevance values can be viewed asa weight-set and are further used to V .
QK T√·V(2)Attention = softmaxd√
where operator
d denotes a normalization. Whenthe input xch passes through the Transformer, theCrossEntropy is applied to calculate the loss between
xCls and yi and minimize the resultant error.
III. E XPERIMENT &R ESULT
Fig. 2 (a) exhibits that our method does not trap into
the overfitting issue due to the smooth convergence trend
during the training phase. The ablation studies in Fig. 2 (b)prove the effectiveness of the proposed method which analyzes the sEMG signals by paying attention to the specificmuscle activation. Table I presents a comparison of theoverall accuracy (5-fold cross validation) for our proposal
and two existing works. The proposed Transformer has abetter performance than the CNNs, even when we solely
extract six classical features. Comparing to the state-ofthe-art work [2], our proposal also got a competitive
accuracy (i.e., 85.6% which is comparable to 85.9% [2])without complicated CNNs filters. Such results prove the4012080#Epoch160200(b) Validation comparison

Fig. 2. (a) Training loss in channel-wise Transformer; (b) Accuracy indifferent ablation studies (time/frequency-wise Transformer comparingto ours)
TABLE IC OMPARISON OF PERFORMANCE AMONG TWO RELATED WORKS AND
OUR PIPELINES FOR DB2
MethodTBME, 2019 [1]TNSRE, 2021 [2]Our proposal

CNNs
CNNs + Temporal Attention
Channel-wise Attention

Subject

Accuracy

404040

83.7%
85.9%
85.6%

feasibility in solely modeling the channel information bythe Transformer model.
IV. C ONCLUSION
This paper presented a channel-wise Transformer model
for recognizing gestures from sEMG signals. We utilized
the time-frequency features to represent the channel ofsEMG, and introduced the attention-mechanism to distill the important channels. The superior results shed alight on how one should extract and recognize sEMG
features. Interesting future directions include investigating
the available application in more fundamental biomedicalproblems, such as the gait detection.
R EFERENCES[1] W. Wei, Q. Dai, Y. Wong, Y. Hu, M. Kankanhalli, and W. Geng,“Surface-electromyography-based gesture recognition by multi-view
deep learning,” IEEE Transactions on Biomedical Engineering,
vol. 66, no. 10, pp. 2964–2973, 2019.
[2] E. Rahimian, S. Zabihi, A. Asif, D. Farina, S. F. Atashzar, andA. Mohammadi, “Fs-hgr: Few-shot learning for hand gesture recognition via electromyography,” IEEE Transactions on Neural Systems
and Rehabilitation Engineering, vol. 29, pp. 1004–1015, 2021.
[3] Z. Chen, L. Zhu, Z. Yang, and R. Zhang, “Multi-tier platform forcognizing massive electroencephalogram,” in arXiv, 2022.
[4] Z. Chen, N. Ono, W. Chen, T. Tamura, M. Altaf-Ul-Amin,
S. Kanaya, and M. Huang, “The feasibility of predicting impending
malignant ventricular arrhythmias by using nonlinear features ofshort heartbeat intervals,” Computer Methods and Programs inBiomedicine, vol. 205, p. 106102, 2021.
[5] S. Pancholi, P. Jain, A. Varghese, and A. M. joshi, “A novel
time-domain based feature for emg-pr prosthetic and rehabilitation
application,” in 2019 41st Annual International Conference of theIEEE Engineering in Medicine and Biology Society (EMBC), 2019,pp. 5084–5087.
[6] Z. Chen, Z. Yang, D. Wang, M. Huang, N. Ono, M. Altaf-UlAmin, and S. Kanaya, “An end-to-end sleep staging simulator
based on mixed deep neural networks,” in 2021 IEEE International
Conference on Bioinformatics and Biomedicine (BIBM), 2021, pp.
848–853.
[7] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai,
T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly,
J. Uszkoreit, and N. Houlsby, “An image is worth 16x16 words:
Transformers for image recognition at scale,” in International Conference on Learning Representations, 2021.