0% found this document useful (0 votes)
82 views

Hardware Implementation For Lower Limb Surface EMG Measurement and Analysis Using Explainable AI For Activity Recognition

Hardware Implementation for Lower Limb Surface EMG Measurement and Analysis Using Explainable AI for Activity Recognition

Uploaded by

bhavesh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Hardware Implementation For Lower Limb Surface EMG Measurement and Analysis Using Explainable AI For Activity Recognition

Hardware Implementation for Lower Limb Surface EMG Measurement and Analysis Using Explainable AI for Activity Recognition

Uploaded by

bhavesh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL.

71, 2022 2004909

Hardware Implementation for Lower Limb Surface


EMG Measurement and Analysis Using Explainable
AI for Activity Recognition
Ankit Vijayvargiya , Senior Member, IEEE, Puneet Singh , Rajesh Kumar , Senior Member, IEEE,
and Nilanjan Dey , Senior Member, IEEE

Abstract— Electromyography (EMG) signals are gaining pop- I. I NTRODUCTION


ularity for several biomedical applications, including pattern
recognition, disease detection, human–machine interfaces, med-
ical image processing, and robotic limb or exoskeleton fabrica-
tion. In this study, a two-channel data acquisition system for mea-
suring EMG signals is proposed for human lower limb activity
I N THE past decade, research on analyzing human activity
through sensor devices has garnered considerable attention.
Human activity recognition (HAR) assesses a person’s actions
recognition. Five leg activities have been accomplished to measure based on data that have been perceived and performed in any
EMG signals from two lower limb muscles to validate the context required. HAR applications can be found in a variety
developed hardware. Five subjects (three males and two females) of fields, such as intelligent homes with aided surveillance,
were chosen to acquire EMG signals during these activities. The
raw EMG signal was first denoised using a hybrid of Wavelet healthcare monitoring, and tele-immersion applications [1],
Decomposition with Ensemble Empirical Mode Decomposition [2]. Typically, the HAR technique is accomplished by several
(WD-EEMD) approach to classify the recorded EMG dataset. stages, beginning with the analysis of recorded data, moving
Then, eight time-domain (TD) features were extracted using on to the use of various sensors, and eventually identifying
the overlapping windowing technique. An investigation into the activity to be done. An HAR system can monitor the
the comparative effectiveness of several classifiers is presented,
although it was hard to distinguish how the classifiers predicted activity of individuals’ lower limbs using a variety of sensing
the activities. Having a trustworthy explanation for the outcomes sensors. This type of HAR system can be beneficial in a variety
of these classifiers would be quite beneficial overall. An approach of situations, including identifying jumping and lifting legs
known as explainable artificial intelligence (XAI) was introduced while performing ballet movements, identifying movements
to produce trustworthy predictive modeling results and applied such as standing, sitting, walking, running, climbing and
the XAI technique known as local interpretable model-agnostic
explanations (LIME) to a straightforward human interpretation. descending stairs, vacuuming, and situps, diagnosing neuro-
LIME investigates how extracted features are anticipated and musculoskeletal disorders that cause knee pain, composing a
which features are most responsible for each action. The accuracy robotic prosthetic limb in the case of an amputee’s missing
of the extra tree classifier gives the highest accuracy of the other limb, and recognizing sports activities [3], [4].
studied algorithms for identifying different human lower limb Two methods are available for monitoring the activity of
activities from sEMG signals.
the human lower limb. The first method uses a visual sen-
Index Terms— Electromyography (EMG) signal acquisition sor, whereas the second method uses wearable sensors [5].
system, explainable artificial intelligence (XAI), local inter- Wearable sensors gather data while the subject is wearing
pretable model-agnostic explanations (LIME), lower limb activity
recognition, machine learning (ML), signal processing. them, whereas visual sensors such as stereo cameras do not
require the subject to wear them. While vision-based activity
identification systems have limited pervasiveness, privacy, and
Manuscript received 18 May 2022; revised 12 July 2022; accepted 27 July complexity in activity recognition, they are ideal for security
2022. Date of publication 11 August 2022; date of current version 31 August
2022. This work was supported by the Visvesvaraya Ph.D. Scheme, Meity, applications due to their low cost. Significant technological
Government of India, under Grant MEITY-PHD-2942. The Associate Editor advancements in wearable sensors have occurred in recent
coordinating the review process was Dr. Octavian Adrian Postolache. (Corre- years. It leads to a reduction in the overall cost, making it
sponding author: Ankit Vijayvargiya.)
Ankit Vijayvargiya is with the Department of Electrical Engineering, more affordable. Popular wearable sensors include accelerom-
Malaviya National Institute of Technology, Jaipur 302017, India, and also eters, gyroscopes, Electromyography (EMG), and barometers
with the Department of Electrical Engineering, Swami Keshvanand Institute [6], [7]. The EMG sensors outperform the others because of
of Technology, Management and Gramothan, Jaipur 302017, India (e-mail:
[email protected]). their ability to predict movement in a very short time. Two dis-
Puneet Singh is with the Department of Electronics and Communication tinct approaches were used to record the EMG signal: surface
Engineering, Malaviya National Institute of Technology, Jaipur 302017, India EMG (noninvasive), and intramuscular EMG (invasive). The
(e-mail: [email protected]).
Rajesh Kumar is with the Department of Electrical Engineering, iEMG technique requires entering the muscle with a needle,
Malaviya National Institute of Technology, Jaipur 302017, India (e-mail: which is a painful procedure that can turn dangerous if the
[email protected]). infection spreads throughout the body. In contrast, the sEMG
Nilanjan Dey is with the Department of Computer Science and Engineering,
JIS University, Kolkata 700109, India (e-mail: [email protected]). sensor is put on the external area of the body (i.e., on the
Digital Object Identifier 10.1109/TIM.2022.3198443 surface) and makes signal acquisition simple [8].
1557-9662 © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
See https://www.ieee.org/publications/rights/index.html for more information.

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
2004909 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 71, 2022

TABLE I TABLE II
C OST (A PPROXIMATE ) C OMPARISON W ITH O THER AVAILABLE C OMMER - OVERVIEW OF S EMG D ATASET
CIAL D EVICES [11], [12]

Assistive devices based on sEMG signals can be used


to improve the quality of an unhealthy person’s daily life.
Orthoses are used to assist people with weak joints to move muscle movement. This uses a support vector machine and
more readily, whereas prostheses are used to replace miss- general regression neural network algorithms, which give
ing limbs. The electric-powered robotic devices comprise an 98.64% and 96.27% recognition rates, respectively. This is
instrument for signal measurement, a machine learning (ML) carried out to have accuracy and control of the intelligent
algorithm for recognizing EMG patterns, and a mechanical prosthesis. Khemraj et al. [16] categorized the various lower
framework for control. Although several signal conditioning limb activities using a convolutional neural network, K-nearest
systems and high-level EMG signal acquisition devices are neighbor classifier, and support vector machine, among other
commercially available, such as BIOPAC and BIONOMADX, methods. A significant number of healthy individuals were
they are costly. Pradhan et al. [9] proposed a two-channel invited to participate in a range of tasks to collect data from
EMG biopotential amplifier by deploying an INA128 instru- the accelerometer and gyroscope sensors in this experiment.
mentation amplifier to capture EMG signals while performing Gautam et al. [17] developed a unique classification approach
seven hand gestures. Guo et al. [10] developed a four-channel that takes into account lower limb motions while calculating
EMG acquisition system by smoothing the original signal the prognosis of the knee joint angle. Naik et al. [18] used
using an instrumentation amplifier (INA326) and operational independent component analysis (ICA)-entropy bound mini-
amplifiers (AD8603). However, the system is complicated by mization (EBM) to classify three distinct lower limb motions
the fact that each channel requires its own ADS8603 and for healthy and knee deformity patients by decomposing
INA326 for conditioning. Pancholi and Joshi [11] demon- the sEMG signal of activity using ICA by approximating
strated the use of EMG data for signal identification by the entropies of a wide range of distributions via EBM.
designing an eight-channel, low-cost data acquisition system. In another study [19], deep belief networks (DBNs) are used
As a result of the complexity of these devices, this study to overcome local minima difficulties and overfitting concerns
focused on a two-channel sEMG data acquisition system for to accomplish the categorization of limb motions based on
lower limb activity recognition that is wireless, cost-efficient, EMG signals. Table II indicates some of the previous studies
and compact in design. This system’s prototype cost is around on human lower limb activity recognition.
$100, which includes mainly the MyoWare sensor and the The ML systems have recently demonstrated superhuman
ESP32 development board. Table I shows a cost comparison performance in a variety of applications, leading to widespread
with other commercial EMG data acquisition devices. industrial use of AI. This boost in performance is generally
Despite numerous successful applications, identifying leg accomplished by increasing the model complexity, turning
activity with sEMG continues to be a challenge due to such systems into “black boxes” and raising ambiguity about
the noisy nature of the signals. Due to the prevalence of how they work and ultimately make judgments. The ML
several artifacts such as ambient noise, inherent noise, and systems have struggled to be embraced in delicate yet vital
motion artifacts being mixed together, it is hard to distinguish fields such as healthcare, where their benefits may be great.
between the muscle’s actual sEMG signal and other artifacts. As a result, contemporary scientific interest in explainable
The use of novel approaches such as wavelet denoising, artificial intelligence (XAI), a topic focused on developing new
Wigner–Ville distribution, and empirical mode decomposition techniques to explain and comprehend ML models, has risen
(EMD) to efficiently minimize these artifacts in the sEMG significantly. In this study, the XAI approach, known as local
signal has recently been demonstrated by several studies. interpretable model-agnostic explanations (LIME), to achieve
Vijayvargiya et al. [13] used a hybrid approach combining a simple human interpretation is used. LIME investigates how
wavelet and ensemble EMD (EEMD) to denoise the EMG extracted features are anticipated and which features are most
signal before feature extraction and classification in this study. responsible for each action. The major contributions of this
Several attempts have been undertaken during the past study are as follows.
decade to detect activities in the legs using sEMG signals 1) A low-cost dual-channel data acquisition system with
from various muscles of the lower limb [14]. Li et al. [15] a python-based GUI is developed for sEMG signal
worked on the recognition of nine different types of activities, measurement of lower limb muscles during five distinct
making use of sEMG signal data recovered from forearm activities.

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
VIJAYVARGIYA et al.: HARDWARE IMPLEMENTATION FOR LOWER LIMB SURFACE EMG MEASUREMENT AND ANALYSIS 2004909

2) Eight time-domain (TD) handcrafted features based on


Wavelet Decomposition with Ensemble Empirical Mode
Decomposition (WD-EEMD) are extracted using an
overlapping windowing approach from sEMG data.
3) A quantitative assessment of the performance of the clas-
sification algorithms is evaluated and XAI is introduced
to produce reliable predictive modeling results.
This work is structured as follows: Section II describes
the hardware implementation of a two-channel sEMG data Fig. 1. Block diagram of the developed hardware.
acquisition system. Section III outlines the techniques for pre-
processing the sEMG signal in this investigation. Section IV
contains a brief description of the evaluated ML models, fol- preprocessed signals (EMG signal envelope), i.e., rectified and
lowed by an explanation of the locally interpretable approach, smoothed output. The sensor has three connection points to
LIME, for explaining significant features in Section V. The the body. Each measuring channel consists of three electrodes,
results and discussion are included in Section VI. Section VII two of which measure biopotentials, and the third serves as
discusses the conclusion and future scope. a relative ground. This MyoWare sensor circuit comprise a
difference circuit, an offset removal circuit, a rectification
II. P ROPOSED M ETHODOLOGY circuit, and an integration circuit. The difference circuit is
made up of an operational amplifier that subtracts the potential
The current study is the hardware implementation for lower at one electrode from the potential at the other electrode to get
limb sEMG signal measurement for the five distinct lower the EMG signal. With this approach, the noise signal (e.g.,
limb activity recognitions. A total of five healthy subjects were power line interference) that is common to both the electrode
considered to evaluate the performance indices as in [27] of inputs can be eliminated. A voltage offset is introduced into
the various classification algorithms. Finally, LIME is used to the EMG signal during its origination, leading the signal to
investigate the anticipation of features. Algorithm 1 presents be centered on a voltage value that is not zero. After the
the pseudo-code of the proposed methodology. difference circuit, the rectification circuit is considered, which
is an appropriate processing step for determining the total
Algorithm 1 Proposed Methodology strength of the neural drive to the muscle and is correlated
Step 1: The development of hardware for the acquisition with the strength of muscular contraction and its output.
of sEMG signal from two lower limb muscles (X 1 and X 2 ); It also removes the voltage offset from the rectified EMG
Step 2: Applied hybrid of wavelet decomposition with signal to give an adjusted EMG signal. After the rectification
ensemble empirical mode decomposition (WD-EEMD) for circuit, an integration circuit is used to integrate the rectified
minimizing the noise of sEMG signal; EMG signal to provide an EMG output signal. This sensor
Step 3: Segmentation of sEMG signal using overlapping incorporates a gain potentiometer for signal amplification and
windowing approach with 256 ms window size and 25% is supplied through a 3.3-V supply. Electrodes are snapped
overlap; to the sensor module, and then the sensor is placed on the
Step 4: Five TD handcrafted features have been extracted muscle of interest. These muscle sensors are intended to be
from each segment of the sEMG signal; used directly with a microcontroller and require no additional
Step 5: Four ML algorithms such as decision tree, bagging, hardware. As a result, the sensor’s output signal is not only
gradient boosting, and extra trees are applied for classifi- a raw EMG signal but also it is amplified, rectified, and
cation of five distinct lower limb activities (jump, situps, integrated.
stairs down, stairs up, and walk); An ESP32-Wroom-32 microcontroller is used to interface
Step 6: Local interpretable model-agnostic explanations the sensors. It offers an in-built 12-bit ADC (sensors are
(LIME) technique has been used to explore how extracted connected to it) and throughput of around 1 Mbps (minimum)
features are anticipated or which features are more respon- is observed till 15 m. It is powered by a 1850-mAh Li-ion
sible for each action. battery charged via the USB connector, while the ESP32
module’s 3.3-V input powers the MyoWare Muscle sensors.
Sections II-A – II-E include the major part of the proposed On-board Wi-Fi support is present and is used for data
methodology. transmission. Sampling frequency of 1 kSps is programmed
along with the communication protocol for uploading signals
to the receiver station with the help of Arduino IDE. Wi-Fi
A. Hardware Implementation and Data Acquisition credentials to connect with the Wi-Fi access point on which
The constructed module consists of an ESP32-Wroom-32 the receiver is present are provided to ESP32. It is assumed
module linked to the outputs of two MyoWare muscle sensors that there are no obstacles/walls between ESP32 and the
(two-channel system) through the ESP32-Wroom-32 module, receiver during the entire data acquisition procedure. A GET
as shown in Fig. 1. Here, the system makes use of an inexpen- request is made via Python script on the receiver’s end. The
sive MyoWare Muscle Sensor from Advancer Technologies received JavaScript Object Notation (JSON) data are decoded
[28]. It can collect EMG signals and output both raw and into signals and are stored in an Excel file. To calculate

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
2004909 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 71, 2022

moisture content can diminish the signal, which is why no


sweat droplets should be present on the skin. The sampling
frequency of the system is 1 kHz.

B. WD-EEMD-Based Signal Denoising


Because numerous noise signals and artifacts are combined,
it is difficult to distinguish between the muscle’s actual sEMG
signal and other artifacts. These noises or artifacts may affect
the handcrafted feature extraction and hence the EMG signal
interpretation. As a result, signal denoising is necessary before
using signals for any applications. In recent investigations,
innovative approaches such as wavelet denoising, EMD, prin-
Fig. 2. Placement of EMG electrodes on the right leg muscle. (a) VM. cipal component analysis (PCA), and ICA have been success-
(b) GS. fully used to reduce noise in sEMG data.
The scheme to denoise the sEMG signal with the
TABLE III help of a wavelet denoising algorithm is demonstrated by
S UBJECTS ’ G ENDER , A GE , AND A NTHROPOMETRIC D ATA Phinyomark et al. [29]. Among sEMG signals, several irreg-
ular noises, such as white Gaussian noise, are inconvenient to
reduce via signal filtering. Hence, wavelet denoising is used
to eliminate it. The expression for noisy signal X (n) is stated
as
X(n) = Y (n) + K (n) (1)
wherein Y (n) demonstrates the original signal, and K (n) is
throughput requirements, the size of transmitted data per the white Gaussian noise.
second via system is considered. The JSON encoded data The wavelet denoising based on discrete wavelet transform
take 78.24 kb which is being transmitted per second. This (DWT) comprises the following steps:
concludes that the required throughput of the system should 1) signal decomposition is done by the DWT;
be greater than 78.24 kbps. The only constraint here is that 2) choose a threshold value for every wavelet decomposi-
as the obstacles between the system and receiver increase, tion;
throughput decreases and it is observed that in the presence 3) to regenerate the denoised signal, the inverse wavelet
of obstacles, the throughput reduces to 100 kbps minimum transforms along with the threshold function are used.
within a 15 m range. Further increase in distance can cause As wavelet denoising over signals, discrete wavelet coeffi-
signal loss but a 15-m range is enough for functioning. cients are formed when the signal passes through low-pass and
To collect sEMG data, a total of five healthy participants high-pass filters. After signal decomposition and thresholding,
(three males and two females) over the age of 18 years were wavelet denoising is used to obtain details and approximation
recruited. Their relevant anthropometric measurements can be coefficients. The decomposition level determines the overall
found in Table III. There was no previous history of knee number of coefficients. The traditional wavelet coefficient
pain or injury. The data were collected while performing thresholding methods include soft and hard thresholding [30].
one of five different activities: jumping, situps, stairs down, Soft thresholding uses a continuous divergence from the
stairs up, and walking. Here, a 20-ft walk on a flat area is original signal, whereas hard thresholding uses merely partial
considered, along with a 7.75-in rise and 10-in run considering information. This work implements universal thresholding
15 steps, seven situps, and a 20 jumps. Each exercise was across detailed coefficients. The form of universal thresholding
repeated ten times by each individual. For the evaluation, the selection is represented as
sEMG signal from each subject for 8 s (approx.) during each 
λ = σ 2ln(M). (2)
activity is taken into account. The hardware that was developed
has a sampling rate of 1 kHz, so there are 8000 samples Herein; σ = (MAD)/0.6745 MAD is designated as the
(approx.) of the sEMG signal collected in 8 s. So each subject median absolute deviation, and M is the length of the signal.
has approximately 40 000 samples (8000 × 5). As indicated The db7 wavelet from the Daubechies family is used up to the
in Fig. 2, sEMG electrodes were put on the following two fourth level of signal decomposition, with Garotte thresholding
muscles of the subject’s right limb: vastus medialis (VM) applied to the detail coefficients.
and gastrocnemius (GS). The sEMG electrodes are positioned As a consequence of the nonlinear and nonstationary nature
according to the surface electromyography for the noninvasive of sEMG signals, decomposition techniques based on linear
assessment of muscles (SENIAM) standard. To obtain valuable and stable processes may produce misleading findings. EEMD
information from the EMG signal, the skin’s impedance must is a highly effective technique for decomposing nonstationary,
be minimized, and the skin should be completely cleaned. The nonlinear signals into full or nearly orthogonal intrinsic mode
dead skin was removed using an abrasive gel. In addition, functions (IMFs). Functions or oscillation modes with a single

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
VIJAYVARGIYA et al.: HARDWARE IMPLEMENTATION FOR LOWER LIMB SURFACE EMG MEASUREMENT AND ANALYSIS 2004909

TABLE IV E. Classification Techniques


M ATHEMATICAL E XPRESSIONS OF E XTRACTED H ANDCRAFTED
F EATURES
After extracting the information in the form of handcrafted
features, ML approaches may be used to identify the data
as pertaining to distinct lower limb actions. While there are
numerous ML algorithms for identification, decision trees and
their ensembles, such as bagging, gradient boosting, and extra
trees, have been evaluated in this section.
1) Decision Tree Classifier: As the name indicates, a deci-
sion tree classifies the data points described by a collection
of attributes. These are shown as trees, with each node repre-
senting an attribute and each child representing a possibility.
Each leaf corresponds to a decision rule. Several common
decision tree training algorithms are Iterative Dichotomiser 3
(ID3), classification and regression tree (CART), C4.5, and
multivariate adaptive regression splines (MARS) [4], [33].
component have a single instantaneous frequency. A signal can Here, the most straightforward learning algorithm, ID3, uses
be iteratively decomposed into IMFs using the EMD approach. greedy techniques to select the best attribute on each iteration
Due to the susceptibility of the EMD algorithm to noise, locally. The ID3 classifier follows the following steps.
appearance mode mixing happens often. IMFs were defined
1) Step 1: First, estimate the entropy of each feature in the
in the EEMD approach for noise-assisted data processing as
dataset.
the ensemble average of trials.
2) Step 2: Split the dataset into subgroups using the prop-
In this study, like in our previous study [13], a preprocessing
erty that provides the highest information gain.
approach combining WD-EEMD is used. The white Gaussian
3) Step 3: If the value of entropy is 0, the node is
noise and undesired signals, such as noise produced by other
considered to be a leaf node, and no splitting is needed.
muscles, are first filtered out using wavelet denoising. The
However, if the entropy value is greater than 0, the signal
signal is then decomposed using EEMD to eliminate power
should be split as specified in step 2.
line interference and baseline wandering noise.
2) Bagging Classifier: This is a method for combining
the results of many ML algorithms to generate an accurate
C. Segmentation prediction model [34]. This classifier creates random selec-
Segmentation is used in preprocessing because it is an tions from the training dataset using bootstrap. It generates
efficient technique to handle time-series data needed in a n decision tree and individually estimates their predictions,
deep-learning-based model. The windowing method is used to and then aggregates them to produce a final prediction using
implement segmentation. Segmentation may be accomplished the mean or vote of the acquired individual findings. It is
through the use of two different types of windowing tech- also known as the bootstrap algorithm because it is capable
niques: adjacent windowing and overlapping windowing [31]. of reducing substantial amounts of variation by introducing
The classification accuracy and response time rely on the randomness into the process of assembling and subsequently
signal window size. This study used the same overlapping generating an ensemble.
windowing approach as other studies [4], [18]. 3) Gradient Boosting Classifier: In this classifier [35],
a weak learning algorithm is applied repeatedly. In contrast,
the results from the previous ones are improved successively,
D. Feature Extraction and then the classification is built up like in a robust classifier.
The decision tree is typically used as a weak learner in a
There are three approaches to extracting features: TD,
situation. With the aid of the gradient descent method, the
frequency domain (FD), and time–frequency domain (TFD).
performance is frequently monitored at each iteration using
TD handcrafted features are used in signal classification
the loss function and optimized as a result of the process.
applications such as muscular activity identification, onset
4) Extra Trees Classifier: This approach is also known as
detection, and muscle contraction. These characteristics are
the extremely randomized decision tree since it is based on the
commonly used because they improve signal classifica-
decision tree algorithm [36]. This classifier generates a huge
tion in low noise and low computing complexity situa-
number of classification trees rather than a single classification
tions [32]. Therefore, in this research, where classification
tree. Each tree is trained using the whole training set, and
of lower limb movement will be conducted, eight TD fea-
random splits are used rather than computing the locally
tures will be exploited [13]. The mathematical expressions
optimal splits for each feature, resulting in a very efficient,
of eight extracted handcrafted features are presented in
quick, and accurate approach.
Table IV.
Here, x denotes the sEMG signal, N denotes the total
number of samples, k denotes the sample instance, σ denotes F. XAI for Predictive Model
the standard deviation of the sample, μ denotes the mean of Artificial intelligence (AI) was regarded a theoretical study
the sample, and E is the signal’s expected value estimator. with few real-world applications for years. ML has made huge

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
2004909 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 71, 2022

TABLE V
P ERFORMANCE PARAMETERS OF THE S TUDIED ML M ODELS ( IN %)

Fig. 3. Box plot for all the studied classifies with 50 randomized tests. (a) Male 1. (b) Male 2. (c) Male 3. (d) Female 1. (e) Female 2.

advancements in the past decade, leading to its widespread Local explanation approaches such as LIME and SHAP are
industrial use, due to more powerful processors, stronger two of the most frequently used model-agnostic, local expla-
learning algorithms, and easier access to big amounts of data. nation strategies for explaining any given black-box classifier.
The ML models address real-time difficulties across several LIME is an innovative method that uses a locally interpretable
sectors. Increasing model complexity improves prediction per- process to describe the prediction process of any classification
formance. Deep learning helps machines recognize, analyze, model and gives information about the classifier’s prediction
and extract complicated data representations for detection strategy and feature correlations. It is based on the idea that
and classification. This hierarchy of increasing complexity any complicated model is linear on a local scale. LIME
and utilization of enormous amounts of data to train and attempts to fit a basic model around a single observation to
develop advanced systems boosts their predictive capacity, but simulate how the global model works at that location. The
lowers their ability to explain their underlying workings and basic model can then be used to explain the more complicated
methods. Therefore, it is harder to understand their activities model’s predictions locally.
and interpret their future recommendations. The LIME model should be model-agnostic, to learn the
It is difficult to trust systems whose outcomes are difficult to behavior of the underlying model, obfuscate the input, and
explain, especially in fields such as healthcare or self-driving see how the predictions change. To discover the behavior of
vehicles, where moral and justice questions have inevitably the underlying model, disrupt the input and examine how the
emerged. The development of efficient, fair, resilient, and predictions change using the LIME model, which is model-
high-performing models for real-world applications has res- agnostic. Interpretability benefits from this since input may be
urrected the subject of XAI. It is gaining popularity at the perturbed by things that humans comprehend (e.g., words or
moment owing to its simplicity of understanding and easy- parts of a picture), even if the model uses significantly more
to-interpret procedures [37], [38]. XAI is a set of tools and intricate components as features (e.g., a graph) (e.g., word
frameworks for understanding and interpreting ML model embeddings). It makes use of the following ways to do this:
predictions, as well as analyzing and optimizing model per- 1) permute the sample;
formance and assisting others in comprehending your models’ 2) the distance between permutations and the original data
interpretability. The interpretability of a model may be evalu- is calculated;
ated on two levels. 3) using a complex model, make predictions on new data;
4) the best features of the complex model results from
permuted data are chosen;
1) Global Interpretation: It offers a comprehensive descrip-
5) fit a simple model to permuted data using features
tion of the operation of AI systems, for example, by out-
chosen in the previous step and the similarity score as
lining the rules of features that govern their outcomes.
a weight;
2) Local Interpretation: In XAI, local interpretability does
6) the simplest model’s feature weights explain the com-
not attempt to describe the complete AI model. It instead
plex model’s local behavior.
trains XAI models to approximate individual prediction.
Local interpretability models show how the model’s The mathematical expression of LIME is presented as
outcomes change as the values of certain attributes  
change within a given interval. explain(y) = argmingG L h, g, λ y + P(g). (3)

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
VIJAYVARGIYA et al.: HARDWARE IMPLEMENTATION FOR LOWER LIMB SURFACE EMG MEASUREMENT AND ANALYSIS 2004909

Fig. 4. Confusion matrix for subject M1 with studied classifier. (a) Decision tree. (b) Bagging. (c) Gradient boosting. (d) Extra trees.

Fig. 5. LIME outcomes for extra tree classifier for distinct lower limb activities of subject M1. (a) Jumping. (b) Situps. (c) Stairs down. (d) Stairs up.
(e) Walking.

TP
Here, explain(y) represents the explanation model for instance Recall(Sensitivity) = (6)
y; P(g) represents the complexity of model; L(h, g, λ y ) TP + FN
TN
represents the loss function; h represents the black-box model; Specificity = (7)
g represents the explainer; y is the similarity between data TN + FP
points. 2 ∗ Recall ∗ Precision
F1-score = . (8)
Recall + Precision
III. R ESULTS AND D ISCUSSIONS
Although accuracy may be considered one of the evalua-
The problem in this application is a multiclass classification
tion criteria, additional evaluation metrics such as sensitivity,
task, and the dataset was partitioned into 70% training dataset
selectivity, and F1-score are necessary and covered in this
and 30% testing sets, since the training set should be more
study. Table V summarizes the performance metrics for the
than that of the test dataset to get a higher classification rate.
five computational classifiers evaluated in this study for recog-
A classification system using ML produces four possible
nizing five distinct lower limb activities. Across all the five
outcomes: true negative (TN), true positive (TP), false
subjects, the extra tree classifier has the best accuracy and
negative (FN), and false positive (FP). Here, TP and TN are
F1-score value, while the decision tree classifier has the lowest
the correct predictions of the positive and negative classes
accuracy and F1-score value. The decision tree, bagging, and
while the FP and FN are the wrong predictions, respectively.
gradient boosting tree classifiers have a mean accuracy of
The classification performance indicators for each classifier
89.10%, 93.59%, and 94.99%, respectively, while the extra
were calculated based on the number of occurrences of each
tree classifier has a mean accuracy of 96.83%. The decision
of the following four potential outcomes:
tree, bagging, gradient boosting tree, and extra tree classifiers
TP + TN had mean F-scores of 88.78%, 93.48%, 94.88%, and 96.72%,
Accuracy = (4)
TP + TN + FP + FN respectively.
TP To determine statistical validity, an experiment was done
Precision = (5)
TP + FP with 50 randomized tests to determine the accuracy of all the

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
2004909 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 71, 2022

TABLE VI IV. C ONCLUSION


C LASS -W ISE A CCURACY OF E XTRA T REE C LASSIFIER ( IN %)
The research provides a wireless and portable two-channel
data acquisition module for sEMG measurement using a
MyoWare Muscle Sensor for the automated identification
of lower limb actions. Five subjects (three males and two
females) were chosen to acquire EMG signals during the five
distinct activities: jumping, situps, stairs down, stairs up, and
walking. The WD-EEMD preprocessing technique was first
used to denoise the sEMG signal, and then an overlapping
windowing approach was used to extract eight TD hand-
crafted features from each signal of muscles. A comparative
performance analysis of the decision tree and its ensembles
is presented. However, it was difficult to determine how the
studied classifiers and create a box plot to demonstrate the classifiers predicted the actions. As a result, the XAI technique
accuracy distributions as shown in Fig. 3. Here, the mean known as LIME is used, which explores how extracted features
accuracy of the extra tree classifier is higher than that of are anticipated or which features are most responsible for each
the other examined classifiers, and the standard deviation is action. LIME has some limitations, such as label and data
also minimum in all the five subjects for the 50 randomized shift, explanations that depend on hyperparameter selection,
samples. and even the same instances may have various perceptions.
The confusion matrix derived by the studied classifier for In the future, highly interactively XAI models such as SHapley
subject 1 is shown in Fig. 4. The confusion matrix is a table Additive exPlanations (SHAP) and local interpretation-driven
that allows you to visualize the performance of a classification abstract Bayesian networks can be used.
system. It comprises data on the actual and expected labels There are still some expansions available for the intended
that a model evaluates. From Fig. 4(a), it can be seen that work in the future. To begin, the data were collected with
104 samples of jogging class, 111 samples of situps class, a rather small sample. As a future scope, researchers can
106 samples of stairs down class, 122 samples of stairs collect data from more subjects and validate their results
up class, and 125 samples of walking class are correctly and also analyze the performances for intersubject activity
identified, while 18 samples of jogging class, ten samples of classification. In addition, other modern ML algorithms may
situps class, one sample of stairs down class, seven samples of be used, and feature reduction techniques can be used to
stairs up class and four samples of walking class are wrongly minimize the extracted features.
predicted. Similarly, Fig. 4(b)–(d) shows the confusion matrix
of the remaining studied ML classifiers.
Table VI shows the class-wise accuracy of extra tree classi- R EFERENCES
fier for each subject individually for all the five activities. The [1] S. Ranasinghe, F. Al Machot, and H. C. Mayr, “A review on applications
average accuracy of activities such as jogging, situps, ladder, of activity recognition systems with regard to performance and evalua-
tion,” Int. J. Distrib. Sensor Netw., vol. 12, no. 8, pp. 1–22, Aug. 2016.
ladder, and walking is 98.11%, 98.26%, 95.26%,97.32%, and [2] A. Vijayvargiya, P. L. Singh, S. M. Verma, R. Kumar, and S. Bansal,
94.92%, respectively. “Performance comparison analysis of different classifier for early detec-
A total of eight TD handcrafted features are derived from tion of knee osteoarthritis,” in Sensors for Health Monitoring. Academic,
Aug. 2019, pp. 243–257.
sEMG signals of two leg muscles using three decomposed [3] R. Gopura, K. Kiguchi, G. Mann, and D. Torricelli, “Robotic prosthetic
signals (IMF1, IMF2, and IMF3) obtained using WD-EEMD. limbs,” J. Robot., vol. 2018, no. 8, pp. 1–2, 2018.
Thus, the classification algorithm uses a total of 48 features [4] A. Vijayvargiya, C. Prakash, R. Kumar, S. Bansal, and
J. M. R. S. Tavares, “Human knee abnormality detection from
(two muscles × three IMF × eight handcrafted features = imbalanced sEMG data,” Biomed. Signal Process. Control, vol. 66,
48 features) to classify the five distinct lower limb actions. Apr. 2021, Art. no. 102406.
However, it is hard to know the classifiers’ predictions of [5] Z. Hussain, M. Sheng, and W. Emma Zhang, “Different approaches for
human activity recognition: A survey,” 2019, arXiv:1906.05074.
the actions. Having a credible explanation for the results of [6] S. Xia, L. Chu, L. Pei, Z. Zhang, W. Yu, and R. C. Qiu, “Learning
these classifiers would be quite valuable in the long run. disentangled representation for mixed- reality human activity recognition
As a result, LIME is used to enhance the interpretability of with a single IMU sensor,” IEEE Trans. Instrum. Meas., vol. 70, 2021,
Art. no. 2514314.
the classification process. Fig. 5 shows the outcomes of the [7] Z. Chen, C. Jiang, S. Xiang, J. Ding, M. Wu, and X. Li, “Smartphone
LIME approach for extra tree classifier for distinct lower limb sensor-based human activity recognition using feature fusion and max-
activities of subject M1. The results with the top ten features imum full a posteriori,” IEEE Trans. Instrum. Meas., vol. 69, no. 7,
pp. 3992–4001, Jul. 2020.
are presented for five samples of the different activities. [8] A. Vijayvargiya, B. Singh, R. Kumar, and J. M. R. S. Tavares, “Human
In Fig. 5(a), the extra tree classifier predicts the instance with lower limb activity recognition techniques, databases, challenges and
jumping to be a positive response with a chance of 100%. its applications using sEMG signal: An overview,” Biomed. Eng. Lett.,
vol. 188, no. 2, pp. 1–16, Jun. 2022.
Only the mean value of IMF3 of the GS muscle supports the [9] A. Pradhan et al., “Acquisition and classification of EMG using a dual-
prediction to be negative, while the rms value of IMF3 of channel EMG biopotential amplifier for controlling assistive devices,”
both the muscles is the top two features that support it to be in Proc. IEEE Annu. India Conf. (INDICON), Dec. 2016, pp. 1–5.
[10] W. Guo, X. Sheng, H. Liu, and X. Zhu, “Development of a multi-channel
positive. Fig. 5(b)–(e) shows similar findings for situps, stairs compact-size wireless hybrid SEMG/NIRS sensor system for prosthetic
down, stairs up, and walking, respectively. manipulation,” IEEE Sensors J., vol. 16, no. 2, pp. 447–456, Jan. 2016.

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.
VIJAYVARGIYA et al.: HARDWARE IMPLEMENTATION FOR LOWER LIMB SURFACE EMG MEASUREMENT AND ANALYSIS 2004909

[11] S. Pancholi and A. M. Joshi, “Portable EMG data acquisition module [33] J. R. Quinlan, “Induction of decision trees,” Mach. Learn., vol. 1, no. 1,
for upper limb prosthesis application,” IEEE Sensors J., vol. 18, no. 8, pp. 81–106, 1986.
pp. 3436–3443, Apr. 2018. [34] L. Breiman, “Bagging predictors,” Mach. Learn., vol. 24, no. 2,
[12] M. Ergeneci, K. Gokcesu, E. Ertan, and P. Kosmas, “An embedded, eight pp. 123–140, 1996.
channel, noise canceling, wireless, wearable sEMG data acquisition sys- [35] L. Mason, J. Baxter, P. L. Bartlett, and M. R. Frean, “Boosting
tem with adaptive muscle contraction detection,” IEEE Trans. Biomed. algorithms as gradient descent,” in Proc. Adv. Neural Inf. Process. Syst.,
Circuits Syst., vol. 12, no. 1, pp. 68–79, Feb. 2018. 2000, pp. 512–518.
[13] A. Vijayvargiya, V. Gupta, R. Kumar, N. Dey, and J. M. R. S. Tavares, [36] P. Geurts, D. Ernst, and L. Wehenkel, “Extremely randomized trees,”
“A hybrid WD-EEMD sEMG feature extraction technique for lower limb Mach. Learn., vol. 63, no. 1, pp. 3–42, Apr. 2006.
activity recognition,” IEEE Sensors J., vol. 21, no. 18, pp. 20431–20439, [37] M. T. Ribeiro, S. Singh, and C. Guestrin, “‘Why should i trust
Sep. 2021. you?’ Explaining the predictions of any classifier,” in Proc. 22nd
[14] W. Gao, L. Zhang, W. Huang, F. Min, J. He, and A. Song, “Deep neural ACM SIGKDD Int. Conf. Knowl. Discovery Data Mining, Aug. 2016,
networks for sensor-based human activity recognition using selective pp. 1135–1144.
kernel convolution,” IEEE Trans. Instrum. Meas., vol. 70, pp. 1–13, [38] M. S. Kamal, A. Northcote, L. Chowdhury, N. Dey, R. G. Crespo, and
2021. E. Herrera-Viedma, “Alzheimer’s patient analysis using image and gene
[15] J. Li et al., “Using body sensor network to measure the effect of expression data and explainable-AI to present associated genes,” IEEE
rehabilitation therapy on improvement of lower limb motor function Trans. Instrum. Meas., vol. 70, 2021, Art. no. 2513107.
in children with spastic diplegia,” IEEE Trans. Instrum. Meas., vol. 69,
no. 11, pp. 9215–9227, Nov. 2020.
[16] P. K. Shukla, A. Vijayvargiya, and R. Kumar, “Human activity recog-
nition using accelerometer and gyroscope data from smartphones,” in
Proc. Int. Conf. Emerg. Trends Commun., Control Comput. (ICONC),
Feb. 2020, pp. 1–6.
[17] A. Gautam, M. Panwar, D. Biswas, and A. Acharyya, “MyoNet:
A transfer-learning-based LRCN for lower limb movement recognition Ankit Vijayvargiya (Senior Member, IEEE) received the B.Tech. degree
and knee joint angle prediction for remote monitoring of rehabilitation (Hons.) in electrical engineering from Rajasthan Technical University (RTU),
progress from sEMG,” IEEE J. Transl. Eng. Health Med., vol. 8, Kota, India, in 2010, the M.Tech. degree in instrumentation from Devi Ahilya
pp. 1–10, 2020. University (DAVV), Indore, India, in 2014, and the Ph.D. degree in electrical
[18] G. R. Naik et al., “An ICA-EBM-based sEMG classifier for recognizing engineering from the Malaviya National Institute of Technology (MNIT),
lower limb movements in individuals with and without knee pathology,” Jaipur, India, in 2022.
IEEE Trans. Neural Syst. Rehabil. Eng., vol. 26, no. 3, pp. 675–686, His research interests include biomedical signal processing, pattern recog-
Jan. 2018. nition, and machine learning.
[19] J. Zhang, C. Ling, and S. Li, “EMG signals based human action
recognition via deep belief networks,” IFAC-PapersOnLine, vol. 52,
no. 19, pp. 271–276, 2019.
[20] Y. Luan, Y. Shi, W. Wu, Z. Liu, H. Chang, and J. Cheng, “HAR-sEMG:
A dataset for human activity recognition on lower-limb sEMG,” Knowl.
Inf. Syst., vol. 63, no. 10, pp. 2791–2814, Oct. 2021.
[21] X. Shi, P. Qin, J. Zhu, M. Zhai, and W. Shi, “Feature extraction and
classification of lower limb motion based on sEMG signals,” IEEE
Access, vol. 8, pp. 132882–132892, 2020. Puneet Singh is currently pursuing the B.Tech. degree in electronics and com-
[22] S. Park, D. Lee, W. K. Chung, and K. Kim, “Hierarchical motion munication engineering with the Malaviya National Institute of Technology
segmentation through sEMG for continuous lower limb motions,” IEEE (MNIT), Jaipur, Rajasthan, India.
Robot. Autom. Lett., vol. 4, no. 4, pp. 4402–4409, Oct. 2019. His research interests include embedded systems and machine learning.
[23] B. Hu, E. Rouse, and L. Hargrove, “Benchmark datasets for bilateral
lower-limb neuromechanical signals from wearable sensors during unas-
sisted locomotion in able-bodied individuals,” Frontiers Robot. AI, vol. 5,
p. 14, Feb. 2018.
[24] J. Ryu, B.-H. Lee, and D.-H. Kim, “sEMG signal-based lower limb
human motion detection using a top and slope feature extraction
algorithm,” IEEE Signal Process. Lett., vol. 24, no. 7, pp. 929–932,
Jul. 2017. Rajesh Kumar (Senior Member, IEEE) received the B.Tech. degree (Hons.)
[25] Y. Yu, L. Fan, S. Kuang, L. Sun, and F. Zhang, “The research of in electrical engineering from the National Institute of Technology (NIT),
sEMG movement pattern classification based on multiple fused wavelet Kurukshetra, India, in 1994, the M.E. degree (Hons.) in power systems from
function,” in Proc. IEEE Int. Conf. Cyber Technol. Autom., Control, the Malaviya National Institute of Technology (MNIT), Jaipur, Rajasthan,
Intell. Syst. (CYBER), Jun. 2015, pp. 487–491. India, in 1997, and the Ph.D. degree in intelligent systems from the University
[26] M. Lichman, “UCI machine learning repository,” School Inf. Comput. of Rajasthan, Jaipur, in 2005.
Sci., Univ. California, Irvine, Irvine, CA, USA, Tech. Rep., 2013. His research interests include theory and practice of intelligent systems,
[Online]. Available: http://archive.ics.uci.edu/ml computational intelligence and analytics, electric transportation, smart grid,
[27] A. Vijayvargiya, R. Kumar, and N. Dey, “Voting-based 1D CNN model and robotics.
for human lower limb activity recognition using sEMG signal,” Phys.
Eng. Sci. Med., vol. 44, no. 4, pp. 1297–1309, Nov. 2021.
[28] Myoware Muscle Sensor SEN 13723—SparkFun Electronics. Accessed:
Jan. 7, 2022. [Online]. Available: https://www.sparkfun.com/products/
13723
[29] A. Phinyomark, P. Phukpattaranont, and C. Limsakul, “Wavelet-based
denoising algorithm for robust EMG pattern recognition,” Fluctuation
Noise Lett., vol. 10, no. 2, pp. 157–167, Jun. 2011. Nilanjan Dey (Senior Member, IEEE) received the B.Tech. and M.Tech.
[30] A. Graps, “An introduction to wavelets,” IEEE Comput. Sci. Eng., vol. 2, degrees in information technology from the West Bengal University of
no. 2, pp. 50–61, Jun. 1995. Technology, Kolkata, India, in 2005 and 2011, respectively, and the Ph.D.
[31] O. Banos, J.-M. Galvez, M. Damas, H. Pomares, and I. Rojas, “Window degree in digital image processing from Jadavpur University, Kolkata, in 2015.
size impact in human activity recognition,” Sensors, vol. 14, no. 4, His research topics are signal processing, machine learning, and informa-
pp. 6474–6499, Apr. 2014. tion security.
[32] W. M. B. W. Daud, A. B. Yahya, C. S. Horng, M. F. Sulaima, and Dr. Dey is an Associate Editor of IET Image Processing, the Editor-in-
R. Sudirman, “Features extraction of electromyography signals in time Chief of the International Journal of Ambient Computing and Intelligence
domain on biceps brachii muscle,” Int. J. Model. Optim., vol. 3, no. 6, (IJACI), and a Series Co-editor of Springer Tracts in Nature-Inspired Com-
pp. 3–7, Dec. 2013. puting (STNIC).

Authorized licensed use limited to: MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on May 30,2023 at 09:44:16 UTC from IEEE Xplore. Restrictions apply.

You might also like