projectreportemg

Embed Size (px)

Citation preview

  • 8/4/2019 projectreportemg

    1/9

    EMG Pattern Classification

    Project Progress ReportEngr 9881 Pattern Analysis and Machine Intelligence

    B.M.Oscar De Silva201070588

    Faculty of Engineering and Applied Science

    Memorial University of NewfoundlandWinter 2011

    submitted to:George Mann & Jeannette Byrne

    Abstract

    This report documents the progress of the course project for Engr 9881. The

    project attempts to implement a machine learning algorithm for identifying usermanipulation tasks using only Electro myography signals as the input source. Re-sults for a Linear Discriminant Analysis based classifier is reported. This will furtherbe compared with support vector machine and neural network based classifiers infuture studies.

    KEY INDEXING TERMS: Upper limb prosthetics, Myoelectric control. Pat-tern Recognition, Linear Discriminant Analysis

    1 Introduction

    EMG based control strategies are extensively used for powered upper limb prosthetics.It has improved from simple threshold control strategies, to more complex pattern recog-nition based strategies. Pattern recognition techniques was first proposed by Hudgins etal.[1] using Multilayer Perceptron learning algorithm, utilizing the transient EMG signal.This was later developed in to continuous classification using steady state myoelectricsignals [2]. Together with novel surgical procedures [3], this has enabled multifunctionalcontrol of upper limb prosthetics (i.e. controlling higher number of degrees of freedomusing a limited set of input signals). Different Pattern recognition algorithms are appre-ciated in literature for the purpose. Table 1 summarizes some of the methods and theirperformances.

  • 8/4/2019 projectreportemg

    2/9

    Reference Year Featureset/Segmentation

    Classifier Channels/Classes

    ClassifierError

    Delay

    Hudgins et al.[1] 1993 TD 5 featureset,40ms 5 segmentsof onset signal

    ANN-MLP

    2 channel 4classclassifier

    16-2% 250ms

    Chan et al.[4] 2000 TD 4 featureset,40ms 6 segmentsof onset signal

    AdaptiveFUZZY

    2 channel 4classclassifier

    10-1.3%

  • 8/4/2019 projectreportemg

    3/9

    2 LDA based EMG classification

    While classification of EMG can be performed in various techniques. Literature suggest

    that Linear discriminant analysis based classifiers performance is comparable to muchstronger but rather expensive neural network based techniques. So for this project initialstudies implements a LDA based classifier to a myoelectric dataset.

    2.1 Experiment

    The work replicates main procedure reported in [2] with some minor additions. 4 surfaceelectrodes placed on wrist flexors, extensor, unlnar and radial deviators. These wereused to capture resulting myoelectric signals during wrist flexion, wrist extension, ulnardeviation, radial deviation and grip tasks. These tasks were performed sequentially andrepresented by indexes 0 to 5 in order. This one cycle of 5 tasks was repeated 20 times.

    The data sets were sampled at 1 KHz using an EMG recording system at the School ofHuman Kinetics and Recreation- Human movement analysis lab under expert supervision.

    0 5 10 15 20 25

    2

    0

    2

    Channel1

    0 5 10 15 20 25

    2

    0

    2

    Channe

    l2

    0 5 10 15 20 25

    2

    0

    2

    Channel3

    0 5 10 15 20 25

    2

    0

    2

    C

    hannel4

    Time(s)

    Figure 2: Raw EMG signal of 4 channels for 1 trial

    2.2 Data Segmentation

    The continuous windowing scheme proposed by Englehart et al. was utilized in thestudy. A continuous windowing exploits the full process capability of the available signal

    3

  • 8/4/2019 projectreportemg

    4/9

    processor which produces denser decision streams. The window length is kept at 32 msand the process time delay used for advancing the window is set to 16 ms. These valueswere the optimal parameters reported in [2]. Although the process time delay should be

    set to the actual hardware speed for best results when used in embedded setting.

    2.3 Feature Extraction

    4 features were extracted from each EMG channel according to the data segmentationscheme selected. This includes Mean Absolute value MAV, Zero crossings (ZC), Signchanges (SC) and Signal length. This constitutes a 16 dimension feature vector for thepattern recognition task . The output vector carried an index representing the state (task)the arm was performing.

    0 5 10 15 20 250

    0.5

    Ch.1MAV

    0 5 10 15 20 250

    0.5

    1

    Ch.2MAV

    0 5 10 15 20 250

    0.5

    1

    Ch

    .3MAV

    0 5 10 15 20 250

    0.5

    1

    Ch.4MAV

    0 5 10 15 20 250

    5

    State

    Time(s)

    Figure 3: Feature 1 extracted from the 4 channels and corresponding state(task per-formed)

    2.4 Class Extraction

    Although there was a labeled dataset with an assigned class per 5 second window, the

    task was initiated from rest and terminated to rest during the 5 second period. By usingthreshholds at the corresponding muscles EMG level the period which the arm was resting

    4

  • 8/4/2019 projectreportemg

    5/9

    can be identified. But because of muscle fatigue and the stochastic nature of the signalcorresponding to grip task, some class extractions would be erroneous. This could havebeen eliminated during experiment if the task was continually performed throughout the

    5 second period.

    2.5 Feature reduction

    Linear discriminant analysis (LDA) was performed to reduce the feature space in to asimpler space with classifiable data points. LDA reduces the 16 dimensional space in to 5dimensions, in the 6 class classification case. As example figure 4 illustrates the reducedfeature space for the 16 feature 3 class problem.

    0.3 0.2 0.1 0 0.1 0.2 0.3 0.40

    0.5

    1

    1.5

    2

    2.5

    Rest S1

    Wrist Flexion S2

    Wrist Extension S3

    Figure 4: Reduced feature space for three classes using Linear Discriminant Analysis

    For this particular study a Pairwise Linear Discriminant analysis was used. Thisincreases the 16 feature 6 class classification problem in to 15 problems of bi-classification.At the same time reducing the feature space to 1 dimension.

    A rather interesting result was identified by analyzing the reduced dimensional space.All class given probabilities were resembling very closely to gaussian distributions ex-cept class 0 which was rest. This resembled a Gamma distribution. This observationgives the ability to appreciate Generative Learning algorithms as classifiers to this data.Although logistic regression was used for classification in this study.

    5

  • 8/4/2019 projectreportemg

    6/9

    0

    20

    40

    60

    80

    100

    120

    140

    160

    180

    200

    0

    20

    40

    60

    80

    100

    120

    140

    160

    180

    200

    50

    100

    150

    200

    250

    Figure 5: Reduced feature spaces from pairwise linear discrimination, for class pairs 2-3,2-5 and 5-6 in order,with the class given probability distributions and logistic regressionresults for each pair.

    6

  • 8/4/2019 projectreportemg

    7/9

    2.6 Supervised Learning

    A pairwise Logistic regression was performed with maximum likelihood parameter esti-mation. A gradient accent algorithm was used for Likelihood maximization(learning).

    Cost functions were observed, to verify learning and convergence. For supervised learningthe first ten trials of data was used. Figure 5 illustrates the results for 3 class pairs. 15such discriminative functions were trained for this particular study. It is also possible touse other classifiers such as neural networks, support vector machines etc. in the reducedfeature space, for classification of data.

    2.7 Validation

    After learning the logistic function for each class, the last 10 trials of data were presentedto this classifier for validation. The classifier calculates posteriori probabilities of each

    feature set to select the class with maximum posteriori probability of the discriminantfunction pairs. For human use it is acceptable to have a maximum delay of 300ms. Butfor processing of a decision 16ms is used. So maximum voting post processing scheme wasused in a 128ms window (i.e 8 decisions). An 89% classification accuracy was observedusing this method ,although higher accuracies is expected after the errors in class ex-traction is exploited (Figure 7). Even though optimal parameters for data segmentationreported in [2] was used in the study, it was observed that 64 ms data window improvedthe accuracy upto 92%. Further there was only little improvement observed between thedisjoint and continuous windowing schemes.

    2.8 Improvements

    The errors present in class extraction deteriorates the classifiers performance. So it isexpected to perform the experiment such that, a task is performed throughout the pre-defined time period to eliminate the requirement of class extraction. When the methodis applied for amputees , only isometric muscle contractions will be present. So it is moresuitable to use data sets with isometric muscle contractions for classifier performancecomparison.

    The classifier used here employed pairwise discrimination, which enables visualizationof the learning. But it would be ideal to implement the classification on all classes at onceusing softmax regression for speed of convergence.

    2.9 Future work

    As future work other classifier performances will be tested against the LDA based method.Specifically neural network based and support vector machine based classifiers will beutilized. This can be further improved by using higher order feature sets such as autoregressive features and wavelet transformations. It is expected to improve the methodfor realtime classification taking in to account classifier speeds and embedded myoelectricsignal processors.

    7

  • 8/4/2019 projectreportemg

    8/9

    0 1000 2000 30000

    1

    2

    3

    4

    5

    6

    Sample

    State

    Before MV postprocessing(86.80%)

    0 100 200 300 4000

    1

    2

    3

    4

    5

    6

    Sample

    State

    After MV postprocessing(89.76%)

    Actual state

    Classifier output

    Figure 6: Results of the classifier output for the Validation dataset. 32 ms data windowwith continuous windowing scheme.(only 2 out of 10 cycles are shown)

    References

    [1] B. Hudgins, P. Parker, and R. Scott, A new strategy for multifunction myoelectriccontrol, IEEE Transactions on Biomedical Engineering, vol. 40, pp. 8294, Jan. 1993.

    [2] K. Englehart and B. Hudgins, A robust, real-time control scheme for multifunctionmyoelectric control, Biomedical Engineering, IEEE Transactions on, vol. 50, no. 7,pp. 848854, 2003.

    [3] T. A. Kuiken, G. Li, B. A. Lock, R. D. Lipschutz, L. A. Miller, K. A. Stubblefield,

    and K. B. Englehart, Targeted muscle reinnervation for real-time myoelectric controlof multifunction artificial arms, Jama, vol. 301, no. 6, p. 619, 2009.

    [4] F. H. Chan, Y. S. Yang, F. K. Lam, Y. T. Zhang, and P. A. Parker, Fuzzy EMGclassification for prosthesis control, Rehabilitation Engineering, IEEE Transactionson, vol. 8, no. 3, p. 305311, 2002.

    [5] K. Englehart, B. Hudgin, and P. A. Parker, A wavelet-based continuous classifi-cation scheme for multifunction myoelectric control, Biomedical Engineering, IEEETransactions on, vol. 48, no. 3, p. 302311, 2002.

    8

  • 8/4/2019 projectreportemg

    9/9

    0 1000 2000 30000

    1

    2

    3

    4

    5

    6

    Sample

    State

    Before MV postprocessing(90.8%)

    0 100 200 300 4000

    1

    2

    3

    4

    5

    6

    Sample

    State

    After MV postprocessing(91.4%)

    Actual state

    Classifier output

    Figure 7: Results of the classifier output for the Validation dataset. 64 ms data windowwith continuous windowing scheme.(only 2 out of 10 cycles are shown)

    [6] Y. Huang, K. B. Englehart, B. Hudgins, and A. D. Chan, A gaussian mixture modelbased classification scheme for myoelectric control of powered upper limb prostheses,Biomedical Engineering, IEEE Transactions on, vol. 52, no. 11, p. 18011811, 2005.

    9