You are on page 1of 13

Surface EMG Signal Classification Using

Ensemble Algorithm, PCA and DWT


for Robot Control

Yogendra Narayan(&), Ram Murat Singh, Lini Mathew,


and S. Chatterji

Electrical Engineering Department,


National Institute of Technical Teachers Training and Research,
Chandigarh, India
narayan.yogendra1986@gmail.com,
linimathew1961@gmail.com, chatterjis@yahoo.com

Abstract. This paper presents a framework of surface electromyography sig-


nals based robotic arm prototype control using discrete wavelet transform,
principle component analysis, ensemble algorithms and Arduino Uno controller.
In this context, the sequential floating forward selection algorithm is used for
sorting out the features based on their relevance. The performance of different
ensemble algorithms is evaluated with various parameters like classification
accuracy, sensitivity, specificity, false descriptive rate, positive predictive rate
and speed. Among the all ensemble algorithm, the subspace discriminate
ensemble was found the best method with the 100% accuracy, specificity, and
sensitivity using 35 base classifiers. Subspace ensemble algorithm with principle
component analysis and 4th scaling daubechies 4 wavelet filters produced the
best performance. The main contribution of this work is that method has the
potency of best classification of sEMG signal for elbow movement which can be
beneficial for assistive robotic device development.

Keywords: sEMG signal  PCA  DWT  Ensemble classifier


SFFS algorithm

1 Introduction

The surface electromyographic (sEMG) signals are the non-invasive method in which
EMG data is acquired with a surface electrode placed on suitable acupressure points
[1]. The sEMG signals have been widely used in the field of rehabilitation robotics and
neuromuscular disease classification [2]. So, the classifiers play a big role while con-
trolling any robotic devices. One important application of sEMG signals lies in pros-
thetic limb development for rehabilitation of amputee as well as physically disables
persons, due to the fact that sEMG signals contain information of muscle movement [3,
4]. But there is no universal model which can explains the relationship between gesture
performed by human and recorded sEMG signals. Therefore, the identification of
subject intention is a necessary step towards the development of such devices which
could be solved by the associated features of sEMG signals [5]. The features of sEMG

© Springer Nature Singapore Pte Ltd. 2019


A. K. Luhach et al. (Eds.): ICAICR 2018, CCIS 955, pp. 218–230, 2019.
https://doi.org/10.1007/978-981-13-3140-4_20
Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 219

signals can be three types: (i) time domain (TD), (ii) frequency domain (FD) and
(iii) time-frequency domain (TFD). TFD feature is also called time scale feature or
wavelet coefficient which can be extracted with the help of wavelet based techniques.
The selection of suitable feature plays a vital role for achieving the good classification
accuracy as well as smooth control of devices [6]. After sEMG signals acquisition, de-
noising and other signal processing steps are performed followed by the feature
extraction, classification and robotic device controlling.
The analysis of sEMG signals has started a new era of research by using advanced
signal processing techniques in the field of biomedical signal processing [7]. The
sEMG signal classification accuracy is important for developing reliable and robust
methods of control. The comparative analysis of some classification techniques like
pattern discovery/fuzzy inference system, Bayesian networks, naïve Bayesian net-
works, tree augmented naïve Bayesian networks and evolutionary algorithms have
been done for multi-sampled EMG signal [8, 9]. By using neuromodulation method
(transcranial direct current stimulation), classification accuracy and quality of EMG
signal of amputated limb has been enhanced for myoelectric control [10].
The objective of this study is to evaluate the performance of different ensemble
algorithm to classify the sEMG signal using Discrete Wavelet Transform (DWT) for
controlling the robotic arm prototype. The classification accuracy of sEMG signal
improved by using DWT for de-noising and feature extraction purpose. The various
features of sEMG signals like TD, FD and TFD are used to form a feature vector. The
Sequential Floating Forward Selection (SFFS) algorithm is utilized for feature selection
as well as searching the best feature set whereas Principle Component Analysis
(PCA) is used for dimension reduction. Different performance measuring parameters
are used to compare the classifier accuracy and speed. This paper is divided into four
sections; the first section introduction of classification methods and related work, the
second section describe data recording and a brief introduction of ensemble classifiers,
the third section show the results and finally conclusions are given in the fourth section.

2 Materials and Methods


2.1 sEMG Data Recording and Pre-processing
The sEMG signals were gathered from total ten healthy volunteers including seven
males and three females having age between 20 to 30 years with their signed consent.
The placement of the surface electrode on arm acupressure point was done by
Noraxon EMG and sensor system manual. Acquisition of sEMG signals was done with
four-channel of myotrace 400 device, two channels were connected to brachioradialis
and flexor carpi radialis muscle and remaining two were connected to triceps branchii
(lateral and medial) muscles [11].
Total 466 observations were taken from ten right hand dominated volunteers. Full
wave rectification, amplitude normalization, smoothing, and filtering operation was
performed in the pre-processing stage. The system used for pre-processing had a base
gain of 500, baseline noise less than 1 µV, input impedance greater than 100 MΏ and a
common mode rejection ratio more than 100.
220 Y. Narayan et al.

2.2 Feature Extraction


Feature extraction is carried out after the pre-processing of the sEMG signals to form a
feature vector for classification purpose [12]. Classification accuracy of any classifier
will depend on the suitable features chosen for feature vector [13]. SFFS algorithm is
used for selecting the suitable features. Figure 1 shows the sEMG signal acquisition
system to classify the elbow movement for controlling the robotic arm prototype. In
this study, the features namely Standard Deviation (STD), Root Mean Square (RMS),
Waveform Length (WL), Slope Sign Change (SSC), Integrated EMG (IEMG), Kurtosis
(KUR), Mean Absolute Value (MAV), Variance (VAR), Fourth Order Auto-
Regressive (AR) coefficient, Simple Square Integral (SSI), Wilson Amplitude
(WAMP), Average Amplitude Change (AAC), Myopulse Percentage Rate (MYOP),
Mean Power (MNP), Total Power (TTP), Skewness (SKEW) and DWT residual (four
DWT features) are taken as suggested in a lot of literature [14, 15]. Table 1 shows the
mathematical formulas used for sEMG feature calculation.

Human subject

sEMG signals acquisition

Pre-processing

TD & FD features DWT de-noising

TFD feature

TF, FD and TFD features

Feature set obtained by SFFS

Base classifiers

Majority voting by ensemble algorithm

Performance evaluation

Fig. 1. Block diagram of sEMG signal classification


Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 221

Table 1. Mathematical Equations of EMG feature

2.2.1 Feature Selection: Order of Relevance


The SFFS algorithm is used for finding the set of best success rate features among the
original feature set [16]. The SFFS is a heuristic algorithm used for searching the
features having best success rate based on tracking the forward and backward step. The
forward step involves the addition of new feature having the best success rate in
combination with the already used feature. The least success rate feature is discarding
as long as the resulting subset performs better than the previously evaluated one.
The SFFS utilized a self-controlled backtracking approach in which trade-off between
forward and backward steps take place dynamically and finally, it can find the better
solution. The SFFS are used to sort the features in their order of relevance. In present
study, 70% data used for training and 30% data for testing purpose. Total 20 subsets of
best features are obtained by implementing algorithm 20 times randomly. A matrix
bank of 20 (times) by 20 (features) is used for obtaining the best feature. Figure 2
222 Y. Narayan et al.

shows the complete experimental setup for sEMG signals acquisition for controlling
robotic arm prototype using Arduino Uno controller.

Fig. 2. sEMG electrodes on subject arm with complete setup

2.2.2 Feature Reduction: Principle Component Analysis


PCA generates a new set of a variable which is a linear combination of original variable
and orthogonal to each other resulting no redundant information [17]. PCA is used for
dimension reduction and feature extraction which transform d-dimensional data into
lower dimensional space thereby reducing the space and time complexities. For any
dataset, PCA can be found by calculating d  d covariance matrix and d-dimensional
mean vector µ. It computes the value of eigenvectors as well as eigenvalues and orders
them by eigenvalue, highest to lowest. Lesser significance component can be ignored
because it does not lose some significant information [18]. For a d-dimensional data set,
d eigenvectors and eigenvalues can be computed and if first most significant p eigen-
vectors are chosen then we obtain p dimensions data set. New feature vector are formed
by arranging p eigenvectors as the column in matrix form. The final step is to transpose
of the matrix obtained by eigenvectors and multiply it on the left side of mean-adjusted
data transposed. In brief, all steps are as follow (i) Compute the means, (ii) Calculate
the covariance matrix, (iii) Find the eigenvalue and corresponding eigenvector,
(iv) Choose the most significant value eigenvector while ignoring lest significant value,
and (v) Multiply the transposed matrix obtained by eigenvector to the mean-adjusted
data transposed. In this way, PCA transformation of original inputs to new uncorrelated
features is achieved [19].

2.3 Discrete Wavelet Transform


The wavelet transform is a powerful mathematical and signals processing tool that is
used for multi-resolution analysis of a signal. In wavelet analysis, single function
(mother wavelet) is shifted and dilated which consists of a linear combination of an
individual set of functions. Dilated and translated wavelet can be defined in term of
mother wavelet as
Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 223

 
1 tb
;a;b ðtÞ ¼ pffiffiffiffiffiffi ; ð17Þ
jaj a

where a is scale and b is a translation parameter. a ˂ 1, if compressing the wavelet and


a > 1 if dilates the wavelet [20]. These parameters can be generated in time with
midpoint localities and various frequencies which are called as wavelet atoms or baby
wavelet. DWT was selected for this study due to its multi-resolution analysis capability
and concentration in real-time engineering application [21]. Wavelet is used for the
decomposition of signal the into details and approximations coefficient. These coeffi-
cients are the resultant of filtering process (high pass and low pass filter) and used for
time scale feature extraction or wavelet coefficients. The approximations coefficient can
be considered as low-frequency and high scale whereas the details coefficient as high-
frequency with low scale respectively [22]. Details coefficient of the sEMG signals is
obtained by using high pass filter followed by down sampler. Similarly, approximation
coefficient can be found using low pass filtering followed by upsampler. Figure 3
shows the de-noised sEMG signal with approximations and details coefficient. In this
ways, fourth level approximation and details coefficients (cA4, cD1, cD2, cD3, and
cD4) are obtained [23]. In the present study, approximations coefficient of recon-
structed signal by using 4th level Daubechies 4 (db4) wavelet filter is utilized to form
the feature vector.

Fig. 3. Original sEMG signal with approximations and details coefficient obtained by DWT
224 Y. Narayan et al.

2.4 Ensemble Classifiers


Generally, the base classifiers are used to construct the ensemble classifier. Three-fold
cross validation is carried out using different ensemble algorithm. All bagging and
boosting algorithm uses tree classifier as base classifiers whereas subspace algorithm
can use either k-nearest neighbor (K-NN) learner or discriminant analysis classifier
[24]. The Bagging algorithm forms a deep tree which is memory intensive and time-
consuming resulting relatively slow predictions. It utilized the aggregated ensemble of
complex decision trees. Boosted tree creates an ensemble of medium decision trees. As
compared to bagging and boosting algorithm, AdaBoost algorithm require relatively
little time or memory but might need more ensemble members. Bagged tree is also
known as bootstrap aggregated which utilized the ensemble of complex decision trees.
Subspace discriminant model creates an ensemble of discriminant classifiers using
random subspace algorithm. It is good for many predictors, low on memory usage,
relatively fast for fitting and prediction but the accuracy varies depending upon the
data. RUSBoosted tree can be used for skewed data with many more observations of
one class. RUS stand for the random undersampling. In the present study, bag, Ada-
boost, RUSBoost, subspace, LogitBoost, GentleBoost ensemble methods are critically
compared to each other to find the best methods for elbow movement classification.
Bag ensemble algorithm uses 34 decision tree learners with 27 numbers of splits
whereas AdaBoost and RUSBoost algorithms utilized the same number of the decision
tree and split with 0.1 learning rate. In the first case, subspace ensemble algorithm uses
35 discriminant learners with 13 subspace dimensions and in the second case, subspace
algorithm use 31 nearest neighbors learner with 9 dimensions. LogitBoost and Gen-
tleBoost algorithm use 30 decision tree learners with 20 numbers of splits with 0.1
learning rate.

3 Results and Discussion

This section discusses the classification performance of different ensemble algorithm


used for sEMG signal classification for controlling the robotic arm prototype using
PCA and DWT approaches. Three types of classifier namely as a decision tree, dis-
criminant analysis, K-NN were used as base classifiers and their results were utilized by
various ensemble algorithm. De-noising and decomposition of sEMG signal were done
by using db4 wavelet filter with 4th scale level. DWT based residual features were
combined to form feature vector with TD and FD features. The performance of various
ensemble algorithms was done using the number of True Negative (TN), True Positive
(TP), False Negative (FN) and False Positive (FP) value obtained from the confusion
matrix. Different ensemble algorithms with their subtypes namely as Bagging, Ada-
Boost, RUSBoost, subspace discriminant, subspace K-NN, LogitBoost, and Gentle-
Boost were applied for classification of sEMG signals. Table 2 shows the comparative
results of ensemble algorithms in term of various parameters and Table 3 shows the
corresponding confusion matrix which is based on true class and predicted class
relationship. The performance evaluation of classification algorithms is done on the
basis of Accuracy (ACC) and Area Under Curve (AUC) but there are many different
Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 225

parameters like Specificity (SP) and Sensitivity (SE) which can also define the accuracy
in other terms.

Table 2. Ensemble algorithms performance evaluation


Classification ACC SP SE FDR PPV F-measure AUC Speed
algorithm (%) (%) (%) (%) (%) (%) (%) (obs/sec)
Bagging 98.7 98.3 99.1 0.7 98.3 98.7 100 380
AdaBoost 49.1 39.3 59 50.7 49.3 53.7 100 1100
RUSBoost 49.1 39.3 59 50.7 49.3 53.7 100 1200
Subspace 100 100 100 0 100 100 100 370
discriminant
Subspace K-NN 97.3 97.3 97.3 0.6 97.3 97.3 99 240
LogitBoost 97.9 96.6 99.1 0.3 96.7 97.9 99 400
GentleBoost 97.9 96.6 99.1 0.3 96.7 97.9 99 400

Table 3. Confusion matrix of different classifiers


Serial no. Classifier Detector decision Actual decision
(%)
Flexion Extension
1 Bagging Flexion 99 1
Extension 2 98
2 AdaBoost Flexion 59 41
Extension 61 39
3 RUSBoost Flexion 59 41
Extension 61 39
4 Subspace discriminant Flexion 100 0
Extension 0 100
5 Subspace KNN Flexion 97 3
Extension 3 97
6 LogitBoost Flexion 99 1
Extension 3 97
7 GentleBoost Flexion 99 1
Extension 3 97

3.1 Performance Metrics


The ensemble algorithms were compared by using False Discovery Rate (FDR),
Positive Predictive Value (PPV), Specificity (true negative ratio), Sensitivity (true
positive ratio), AUC, F-measure, and ACC. F-measure is also called F-score which is
very familiar parameter playing a major role in classification accuracy estimation.
226 Y. Narayan et al.

Receiver Operating Characteristic (ROC) curve yield relationship between specificity


and sensitivity. The following parameters are calculated for performance comparison:

FP
FDR ¼  100 ð18Þ
TP þ FP
TP
PPV ¼  100 ð19Þ
TP þ FP
TN
SP ¼  100 ð20Þ
TN þ FP
TP
SE ¼  100 ð21Þ
TP þ FN
2TP
Fmeasure ¼ ð22Þ
2TP þ FP þ FN
TP þ TN
ACC ¼  100 ð23Þ
Total Population

The experimental work showed that subspace discriminant algorithm performs the
best as compared to any other ensemble classification algorithm. Subspace discriminant
algorithm achieved the best ACC, SE, SP, F-measure as well as other parameters.
Bagging algorithm exhibited the second best performance in term of ACC whereas
Subspace K-NN has the highest speed and RUSBoost required less training time.
AdaBoost and RUSBoost showed worst performance. Figure 4 is the graphical rep-
resentation of result in term of ACC, SE and FDR.

100
90
80
70 ACC (%)
60
50 SP (%)
40
30 FDR (%)
20
10
0

Fig. 4. Graphical representation of various classifiers performance


Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 227

Subspace discriminant ensemble methods are more effective as compared to the any
other ensemble classification algorithms which is also verified by ROC curve. ROC
curve is drawn between true positive rate and false positive rate of classifier. Figure 5
shows the ROC curve of subspace discriminant ensemble algorithm which is ideal
graph showing 100% true positive and 0% false positive rate. The overall performance
and reliability of subspace discriminant algorithm is also shown by AUC value of
curve. The AUC is one for subspace discriminant algorithm which is the best for the
classification of sEMG signals.

Fig. 5. ROC curve of subspace discriminant ensemble algorithm

3.2 Robotic Arm Controlling


After the classification of sEMG signals, the output of classifier i.e. ACC is utilized for
generating the control signal using arduino microcontroller to control the elbow
movement of the robotic arm prototype. The control signal generated from the
microcontroller is in the form of pulse as shown in Fig. 6. This control pulse signal is
used to interface the robotic arm through driver circuit. If the amplitude of control
signal is 1 mV then it represents the elbow flexion class. If the amplitude of control
signal is 0 mV, then it represents the elbow extension class. In this ways, the output of
classifier is utilized for generating the control pulse to open and close the robotic arm
prototype. This control signal can also be utilized for controlling the other motion of
arm.
228 Y. Narayan et al.

Fig. 6. Controller output for arm end effector controlling

4 Conclusion

This paper discusses the usefulness of ensemble algorithm with DWT, SFFS algorithm,
and PCA for controlling the elbow motion of the robotic arm prototype. The 4th scale
db4 wavelet filter is utilized for better de-noising and residual feature extraction. Based
on the classification results of different ensemble classification algorithms, subspace
discriminant algorithm are found best with db4 wavelet filter for the myoelectric control
system. Subspace discriminant ensemble algorithm enhanced the classification accu-
racy by majority voting of 35 discriminant classifier as base classifier. The SFFS
algorithm sorted the feature resulting low dimensional feature vector and PCA further
reduces the dimension so enhancing the speed of classification algorithm for control-
ling the elbow motion of robotic arm prototype model.
In the future, Subspace discriminant ensemble algorithm can be used for devel-
oping the upper and lower limb. This approach can be used for wireless control of
robotic device and drone helicopter if the concept of networked control system is
combined with it.

References
1. Ryait, H.S., Arora, A.S., Agarwal, R.: SEMG signal analysis at acupressure points for elbow
movement. J. Electromyogr. Kinesiol. 21, 868–876 (2011)
2. Gams, A., Petric, T., Debevec, T., Babic, J.: Effects of robotic knee-exoskeleton on human
energy expenditure. IEEE Trans. Biomed. Eng. 60, 1–9 (2013)
3. Kloosterman, M.G.M., Buurke, J.H., de Vries, W., Van der Woude, L.H.V., Rietman, J.S.:
Effect of power-assisted hand-rim wheelchair propulsion on shoulder load in experienced
wheelchair users: a pilot study with an instrumented wheelchair. Med. Eng. Phys. 37, 961–
968 (2015)
4. Phinyomark, A., Phukpattaranont, P., Limsakul, C.: A review of control methods for electric
power wheelchairs based on electromyography signals with special emphasis on pattern
recognition. IETE Tech. Rev. (Institution Electron. Telecommun. Eng. India) 28, 316–326
(2011)
Surface EMG Signal Classification Using Ensemble Algorithm, PCA and DWT 229

5. Deep, A., Singh, J., Narayan, Y., Chatterji, S., Mathew, L.: Robotic arm controlling using
automated balancing platform. In: International Conference Communication, Control and
Intelligent Systems, CCIS 2015, pp. 282–285 (2016). https://doi.org/10.1109/ccintels.2015.
7437924
6. Phinyomark, A., et al.: EMG feature evaluation for improving myoelectric pattern
recognition robustness. Expert Syst. Appl. 40, 4832–4840 (2013)
7. Khushaba, R.N., Takruri, M., Miro, J.V., Kodagoda, S.: Towards limb position invariant
myoelectric pattern recognition using time-dependent spectral features. Neural Netw. 55,
42–58 (2014)
8. Farid, D.M., Zhang, L., Rahman, C.M., Hossain, M.A., Strachan, R.: Hybrid decision tree
and naïve Bayes classifiers for multi-class classification tasks. Expert Syst. Appl. 41, 1937–
1946 (2014)
9. Khushaba, R.N., Al-Timemy, A., Kodagoda, S., Nazarpour, K.: Combined influence of
forearm orientation and muscular contraction on EMG pattern recognition. Expert Syst.
Appl. 61, 154–161 (2016)
10. Pan, L., Zhang, D., Sheng, X., Zhu, X.: Improved myoelectric control for amputees through
transcranial direct current stimulation. IEEE Trans. Biomed. Eng. 9294, 1–11 (2015)
11. Garg, C., Narayan, Y., Mathew, L.: Development of a software module for feature extraction
and classification of EMG signals. In: 2015 Communication, Control and Intelligent
Systems, CCIS, vol. 1, pp. 250–254 (2015)
12. Kumari, P., Narayan, Y., Ahlawat, V., Mathew, L.: Advance approach towards elbow
movement classification using discrete wavelet transform and quadratic support vector
machine. In: The International Conference on Communication and Computing Systems,
ICCCS 2016, pp. 978–981 (2017)
13. Narayan, Y., Kumari, P., Mathew, L.: Elbow movement classification of a robotic arm using
wavelet packet and cubic SVM. In: The International Conference on Communication and
Computing Systems, ICCCS 2016, pp. 605–610 (2017). https://doi.org/10.1201/
9781315364094-108
14. Phinyomark, A., Hu, H., Phukpattaranont, P., Limsakul, C.: Application of linear
discriminant analysis in dimensionality reduction for hand motion classification. Meas.
Sci. Rev. 12, 82–89 (2012)
15. Narayan, Y., Mathew, L., Chatterji, S.: sEMG signal classification using Discrete Wavelet
Transform and Decision Tree classifier. Int. J. Control Theory Appl. 10, 511–517 (2017)
16. Pudil, P., Novovi, J.: Floating search methods in feature selection. Pattern Recognit. Lett. 15,
1119–1125 (1994)
17. Alomari, F., Liu, G.: Novel hybrid soft computing pattern recognition system SVM-GAPSO
for classification of eight different hand motions. Optik (Stuttg) 126, 4757–4762 (2015)
18. Babita, Kumari, P., Narayan, Y., Mathew, L.: Binary movement classification of sEMG
signal using linear SVM and Wavelet Packet Transform. In: 1st IEEE International
Conference on Power Electronics, Intelligent Control and Energy Systems, ICPEICES 2016,
pp. 2–5 (2016). https://doi.org/10.1109/icpeices.2016.7853640
19. Ryu, J., Kim, D.H.: Real-time gait subphase detection using an EMG signal graph matching
(ESGM) algorithm based on EMG signals. Expert Syst. Appl. 85, 357–365 (2017)
20. Yan, R., Gao, R.X., Chen, X.: Wavelets for fault diagnosis of rotary machines: a review with
applications. Signal Process. 96, 1–15 (2014)
21. Narayan, Y.: A comparative analysis for haar wavelet efficiency to remove Gaussian and
speckle noise from image. In: 3rd 2016 International Conference on Computing for
Sustainable Global Development (2016)
230 Y. Narayan et al.

22. Virdi, P., Narayan, Y., Kumari, P., Mathew, L.: Discrete wavelet packet based elbow
movement classification using fine Gaussian SVM. In: 1st IEEE International Conference on
Power Electronics, Intelligent Control and Energy Systems, ICPEICES 2016, pp. 1–5
(2017). https://doi.org/10.1109/icpeices.2016.7853657
23. Garg, C., Mathew, L., Narayan, Y.: Fuzzy control of EMG based movement classification
with six degree of freedom. Int. J. Eng. Technol. Manag. Appl. Sci. 3, 73–77 (2015)
24. Geethanjali, P., Ray, K.K.: A low-cost real-time research platform for EMG pattern
recognition-based prosthetic hand. IEEE/ASME Trans. Mech. 20, 1948–1955 (2015)

You might also like