Electronics 13 00454 v2
Electronics 13 00454 v2
Article
Hardware and Software Design and Implementation of
Surface-EMG-Based Gesture Recognition and Control System
Zhongpeng Zhang 1,2, * , Tuanjun Han 2 , Chaojun Huang 2 and Chunjiang Shuai 2
Abstract: The continuous advancement of electronic technology has led to the gradual integration of au-
tomated intelligent devices into various aspects of human life. Motion gesture-based human–computer
interaction systems offer abundant information, user-friendly functionalities, and visual cues. Sur-
face electromyography (sEMG) signals enable the decoding of muscle movements, facilitating the
realization of corresponding control functions. Considering the inherent instability and minuscule
nature of sEMG signals, this thesis proposes the integration of a dynamic time regularization algo-
rithm to enhance gesture recognition detection accuracy and real-time system performance. The
application of the dynamic time warping algorithm allows the fusion of three sEMG signals, enabling
for the calculation of similarity between the sample and the model. This process facilitates gesture
recognition and ensures effective communication between individuals and the 3D printed prosthesis.
Utilizing this algorithm, the best feature model was generated by amalgamating six types of gesture
classification model. A total of 600 training and evaluation experiments were performed, with each
movement recognized 100 times. The experimental tests demonstrate that the accuracy of gesture
recognition and prosthetic limb control using the temporal dynamic regularization algorithm achieves
an impressive 93.75%, surpassing the performance of the traditional threshold control switch.
Keywords: anthropomorphic prosthetic arm; dynamic time warping algorithm; feature extraction;
gesture recognition; surface electromyography signal
Citation: Zhang, Z.; Han, T.; Huang,
C.; Shuai, C. Hardware and Software
Design and Implementation of
Surface-EMG-Based Gesture
1. Introduction
Recognition and Control System.
Electronics 2024, 13, 454. https://
With the rapid development of artificial intelligence technology, the number of in-
doi.org/10.3390/electronics13020454
telligent machines and devices in people’s daily lives has gradually increased. Every
smart machine and device possesses the capability to perform various routine tasks and
Academic Editor: Manohar Das
offers multiple interaction methods, from industrial production to traditional fields such
Received: 22 November 2023 as military, medical, and service. It is anticipated that human–computer interactions will
Revised: 14 January 2024 become increasingly prevalent in the future. Unlike traditional human–computer com-
Accepted: 19 January 2024 munication methods, human–computer communication based on bioelectric signals can
Published: 22 January 2024 control external mechanical devices such as intelligent machines, robots, mice, airplanes,
and virtual animations. Therefore, the process of decoding human bioelectric signals to
discern their corresponding behavioral intentions has emerged as a prominent research
area within human–computer communication.
Copyright: © 2024 by the authors. Currently, three commonly used human bioelectric signals are electroencephalography
Licensee MDPI, Basel, Switzerland. (EEG), electromyography (EMG), and electroneurography (ENG) [1]. Among these, ENG
This article is an open access article
necessitates craniotomy and the subsequent implantation of corresponding sensors into
distributed under the terms and
the brain, constituting a complicated process that inflicts significant damage to the human
conditions of the Creative Commons
body. Moreover, the surgery and care associated with ENG require the expertise of medical
Attribution (CC BY) license (https://
professionals, making this acquisition method unsuitable for daily operational use. EEG,
creativecommons.org/licenses/by/
on the other hand, exhibits weak and unstable signal quality, rendering it susceptible to
4.0/).
ses. By employing DTW to align muscle signal patterns affected by varying force levels,
the researchers demonstrate enhanced classification accuracy and improved control per-
formance. Their findings provide valuable insights into mitigating the impact of force
variation, contributing to the development of more reliable and adaptable myoelectric
control systems.
In a different approach, Jabbari, Khushaba, and Nazarpour [12] propose a combined
dynamic time warping and spatiotemporal attention approach for myoelectric control. By
integrating these two techniques, the researchers aim to enhance the classification accuracy
and reliability of gesture recognition systems. Their study highlights the potential benefits
of incorporating attention mechanisms in myoelectric control, improving the ability to
identify and focus on relevant muscle signal patterns.
Therefore, this paper presents the development of an “active training” method, en-
abling patients with hand dysfunction to engage in more effective rehabilitation training
through the integration of anthropomorphic prosthetic hand technology. The proposed
method empowers patients to execute simple gestures by consciously controlling the pros-
thetic arm, thereby facilitating improved recovery outcomes. By harnessing sEMG signals
as control inputs for the mechanical prosthesis, this approach assists individuals with dis-
abilities in resolving fundamental daily life challenges and even offers them the potential
for basic work capabilities.
from the epidermis is usually around 1 kHz, this is used as a baseline when collecting
this information.
(3) The sEMG can be approximated as a Gaussian with zero mean value, exhibiting
symmetry, and it behaves as a white noise process composed of numerous sinusoids.
(4) sEMG represents a muscle voltage signal, where frequency and amplitude posi-
tively correlate with muscle tension, usually displaying a reliable linear relationship. This
signal offers valuable insights into muscle relaxation and contraction.
(5) Different muscle exercises result in distinguishable changes in time-domain,
frequency-domain eigenwaveforms, and amplitude-spectral-domain frequency characteris-
tic curves. Surprisingly, these changes demonstrate significant spectral similarity, indicating
certain regularities in EMG signal frequencies across muscle blocks, both within the same
type of exercise and across different exercises [14].
(6) The collection of EMG signals exhibits considerable variations as individuals’ age,
gender, and physical condition change. Even among similar individuals, harvesting results
Electronics 2024, 13, x FOR PEER REVIEW 4 of 19
may differ significantly due to variations in environmental factors, physical characteristics,
and muscle fatigue states.
Figure 1. Design
Figure 1. Design of
of anthropomorphic
anthropomorphic prosthetic
prosthetic arm.
arm. (a)
(a) Main
Main view
view of
of anthropomorphic
anthropomorphicprosthetic
pros-
arm; (b) The assembly of the servos for the anthropomorphic prosthetic
thetic arm; (b) The assembly of the servos for the anthropomorphic prostheticarm; arm;
(c) Design Sketch of
(c) Design
3D-printed components of the anthropomorphic prosthetic arm.
Sketch of 3D-printed components of the anthropomorphic prosthetic arm
The assembly of the servos for the prosthetic arm is illustrated in Figure 1b. This arm
incorporates a total of six digital servos, with one dedicated to controlling the wrist rota-
tion and the remaining five individually responsible for finger movements. The control
mechanism relies on servo rotation and traction wire ropes to enable finger bending and
straightening. The steel wire selected for this purpose boasts a maximum bearing capacity
Electronics 2024, 13, 454 5 of 17
As per the human physiology above, muscle movements need to be stimulated repeat-
edly to generate EMG signals since they are alternating electrical signals. The acquisition
of EMG signals is susceptible to external environmental and physiological influences, with
the natural thermal noise of the circuit being the most significant external factor. More-
over, the distribution of electromagnetic fields alters with human activities, impacting the
acquisition of EMG signals, particularly when the power supply frequency (industrial
frequency interference) is present. Therefore, the precise selection of acquisition equipment
is paramount for obtaining accurate EMG signals [15].
Currently, two types of EMG signal detection devices are available on the market:
invasive and non-invasive. Invasive devices typically use needle electrodes. The process
involves the precise placement of different electrodes at varying depths, necessitating the
expertise of a healthcare professional. Once inserted, the needle electrodes must be securely
fixed and not move freely, with continuous monitoring by medical personnel. On the
other hand, non-invasive devices utilize wet and dry electrodes for surface acquisition,
which can be employed multiple times. These non-invasive devices offer straightforward
operation and do not require professional supervision, making them more user-friendly.
During acquisition, the skin surface at the measuring location is cleaned and disinfected,
and then the non-invasive electrodes are applied to obtain the electromyographic signals.
This method outperforms needle electrodes, as it ensures a non-invasive, cost-effective,
repeatable, and user-friendly process. Since this approach captures muscle signals from the
skin’s surface without direct muscle contact, it is susceptible to interference from external
factors. Although needle electrodes are more accurate than dry electrodes in terms of signal
accuracy, dry electrodes are simpler and easier to use and have been able to surface the
signal acquisition needs of EMG-related studies.
This system primarily utilizes muscle signals from the arm muscles of the upper
limb. As different arm movements elicit distinct muscle responses, a direct correlation
exists between movement and muscle activity. To optimize the classification model, the
placement of the dry electrode armband must be determined based on the specific type
of movement requiring classification. It is essential to position the dry electrode armband
Electronics 2024, 13, x FOR PEER REVIEW
in the region with the strongest muscle activity to minimize error6 ofrates 19
and enhance
recognition accuracy. After conducting several experimental tests, it was concluded that a
three-electrode configuration for the armband yields the best results. The resulting sEMG
electrode configuration for the armband yields the best results. The resulting sEMG arm-
armband is depicted in Figure 2b.
band is depicted in Figure 2b.
Figure
Figure 2. System
2. System design
design implementation.
implementation.
Figure 3.
Figure Human display
3. Human displayof of
gesture diagrams.
gesture diagrams.
The complexity of raw sEMG signals can lead to significant errors if solely relied
upon for recognition [16]. To ensure accuracy in signal pattern recognition detection,
it is necessary to process and analyze the raw sEMG signals collected by these sensors.
The signal pre-processing section involves a signal amplification and filtering circuit, as
illustrated in Figure 4. The pre-processing circuit serves two essential purposes: firstly,
it amplifies the sEMG signal to the required voltage level (V) for subsequent A/D data
acquisition and signal processing; secondly, it enhances the signal filtering process to
effectively eliminate interference from industrial frequency signals, DC bias phenomena,
and extract the active signal. The main circuit amplification, combined with secondary
circuit amplification, achieves an overall amplification of approximately 1000 times. Motion
artifacts and electrical noise from the cable are eliminated using a fourth-order Butterworth
Figure 4. Hardware
high-pass filter (f = denoising andaamplification
10 Hz), while process
band-pass filter forHz,
(fL = 10 sEMG
fH = signals.
500 Hz) is employed
to remove high-frequency noise, such as electrode noise at the skin tissues. The industrial
After signal
frequency noise atpreprocessing, theeliminated
50 Hz is effectively crucial step is to extract
through the startAdditionally,
trap processing. and end points of
valid data. To ensure
the zero-regulator circuitreal-time functionality,
ensures system a combination
input and output of the threshold
balance, effectively comparis
reducing the
system’s zero deviation.
method and the moving average method (Figure 5) was chosen for improved monitor
of active regions. By employing a fixed sliding window in the moving average meth
the average energy of the current region was obtained, which offers a better understan
ing of its state. This allows for the segmentation of gesture movements from sEMG signa
facilitating the subsequent identification of valid gestures. When the muscle is not activ
engaged, the sEMG signal exhibits slight amplitude changes due to individual differen
in muscle fiber properties, resulting in minor fluctuations in energy. Conversely, dur
Electronics 2024, 13, 454 7 of 17
After
After signal preprocessing, the crucial step step is
is to
toextract
extractthethestart
startand
andendendpoints
pointsofofthe
the
valid
valid data.
data. To ensure real-time functionality,
functionality, aa combination
combinationof ofthe
thethreshold
thresholdcomparison
comparison
method
method and and the moving average
average method
method (Figure
(Figure5) 5)was
waschosen
chosenfor forimproved
improvedmonitoring
monitoring
of
of active
activeregions.
regions.By Byemploying
employingaafixed fixedsliding
slidingwindow
windowinin the
themoving
moving average
average method,
method, the
average energy of the current region was obtained, which offers
the average energy of the current region was obtained, which offers a better understand- a better understanding
of
ingitsofstate. This
its state. allows
This allowsforforthe
thesegmentation
segmentationof ofgesture
gesture movements
movements from fromsEMG
sEMGsignals,
signals,
facilitating
facilitating thethe subsequent identification of valid gestures. When the muscle is
valid gestures. When the muscle is not actively not actively
engaged,
engaged, the the sEMG signal exhibits
exhibits slight
slightamplitude
amplitudechanges
changesdue duetotoindividual
individualdifferences
differences
in
in muscle
muscle fiber
fiber properties, resulting
resulting in in minor
minorfluctuations
fluctuationsininenergy.
energy.Conversely,
Conversely,duringduring
effective
effective muscle actions, the the amplitude
amplitudechanges
changesin inthe
thesEMG
sEMGsignal
signalarearemore
morepronounced,
pronounced,
with
with significantly
significantly larger variations compared to
variations compared to the
the non-active
non-activestatestate[17].
[17].Leveraging
Leveragingthe the
energy method, effective action segments within different sEMG
energy method, effective action segments within different sEMG signals can be rapidly signals can be rapidly
identified,
identified, leading
leadingtotoenhanced
enhancedjudgment
judgmentaccuracy.
accuracy. TheThecombination
combination of sliding
of slidingaverage and
average
energy signal analysis allows for convenient, efficient, and swift signal
and energy signal analysis allows for convenient, efficient, and swift signal data segmen- data segmentation.
Electronics 2024, 13, x FOR PEER REVIEW
To facilitate
tation. the analysis
To facilitate of energyofsignals
the analysis energywith substantial
signals frequencyfrequency
with substantial gradient changes,8 of 19
gradient a
sliding
changes, window
a slidingsegmentation approach isapproach
window segmentation employed, enabling more
is employed, intuitive
enabling more analysis.
intuitive
analysis.
Figure
Figure 5. Schematic
Schematic diagram
diagram of
of moving
moving average method.
In myoelectric
In myoelectric pattern
pattern recognition
recognition algorithms,
algorithms, thethe extraction
extraction and
and identification
identification of
original myoelectric signal features represent
original myoelectric signal features represent the most the most crucial and essential processing
step throughout muscle feature pattern recognition technology. Currently,
throughout muscle feature pattern recognition technology. Currently, the main- the mainstream
application
stream of myoelectric
application signal feature
of myoelectric signalrecognition algorithmsalgorithms
feature recognition can be broadly
can categorized
be broadly
into three groups:
categorized time-domain
into three methods, frequency-domain
groups: time-domain methods, and time-frequency
methods, frequency-domain methods, and
domain methods
time-frequency [18]. Time-domain
domain features have features
methods [18]. Time-domain the advantage
have theofadvantage
direct andofreliable
direct
and reliable extraction from the original sEMG signal data, enabling straightforwardfrom
extraction from the original sEMG signal data, enabling straightforward extraction ex-
time series
traction fromdata
timesets without
series datanecessitating
sets without additional dataadditional
necessitating conversion or conversion
data processing byor
the system by
processing [19].
theHence,
systemthis
[19].method offers
Hence, this simplicity,
method offersease of system
simplicity, easedesign anddesign
of system imple-
mentation,
and as well as efficiency
implementation, as well asinefficiency
system calculation, resulting in resulting
in system calculation, a relatively
in light system
a relatively
workload. On the other hand, frequency domain feature data require Fourier
light system workload. On the other hand, frequency domain feature data require Fourier transform
transform calculations, which can lead to poorer real-time performance and less stable
data. Furthermore, due to the inherent abstraction of frequency domain features, adjust-
ments of time series parameters within specific ranges are often needed to obtain more
information. In such cases, time series features are preferred, and several common time
series features can be employed, such as root mean square, waveform width, average of
Electronics 2024, 13, 454 8 of 17
calculations, which can lead to poorer real-time performance and less stable data. Further-
more, due to the inherent abstraction of frequency domain features, adjustments of time
series parameters within specific ranges are often needed to obtain more information. In
such cases, time series features are preferred, and several common time series features can
be employed, such as root mean square, waveform width, average of certain integration
values, certain value generalization, time past zero crossing coefficient, slope sign variation,
and average amplitude rate of change. These features significantly simplify the processing
process and enhance the efficiency of various tasks. In this paper, mean amplitude variation,
the first burst of amplitude, mean absolute value, root mean square, and standard deviation
were used as feature extraction methods for comparative study.
Average amplitude change uses an averaged wavelength, and it can be formulated as
follows [20]:
1 N −1
N i∑
Average amplitude change = | x i +1 − x i | (1)
=1
For the amplitude of the first burst, the raw EMG signal was squared and then passed
through a moving average FIR filter with a Hamming window function. And the low fre-
quency components of the EMG signal are filtered and the maximum value of the first burst
is used as the feature. In this study, the Hamming open window function uses a window
size of 32 ms. A modified mean absolute value was used for comparison; the algorithm
uses the weighted window function donated by wi for MAV feature extraction [20]. MAV
feature calculated as follows [20]:
1
Mean absolute value = N1 ∑ wi | xi |;
i =1
( (2)
1, i f 0.25N ≤ i ≤ 0.75N
wi =
0.5, otherwise
Using the time-domain method, features can be efficiently extracted. The underlying
principle of this method is to vary the length and width of the window signal to obtain a
more accurate average energy measurement. Through analyzing complex sEMG signals,
features can be extracted more effectively, enabling a better understanding of their nature.
Figure 6a displays a set of raw sEMG data acquired during a specific “Like” gesture, while
Figure 6b illustrates the raw data plot after processing the data plot of the item (a) in
the legend with the feature extraction operation. The horizontal axis corresponds to the
sequence number after the window moves, and the scatter on the plot represents the
corresponding feature value at the end of the feature extraction operation. It is evident from
the analysis of Figure 6 that noticeable differences exist both in the trend of the changes
in eigenvalues and their actual magnitudes. Therefore, when extracting or processing the
eigen-signal data, a careful consideration of these changes is crucial for a more accurate
analysis of the original signal data. Extracting the features of the original signal simplifies
the computer’s analysis and the comparison of data features, facilitating the more effective
identification of the feature data.
Electronics 2024, 13,
Electronics 2024, 13, 454
x FOR PEER REVIEW 10 of
9 of1917
Figure
Figure 6.
6. Raw
Rawdata
dataand
andfeature
featureextraction result
extraction of of
result “Like” gesture.
“Like” (a) Raw
gesture. sEMG
(a) Raw datadata
sEMG of “Like”
of “Like”
Gesture; (b) Comparison
Comparison of
of five
five feature
feature extraction
extraction methods.
methods.
4. DTW
4. DTW Algorithm
Algorithm Implementation
Implementation
Dynamic Time
Dynamic Time Warping
Warping (DTW)(DTW) is is employed
employedto todetermine
determinethe thedifference
differencebetween
betweentwo two
time periods based on the nearest neighbor principle, thus enabling
time periods based on the nearest neighbor principle, thus enabling the better identifica- the better identifica-
tion of
tion of their
their commonalities
commonalities [21]. [21]. However,
However,due dueto to inherent
inherentdisparities
disparitiesbetween
betweenthe thetime
time
periods of the two languages, achieving a perfect match remains challenging [22,23]. InIn
periods of the two languages, achieving a perfect match remains challenging [22,23].
linguistic and
linguistic andacoustic
acoustictechnologies,
technologies, thethe storing
storing and and transmitting
transmitting of linguistic
of linguistic informa-
information
tioninfluenced
are are influenced by spatial
by spatial and temporal
and temporal variations,
variations, leading leading to differences
to differences in speech
in speech tones
and rhythms among individuals. For instance, changes in the tone and rhythm of speechof
tones and rhythms among individuals. For instance, changes in the tone and rhythm
speech
by by various
various speakersspeakers
result in result in variations
variations in tone and in tone
rhythmandduring
rhythm during
speech. speech. Fur-
Furthermore,
thermore, the speed and frequency of pronunciation may
the speed and frequency of pronunciation may differ between two phonemes within differ between two phonemes the
within the same word. In these intricate scenarios, traditional Euler
same word. In these intricate scenarios, traditional Euler distance tables do not consider distance tables do
not dynamic
the consider the dynamic
changes changes
in speed in speed
within within
the time the potentially
series, time series,leading
potentially leading to
to significant
significant
errors. errors.
The DTW
The DTW algorithm
algorithmfinds
findsextensive
extensiveapplication,
application,primarily
primarilyinintemplate
templatematching
matching[24].[24].
Initially, it was employed in speech recognition tasks, such as in language
Initially, it was employed in speech recognition tasks, such as in language learning soft- learning software,
to assess
ware, pronunciation
to assess accuracy.
pronunciation OverOver
accuracy. time, its utility
time, hashas
its utility extended
extended toto
include
includesensor
sen-
motion recognition, biological information matching, data mining,
sor motion recognition, biological information matching, data mining, information information retrieval,
re-
and various other domains.
trieval, and various other domains.
4.1. DTW Algorithm Implementation
4.1. DTW Algorithm Implementation
The signals collected in this experiment were discrete time series signals. For the dif-
The signals collected in this experiment were discrete time series signals. For the dif-
ferent actions performed by the subjects, the corresponding muscle action signal sequences
ferent actions performed by the subjects, the corresponding muscle action signal se-
do not differ much in terms of the intensity and frequency of the muscle movements
quences do not differ much in terms of the intensity and frequency of the muscle move-
and the temporal rhythm of the muscle actions. This signal characteristic ensures that it
ments
can be and the temporal
stabilized rhythm
within the of the muscle
time-frequency actions.
range This
of the signal
same typecharacteristic ensures
of muscle movement
that it can be stabilized within the time-frequency range of the same type of muscle
through strict control. The DTW algorithm can be used to achieve the direct identification move-
ment through strict control. The DTW algorithm can be used to achieve
and analysis of these discrete sEMG signal sequences in the human body, avoiding the the direct identi-
fication
problemand analysis
of failing to of these discrete
identify sEMG
the signal signal sequences
sequences due to the in the human body,
inconsistency of theavoid-
length
ing
andthe problem
intensity of failing
of the featuretosequences
identify the
at asignal sequences
certain stage, anddue to theimproving
greatly inconsistency of the
the overall
length and intensity of the feature sequences at a certain stage, and greatly improving the
Electronics 2024, 13, x FOR PEER REVIEW 11 of 19
Electronics 2024, 13, 454 overall accuracy of the recognition and detection of EMG signals [25,26]. Therefore, in this
10 of 17
study, the DTW algorithm is used to realize the automatic identification of feature se-
quences and generate accurate signal value sequences [26].
Let of
accuracy thethe
total numberand
recognition of action frames
detection in the
of EMG reference
signals [25,26]. template
Therefore, R bein denoted
this study,as M,
where
the DTWRialgorithm
= {r1, r2, ..., rm, ...,torM
is used }, andthe
realize each rm represents
automatic the action
identification feature
of feature vector ofand
sequences the mth
frame, with
generate eachsignal
accurate component being a three-dimensional
value sequences [26]. vector. Similarly, let the test tem-
plateLet thean
T be total number of action
N-dimensional vector frames in the reference
represented , t2, ..., tn,R...,betNdenoted
as Tj = {t1template }, whereas j =M,
1, 2, 3.
where R
It is worth
i = {r ,
noting r , ..., r
1 2 thatmwhileM, ..., r }, and each r represents the action feature
the lengths ofmM and N can vary, their dimension values must vector of the
th frame, with each component being a three-dimensional vector. Similarly, let the test
mremain consistent. To calculate the frame matching distance between the reference tem-
template
plate and T the
be an N-dimensional
test template for vector as Tj =we
representedvector,
each dimension t2 , ..., tn ,Equation
{t1 ,employ ..., tN }, where
(5). j = 1,
2, 3. It is worth noting that while the lengths of M and N can vary, their dimension values
must remain consistent. To calculate𝑑 𝑡the = |𝑡matching
, 𝑟 frame − 𝑟 |, 𝑖 = 1,2,3 between the reference
distance (5)
template and the test template for each dimension vector, we employ Equation (5).
Figure 7 depicts a two-dimensional Cartesian coordinate system, where the horizon-
tal axis N is the test sampledaxis and the vertical axis M is the reference sample axis. (5) The
i ( tn , rm ) = | tn − rm |, i = 1, 2, 3
integer coordinate points in the figure represent the intersection between the coordinates
of each reference
Figure 7 depicts sample and the coordinates
a two-dimensional Cartesianofcoordinate
the previous reference
system, where sample. The DTW
the horizontal
axis N is theuses
algorithm test sample axis and thegrid
these coordinate vertical axistoMfind
points is the reference
the optimalsample axis. The
and shortest integer
path for each
coordinate
completedpoints in theThis
operation. figure represent
path must be thechosen
intersection
from between
the bottom the left
coordinates
to the top of right
each cor-
reference sample
ner, because and can
there the coordinates
be no reversal of theofprevious
the order reference sample.
of actions The DTW
between the algorithm
trajectories of
uses
each action. The grid points along the path are in order: (t1, r1)...(tN, rM). completed
these coordinate grid points to find the optimal and shortest path for each To ensure that
operation.
each pointThisstayspath mustan
within beacceptable
chosen from the bottom
range, left magnitude
the slope to the top right corner, because
is constrained between
there can be no reversal of the order of actions between the trajectories of each action. The
0.5 and 2, and the set threshold is not exceeded for each point to reach the final (n, m)
grid points along the path are in order: (t1 , r1 )...(tN , rM ). To ensure that each point stays
position. The preceding point could only be (n − 1, m), (n − 1, m − 1), or (n − 1, m − 2). By
within an acceptable range, the slope magnitude is constrained between 0.5 and 2, and the
calculating
set threshold D isi(t
notN, rM), the shortest interval between the eigenvectors of each dimension can
exceeded for each point to reach the final (n, m) position. The preceding
be determined, as (n
expressed
− 1, m), (n in−Equation
1, m − 1),(6). Moreover,
− 1, m − this formula leadsD to (7), repre-
point could only be or (n 2). By calculating i (tN , rM ),
the shortest interval between the eigenvectors of each dimension can be determined, as in
senting the shortest interval DTW between the feature vectors of the third dimension
each dimension.
expressed in Equation (6). Moreover, this formula leads to (7), representing the shortest
interval DTW between the feature 𝐷 𝑡 ,of𝑟 the third
vectors 𝑑 𝑡dimension
, 𝑟 , 𝐷 𝑡 in each
, 𝑟 dimension.
𝐷 𝑡 ,𝑟 ( = 𝑚𝑖𝑛 ,𝑖
2𝑑 𝑡 , 𝑟 , 𝐷 𝑡 , 𝑟 𝑑 𝑡 ,𝑟
) (6)
Di (tn−1 , rm ) + di (tn , rm ), Di (tn−1 , rm−1 )+
Di (t N , r M ) = min = 1,2,3 , i = 1, 2, 3 (6)
2di (tn , rm ), Di (tn−1 , rm−2 ) + di (tn , rm )
𝐷 𝑡 ,𝑟 3
= 𝐷 𝑡 ,𝑟 (7)
D (t N , r M ) = ∑ Di2 (t N , r M ) (7)
i =1
Figure7.7.Schematic
Figure Schematicofof
search path
search method
path of DTW
method algorithm.
of DTW algorithm.
Electronics 2024, 13, 454 11 of 17
Utilizing the DTW algorithm, it is possible to locate and match the signals in the sEMG
signal sequence that are related to a specific action and obtain results that are very close
to the actual situation. In addition, the DTW algorithm can also reduce the accuracy error
caused by the inaccurate measurement angle because the dry electrode sensor surrounds
the upper arm to collect multi-dimensional information in this system.
Table 2. DTW distance between test action samples and the reference action samples.
From an analysis of Table 2, it is evident that the action distance for recognizing the
correct hand gestures is significantly smaller than the action distance for recognizing other
hand gestures, differing by at least an order of magnitude. This finding demonstrates a high
similarity in gesture information between individuals performing the same hand actions.
Consequently, a well-designed and produced hand gesture recognition template facili-
tates the accurate recognition of hand movement information across different individuals.
Moreover, this emphasizes the feasibility of utilizing the DTW algorithm for recognizing,
processing, and analyzing correct gesture signals derived from EMG signals.
The final recognition results are represented by the confusion matrix, and the corre-
sponding recognition rates are shown in Table 3. Each column in the confusion matrix
presents the predicted attribution category of the data, with the total instances in each col-
umn matching the total instances of all data in the predicted attribution category. Similarly,
each row in the matrix corresponds to the total number of instances of real hand movement
data in the respective hand category. The diagonal entries in the matrix indicate correct
hand recognition results for the specific gestures. From the analysis of the experimental
data, it is evident that the overall recognition rate for hand gestures remains high, reaching
approximately 93.752%. Moreover, individual action gestures exhibit excellent recognition
rates, particularly for the fist clenching and hand open postures, both achieving a perfect
100% recognition rate. However, the “OK” gesture’s recognition rate remains relatively
lower and is sometimes misidentified as a hand open gesture. Among the six gestures, the
fist clenching and hand open gestures demonstrate the most distinct characteristics.
Electronics 2024, 13, 454 14 of 17
By analyzing the initial movement templates of the six movements with the six test
movement templates that can be freely extracted, the DTW distance of each movement can
be calculated, in which the distance of the fist clenching is the largest and the distance of
the hand open is the smallest, and the order of the templates of these test movements is a
fist clenching, hand open, wrist turning left, wrist turning right, “OK” gesture, and “Like”
gesture. From the comparison of the test data, it can be seen more clearly that the DTW
movement distance deviation of all the original samples tested is minimized only when
their movement distances are all the same as their initial template movement distances [17].
This confirms the high feasibility of using the DTW algorithm to directly analyze the EMG
signal movement distances for muscle action recognition, which is fully capable of realizing
the rapid and automatic recognition calculation and the fast and accurate judgment of any
two muscle actions that are the same or similar to each other, and improves the accuracy of
muscle action recognition and judgment results by making templates. The
Electronics 2024, 13, x FOR PEER REVIEW 16 of test
19 results are
shown in Figure 10.
Figure 10.
Figure 10.Test
Testresults of prosthetic
results arm control
of prosthetic based on
arm control gesture
based onrecognition.
gesture recognition.
5.3. Prosthetic Arm Control Experiment
This experiment only involves the acquisition of human surface EMG and adopts the
design of dry electrodes, so the instruments and equipment used will not cause any harm
to the human body. The design and implementation of the experiment were approved by
the Ethics Committee and all ethical materials were available. The experiment did not in-
Electronics 2024, 13, 454 15 of 17
To ensure the validity of the experiment, it is crucial to conduct the tests under normal
conditions and certain preparations must be made beforehand:
(1) Before the test, participants should refrain from engaging in high-intensity train-
ing, such as running or working out, to keep the muscles in the testing area in a re-
laxed state without fatigue. Muscle fatigue could adversely affect the accuracy of the
collected signals.
(2) The surface skin of the muscle to be detected should be sterilized and cleaned
before the test. A standardized cleaning method is employed for all participants to maintain
uniformity in the collected data. Alcohol would be used for removing scurf and sebum and
to cleanse the muscle surface at the beginning of the experiment. This procedure ensures
better contact between the dry electrode armband and the skin, leading to more accurate
muscle data measurements.
(3) Consistency in electrode placement is crucial when using the dry electrode armband.
All electrodes used in the test should be positioned in the exact location on the same arm of
each participant to ensure the measurement data’s uniformity and consistency.
Model validation was conducted in accordance with the specified test requirements.
The experiment involved comparing hand movements to robot movements to assess
recognition accuracy. Successful recognition was determined when the robot’s movements
matched the corresponding hand movements, while a mismatch indicated failure. A total
of 600 experiments were performed, with each movement recognized 100 times. From the
statistical analysis presented in Table 5, it is evident that the clenched-fist and spreading-fist
gestures achieved a remarkable recognition accuracy of 96%, outperforming other hand
gestures. The remaining hand gestures also demonstrated satisfactory recognition rates,
averaging 90%. The higher recognition rates for fist shake and fist spread gestures can
be attributed to the enhanced responsiveness of the selected test muscle regions to these
specific gestures compared to the other movements [19]. Comparing the results of other
studies, Ding et al. [28] used a CNN method for gesture recognition with an average
recognition rate of 78.86%, another scholar used a method based on CNN-LSTM for gesture
recognition with an average recognition rate of 87%, and Huang et al. [29] used an improved
deep forest method for their gesture recognition test with an average recognition accuracy
of 94.14%. There is still room for further enhancement and optimization of the method
proposed in this study.
Electronics 2024, 13, 454 16 of 17
6. Conclusions
This paper presents the design and implementation of an sEMG gesture recognition
and control system based on the DTW algorithm. The DTW algorithm has been implied to
realize the online recognition of gestures based on sEMG signals. With the DTW algorithm,
the most matching time series points can be filtered and averaged from the movement
samples to obtain an initial template for each practiced movement. This method can help
to better reference and compare different gestures, thus improving the training effect more
effectively. And according to the classification results, the six servos of the prosthetic arm
would be able to complete the gesture action through PWM. The 3D-printed anthropo-
morphic prosthetic arm is relatively lightweight and easy to use for disabled patients. The
demonstrated system has been proven to be a more robust and advanced sEMG gesture
recognition and control system, with potential applications in various fields such as reha-
bilitation, assistive technology, and robotics. The overall results are satisfactory, but further
improvements are needed to enhance the recognition rate of EMG signals and achieve
better generalization for the prosthetic arm.
Author Contributions: Conceptualization, Z.Z. and T.H.; Methodology, C.H.; Software, Z.Z. and
T.H.; Validation, T.H., C.H. and C.S.; Formal analysis, C.H.; Investigation, Z.Z. and C.S.; Resources,
T.H. and C.H.; Writing—original draft, Z.Z., T.H. and C.S.; Writing—review & editing, Z.Z., T.H. and
C.H.; Visualization, C.S.; Supervision, C.H. and C.S.; Funding acquisition, Z.Z. All authors have read
and agreed to the published version of the manuscript.
Funding: Funding was provided by the Key Research and Development Program Projects of Shaanxi
Province (Grant: 2023-YBSF-397 and the PhD Startup Fund of Shaanxi University of Technology
(Grant: SLGQD2017-06).
Data Availability Statement: The datasets used and/or analyzed during the current study are
available from the corresponding author on reasonable request.
Conflicts of Interest: The authors declare no conflicts of interest.
References
1. Li, K.; Zhang, J.; Wang, L.; Zhang, M.; Li, J.; Bao, S. A review of the key technologies for sEMG-based human-robot interaction
systems. Biomed. Signal Process. Control 2020, 62, 102074. [CrossRef]
2. Wu, J.; Li, X.; Liu, W.; Wang, Z.J. sEMG signal processing methods: A review. J. Phys. Conf. Ser. 2019, 1237, 32008. [CrossRef]
3. Shi, X.; Qin, P.; Zhu, J.; Zhai, M.; Shi, W. Feature extraction and classification of lower limb motion based on sEMG signals. IEEE
Access 2020, 8, 132882–132892. [CrossRef]
4. Marinelli, A.; Boccardo, N.; Tessari, F.; Di Domenico, D.; Caserta, G.; Canepa, M.; Gini, G.; Barresi, G.; Laffranchi, M.; De Michieli,
L.; et al. Active upper limb prostheses: A review on current state and upcoming breakthroughs. Prog. Biomed. Eng. 2023, 5,
012001. [CrossRef]
5. Tchantchane, R.; Zhou, H.; Zhang, S.; Alici, G. A review of hand gesture recognition systems based on noninvasive wearable
sensors. Adv. Intell. Syst. 2023, 5, 2300207. [CrossRef]
Electronics 2024, 13, 454 17 of 17
6. Chen, Z.; Min, H.; Wang, D.; Xia, Z.; Sun, F.; Fang, B. A Review of Myoelectric Control for Prosthetic Hand Manipulation.
Biomimetics 2023, 8, 328. [CrossRef]
7. Narayan, Y. Comparative analysis of SVM and Naive Bayes classifier for the SEMG signal classification. Mater. Today Proc. 2021,
37, 3241–3245. [CrossRef]
8. Vijayvargiya, A.; Singh, B.; Kumar, R.; Tavares, J.M.R.S. Human lower limb activity recognition techniques, databases, challenges
and its applications using sEMG signal: An overview. Biomed. Eng. Lett. 2022, 12, 343–358. [CrossRef]
9. Große Sundrup, J.; Mombaur, K. On the Distribution of Muscle Signals: A Method for Distance-Based Classification of Human
Gestures. Sensors 2023, 23, 7441. [CrossRef]
10. Powar, O.S.; Chemmangat, K. Reducing the effect of wrist variation on pattern recognition of Myoelectric Hand Prostheses
Control through Dynamic Time Warping. Biomed. Signal Process. Control 2020, 55, 101626. [CrossRef]
11. Powar, O.S.; Chemmangat, K. Dynamic time warping for reducing the effect of force variation on myoelectric control of hand
prostheses. J. Electromyogr. Kinesiol. 2019, 48, 152–160. [CrossRef] [PubMed]
12. Jabbari, M.; Khushaba, R.N.; Nazarpour, K. Combined Dynamic Time Warping and Spatiotemporal Attention for Myoelectric
Control. In Proceedings of the 2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society
(EMBC), Virtual, 1–5 November 2021; pp. 5940–5943. [CrossRef]
13. Sun, Y.; Li, C.; Li, G.; Jiang, G.; Jiang, D.; Liu, H.; Zheng, Z.; Shu, W. Gesture recognition based on kinect and sEMG signal fusion.
Mob. Netw. Appl. 2018, 23, 797–805. [CrossRef]
14. Venugopal, G.; Navaneethakrishna, M.; Ramakrishnan, S. Extraction and analysis of multiple time window features associated
with muscle fatigue conditions using sEMG signals. Expert Syst. Appl. 2014, 41, 2652–2659. [CrossRef]
15. Belter, J.T.; Segil, J.L.; SM, B.S. Mechanical design and performance specifications of anthropomorphic prosthetic hands: A review.
J. Rehabil. Res. Dev. 2013, 50, 599. [CrossRef] [PubMed]
16. Zheng, K.; Liu, S.; Yang, J.; Al-Selwi, M.; Li, J. sEMG-Based Continuous Hand Action Prediction by Using Key State Transition
and Model Pruning. Sensors 2022, 22, 9949. [CrossRef] [PubMed]
17. Meattini, R.; Bernardini, A.; Palli, G.; Melchiorri, C. sEMG-Based Minimally Supervised Regression Using Soft-DTW Neural
Networks for Robot Hand Grasping Control. IEEE Robot. Autom. Lett. 2022, 7, 10144–10151. [CrossRef]
18. Ai, Q.; Zhang, Y.; Qi, W.; Liu, Q.; Chen, K. Research on lower limb motion recognition based on fusion of sEMG and accelerometer
signals. Symmetry 2017, 9, 147. [CrossRef]
19. Tosin, M.C.; Machado, J.C.; Balbinot, A. SEMG-based upper limb movement classifier: Current scenario and upcoming challenges.
J. Artif. Intell. Res. 2022, 75, 83–127. [CrossRef]
20. Phinyomark, A.; Phukpattaranont, P.; Limsakul, C. Feature reduction and selection for EMG signal classification. Expert Syst.
Appl. 2012, 39, 7420–7431. [CrossRef]
21. Shokoohi-Yekta, M.; Hu, B.; Jin, H.; Wang, J.; Keogh, E. Generalizing DTW to the multi-dimensional case requires an adaptive
approach. Data Min. Knowl. Discov. 2017, 31, 1–31. [CrossRef]
22. Yadav, M.; Alam, M.A. Dynamic time warping (dtw) algorithm in speech: A review. Int. J. Res. Electron. Comput. Eng. 2018, 6,
524–528.
23. Cuturi, M.; Blondel, M. Soft-DTW: A differentiable loss function for time-series. PMLR 2017, 70, 894–903.
24. Cai, S.; Lu, Z.; Chen, B.; Guo, L.; Qing, Z.; Yao, L. Dynamic gesture recognition of A-mode ultrasonic based on the DTW algorithm.
IEEE Sens. J. 2022, 22, 17924–17931. [CrossRef]
25. Zhang, H.; Yang, K.; Cao, G.; Xia, C. ViT-LLMR: Vision Transformer-based lower limb motion recognition from fusion signals of
MMG and IMU. Biomed. Signal Process. Control 2023, 82, 104508. [CrossRef]
26. Shen, C.; Ning, X.; Zhu, Q.; Miao, S.; Lv, H. Application and comparison of deep learning approaches for upper limb functionality
evaluation based on multi-modal inertial data. Sustain. Comput. Inform. Syst. 2022, 33, 100624. [CrossRef]
27. Lu, Y.; Wang, H.; Zhou, B.; Wei, C.; Xu, S. Continuous and simultaneous estimation of lower limb multi-joint angles from sEMG
signals based on stacked convolutional and LSTM models. Expert Syst. Appl. 2022, 203, 117340. [CrossRef]
28. Ding, Z.; Yang, C.; Tian, Z.; Yi, C.; Fu, Y.; Jiang, F. sEMG-based gesture recognition with convolution neural networks. Sustainability
2018, 10, 1865. [CrossRef]
29. Huang, S.; Mao, J. Recognition method of sEMG gesture based on improved deep forest. J. Shanghai Univ. Eng. Sci. 2023, 37,
190–197.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.