6.ref
6.ref
Abstract—Nowadays, the focus is on portable, non-invasive The most common method of recording signals for
devices with a variety of functions, such as continuous monitoring muscle contractions is electromyography, a
monitoring through smartwatches or biologic signal-controlled diagnostic test that evaluates the condition and function of the
prosthetic limb control. The signal acquisition and processing motor and sensory neurons that control the muscles. A muscle
steps are the underlying principles behind all of these at rest typically has no electrical activity. Electrical activity is
applications. This study proposes a low-budget Arduino-based generated by just a small muscular contraction, and this activity
acquisition system for recording forearm surface increases with greater muscle contraction force. To generate
electromyography signals, which are then analyzed using Matlab
high-quality EMG signals, electrode selection is also essential.
software. The signals are recorded from four right-handed
Electrodes are available in two different forms: surface
healthy individuals, following an established protocol consisting
of ten 30-second recordings per hand, with movements that
electrodes that record surface EMG signals and intramuscular
alternate between five seconds of contraction and five seconds of electrodes like needles [3],[4]. The surface electrodes will be
relaxation. The classification results are then achieved by utilized to record the surface electromyography (sEMG) since
processing the data using the Support Vector Machine algorithm the intramuscular electrodes are invasive.
and GridSearch. There are four experiments conducted. The first Numerous disorders can affect the muscular system,
one distinguishes between contraction and relaxation, then three starting with the mildest (muscular fatigue) to the most severe
additional experiments are performed following the same
(several myopathies). Muscle cramps, or painful contractions,
procedure (discriminations between gender, hand, gender and
may occur in exhausted muscles frequently. After a time of
hand). Subsequently, a graphical user interface is designed to
display the uploaded signal together with some details about the inactivity, practicing an intense physical effort leads to
patients, the experiment, and the classification outcomes. The delayed-onset muscle soreness, which means strong, persistent
results achieved with the Arduino microcontroller are confirmed pains at the level of the muscle groups. Resuming the same
by performing the same steps using the Biopac system and type of effort leads to its reduction. By increasing physical
comparing the outcomes in terms of metrics. activity, it might be possible to prevent the earliest signs of
fatigue and the loss of muscular strength. Therefore, to prevent
Keywords-EMG signals; Muscular contraction; Arduino signal muscular strains or ruptures, periods of intense workouts must
recording, Matlab signal processing. be alternated with rest periods that restore the capacity for
effort. A muscle may expand or tear because of excessive
I. INTRODUCTION contraction, as well as the adjacent connective tissue [1],[5].
The active organs of movement that generate force or Currently, the focus is on portable, non-invasive devices
movement in response to a physiological stimulus are the with various purposes: using various artisanal methods, such as
muscles that make up the muscular system. A muscle is smartwatches, Arduino, Biopac, etc., to control prosthetic
composed of interconnected muscular fibers that contract to limbs (as described in [6]), monitor effort through muscle
produce force. Skeletal, smooth, and cardiac muscle are the contraction and relaxation, and continuously monitor patients
three forms of muscle that are adapted to specific functions. with various pathologies. These techniques exclusively record
About 40% of the body's mass consists of skeletal muscles, sEMG signals. Articles [7], [8], and [9] propose different
which are responsible for voluntary bone movements. These approaches to processing EMG signals and classifying
motions provide the basis for both mechanical work and different hand postures using Arduino Uno or Arduino Mega
locomotion [1],[2]. They include the skeletal muscles of the and a MyoWare sensor. Papers [10], [11], and [12] aim to build
upper limb; electrodes will be placed on the anterior forearm to a prototype hand posture recognition system for bionic hand
record electromyographic (EMG) signals, where the forearm control by analyzing the recorded sEMG signals and also using
and hand flexors, pronators of the hand, and finger flexors are different Arduino boards and EMG sensors, such as the EMG
located, as will be described later. Gravity Sensor or Muscle Sensor Toolkit.
177
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.
After a review of the most popular approaches, the decision
was made to split the work into three sections, as will be
further described.
178
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.
The three-electrode sensor is placed parallel to the muscle classification algorithm and GridSearch. The other three
fibers inside the forearm, along the muscle, to record the experiments are performed after the first discrimination
sEMG signals. Before replacing the sensor, the new area of between contraction and relaxation, following the same steps.
skin is cleaned with sanitary alcohol. As previously mentioned, the SEN0240 sensor includes two
circuits built into the board: filtering and amplification;
As illustrated in Fig. 3a, each subject performs thirty-
therefore, the pre-processing step is no longer necessary.
second sets of movements, alternating between five seconds of
contraction and five seconds of relaxation, resulting in three Epoch Segmentation. EMG signals are divided into epochs,
contraction and three relaxation sections. Both the relaxation or time frames of fixed duration, according to sets of
and the contraction should be recorded because a prolonged movements and to the number of samples, as they cannot be
contraction could lead to muscle pain. Furthermore, by segmented into short, known physiological units. The signal is
alternating the states, the contractions do not decrease in divided into epochs of five seconds duration (1215 samples),
amplitude. Ten recordings are performed for each hand, from alternating between contraction and relaxation based on the
both hands, for all the subjects, resulting in a total of eighty acquisition methodology. Therefore, each signal is divided
records. Both hands were recorded, not just the dominant into six epochs.
hand, since it would be necessary to employ a myoelectrically
Feature extraction. Then, fourteen features are extracted
controlled prosthesis in the event that one hand is amputated.
from every epoch, with each outcome stored in a separate
Signal processing and recording. The Arduino board is vector. Selecting the right features is essential since different
connected to the computer via the USB connector once the features perform well with different kinds of signals. The
sensor has been placed on the subject and the previously following fourteen features have been chosen based on the
specified connections have been made. The Arduino IDE literature:
program is used at this point. After the signal has been filtered
and amplified, it can be observed that the signal is almost MAV (Mean Absolute Value): the average of the
continuous, with appropriate values of zero when the hand is amplitudes' absolute values
relaxed and increases in amplitude when the muscle contracts WL (Waveform Length): the waveform's total length
(Fig. 3b). throughout time
SSC (Slope Sign Change): the number of times the sign of
a. the signal slope changes
VAR (Variance): measure of dispersion
DAMV (Difference Absolute Mean Value): mean absolute
difference of two independent and identically distributed
b. values
MAD (Mean Absolute Deviation): the average distance
between each data point and the mean
MFL (Maximum Fractal Length): measure of contraction
strength
WA (Willison Amplitude): the number of changes in
signal amplitude that exceeds a predefined threshold
COV (Coefficient of Variation): the relative dispersion of
the data
KURT (Kurtosis): the degree of flattening or sharpening
Figure 3. Acquisition protocol (a) and the corresponding signal (b). of a distribution
SKEW (Skewness): the deviation of the empirical
Signal transmission. Once the code has executed, the Arduino
distribution in relation to a symmetrical distribution
IDE software is closed and the Data Streamer toolbox from the
around the mean
Excel program is opened in order to transfer the
microcontroller data to Excel. In order to give the signal SD (Standard Deviation): the dispersion from the mean of
enough time to stabilize, the thirty-second recording begins a the values of a set
few seconds after the data loads. The data is automatically RMS (Root Mean Square): the square root of the
saved to a new .csv file when the recording ends. To process arithmetic mean of the squares of the values
the signals further, they are later imported into Matlab. ZC (Zero Crossing): the number of times the signal
changes its sign, passing through 0.
B. Signal processing and recording
Epoch Labeling. After the extraction of each of the
The signal processing phase consists of multiple steps: aforementioned features as independent vectors, a matrix is
transforming the files from .csv to vectors, dividing the signals generated by concatenating all of these vectors, where each
into five-second epochs, and extracting features. The best line represents a feature and each column an epoch. A starting
results are obtained by labeling each epoch properly and line is added to this matrix, denoting the epochs: 0 represents
feeding the union of the prior features into the SVM
179
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.
relaxation and 1 represents contraction. Lastly, a 15 × 480 III. RESULTS
matrix (one line of labels and fourteen features and four A. Classification Results
patients, two hands, ten records and six epochs) will serve as
the classifier's input. The contraction and relaxation epochs are After the signals have been acquired using the previously
displayed in Fig. 4a. For the rest of the experiments, the mentioned procedure, fourteen specific features are extracted
contraction epochs will be labeled again, depending on the from each epoch. The MAV and ZC values for a few random
type of classification being performed. epochs of contraction versus relaxation are displayed in Fig. 5.
As a measure that computes the mean of the amplitudes'
Classification. After the extraction of all fourteen features, the absolute values (MAV) and the number of times the signal
values are normalized within the interval [0, 1]. Because each changes its sign (ZC) [10], contraction epochs have higher
individual and hand has a unique kind of contraction and values than those with relaxation.
relaxation, the values for the classification of relaxation vs.
contraction are normalized individually for each signal, and
for the rest of the classifications, the values are all normalized
at the end (because all contractions are normalized in relation
to others, according to gender and hand).
The epochs are randomly split into 80% training and 20%
testing data for classification, with the same number of epochs
in each set. As will be described later, 16% of the 80% training
set will be used for validation in turn (Fig. 4b).
a. b. Figure 5. MAV and ZC values for contraction and relaxation epochs.
C. Graphical Interface E0: Relaxation epochs were fully classified correctly, and
A Matlab Graphical User Interface (GUI) is designed and after feature selection, contraction epochs were also classified
developed in order to show the results in a user-friendly at 100%.
manner. The interface's purpose is to display a randomly E1: It results in the right-hand class having weaker detections
uploaded signal along with information about the subjects, the than the left-hand class, taking into account that the right hand
experiment, and the classification result on two main pages, is the dominant hand in all subjects. Female participant left-
one for binary relaxation vs. contraction classification and the hand signals have the weakest contractions, which makes them
other for multiclass classification. These panels appear when easier to differentiate. However, since the strength of a male
certain buttons are pushed. subject should be higher than that of a female subject, the
180
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.
discrimination between a female right-hand and a male left- drawback of using this function, it would be effective to
hand contraction may be slightly inaccurate, leading to generalize an ideal approach.
misclassifications. Muscle fatigue also occurs after a specific
A GUI called App_EMG is developed and implemented in
amount of repetition of the contraction-relaxation series, and it
Matlab that displays the outcomes. Two primary tabs are
is characterized by a decrease in contraction strength. In
created, one for E1 and the other for E4 (Fig. 7), since E4
subjects who do not regularly participate in sports or in non-
combines E2 and E3 into a more complex multiclass
dominant hands, this occurs quicker.
classification.
E2: Compared to the female gender class, the male gender
class had poorer detections. This might be due to the fact that,
typically, a male subject's force is greater than a female
subject's, causing discrimination between a female right-
handed and a male left-handed contraction to be slightly
inaccurate. However, female subjects' left-hand signals show
the weakest contractions, which makes them easier to
separate, while some of their right-hand signals might show
contractions that are nearly as powerful as those of male
participants. In addition to the differences in the subjects,
particularly the variation in strength, there could also be
another contributing factor: muscle fatigue, which would
lessen the force of the contractions.
E3: As it can be seen, the male gender, right hand class
achieves the best results since male participant right-handed
signals show the highest strength of contraction. Due to the
fact that these epochs can be easily mistaken for another class,
such as female gender, right hand, the male gender, left hand
class achieves the lowest results.
In addition to the outcomes obtained from the
classification, several additional factors additionally influence
these results. Normalizing the data is an essential step,
whereby the data is normalized within the interval [0, 1]
before the classification process. The proper timing of data
normalization is critical for achieving optimal results. For E0,
the values are normalized individually for each signal after Figure 7. App_EMG tabs.
features are extracted from it because each subject and each
hand have a typical kind of contraction and relaxation. For all B. Comparison
other experiments, the values are normalized at the end after The same acquisition procedure is performed using the
all features from all signals are extracted, since all Biopac system in order to validate the results, and the
contractions need to be normalized relative to each other by outcomes for each experiment are compared in terms of
gender and hand. accuracy. The signals are recorded from the same subjects,
The number of balanced epochs in each class is another and the same features are kept. However, the Biopac system
significant factor. An asymmetric distribution increases the uses three disposable electrodes, which are also placed on the
likelihood that the majority class will obtain higher results. forearm but in a different configuration. Other differences
The splitting into training and testing sets is directly tied to between these two systems are detailed in Table III.
this aspect of balanced sets. In this work, an 80%-20% split
TABLE III. COMPARISON BETWEEN ARDUINO AND BIOPAC RESULTS
ratio was selected, choosing more training data since the
database's overall size is not particularly large (it has been Arduino Biopac
reduced by half in the experiments E1, E2, and E3). Reusable electrodes Disposable electrodes
Default 150 Hz sampling frequency Default 2000 Hz sampling frequency
SVM is a common classification algorithm in medical Low-cost system High-cost system
signal processing, but its main benefit comes from the Portable device Depends on the biopac module
GridSearch function, a cross-validation model that helps select Possibility of programming Standard functions
Online processing Offline processing
the best hyperparameters by automatically determining the Compatible with different softwares Only works with Acqknowledge
pair of parameters that generates the best results.
Consequently, the optimal hyperparameter pairings differed The overall accuracy of each experiment is computed to
for every experiment. Since the runtime increase is the main determine whether the results are comparable to those from a
professional device. Similar results can be observed in Fig. 8.
181
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.
Both systems achieved 100% accuracy in discriminating software resources, all of the proposed experiments could be
between the two classes for E0 and the same accuracy for E1. performed efficiently. Finally, the results show good
Biopac's outcomes are better for E2, but poorer for E3. discrimination between the classes. The graphical interface's
basic display makes the approach easy to understand.
However, the small size of the database and the inability of
the proposed approach to classify in real-time due to the data
transfer between hardware and software are some of its
limitations. The proposed work could proceed in two
alternative long-term directions: either hardware, through data
integration into a bionic prosthesis system, or software,
through an e-health application.
182
Authorized licensed use limited to: Amrita School of Engineering. Downloaded on April 05,2025 at 12:41:53 UTC from IEEE Xplore. Restrictions apply.