You are on page 1of 10

Journal of Medical Systems, Vol. 29, No. 3, June 2005 ( C 2005) DOI: 10.


Classication of EMG Signals Using PCA and FFT

Nihal Fatma Guler1,2 and Sabri Kocer1

In this study, the fast Fourier transform (FFT) analysis was applied to EMG signals recorded from ulnar nerves of 59 patients to interpret data. The data of the patients were diagnosed by the neurologists as 19 patients were normal, 20 patients had neuropathy and 20 patients had myopathy. The amount of FFT coefcients had been reduced by using principal components analysis (PCA). This would facilitate calculation and storage of EMG data. PCA coefcients were applied to multilayer perceptron (MLP) and support vector machine (SVM) and both classied systems of performance values were computed. Consequently, the results show that SVM has high anticipation level in the diagnosis of neuromuscular disorders. It is proved that its test performance is high compared with MLP.
KEY WORDS: multilayer perceptron (MLP); backpropagation (BP); fast Fourier transform (FFT); support vector machine (SVM); principal components analysis (PCA).

INTRODUCTION Electromyogram (EMG) which is a signal obtained by measuring the electrical activity in a muscle has been widely used both in clinical practice and in the rehabilitation eld.(1) Clinical analysis of the EMG is a powerful tool used to assist the diagnosis of neuromuscular disorders.(2) Articial neural network (ANN) is a valuable tool in the medical eld for the development of decision support systems.(3) ANN with backpropagation algorithm was used to predict dynamic tendon forces from EMG signals by Savalberg.(4) Moreover, an automatic diagnostic tool for neuromuscular disease, based on the feature extraction end classication of myoelectric patterns using neural network was described by Kumaravel.(1) Pattichs studied EMG signal in the two domains for motor unit action potential (MUAP) classication and disease identication by using neural network.(5) Moreover, Nussbaum used a model ANN to develop
1 Department

of Electronics and Computer Education, Faculty of Technical Education, Gazi University, Teknikokullar, Ankara, Turkey. 2 To whom correspondence should be addressed; e-mail: 241

2005 Springer Science+Business Media, Inc.


Guler and Kocer

for the prediction of muscle activity in response to stead -state external moment loads.(6) The rst Fourier transform (FFT) is most common method for determining the frequency spectrum of the EMG signal. The frequency spectrum of EMG is used to detect muscle fatigue (7) force production, and muscle ber signal conduction velocity.(8) Hiraiwa et al.(9) studied the recognition of the bend angles in ve ngers using parameters from FFT as features set. Farry and Walker (10) used the analyzing methods such as FFT or other frequency transforms. Moreover, the use of ANN system to differentiate the EEG, EMG and EOG power density spectra were used by Sarbadhikari.(11) Principal component analysis (PCA) decomposes the covariance structure of the dependent variables into orthogonal components by calculating the eigenvalues and eigenvectors of the data covariance matrix. Eigenvalues assist in making decisions about the number of orthogonal components that will be used in further analyses, while eigenvectors assist in determining the relationship between the original variables and these new components. Eigenvalues and eigenvectors transform the original variable space into a new set of variables, called principal components (PCs).(12) The FFT variables are ranked according to their variance, thereby reecting a decreasing importance as to their ability to capture the whole information content of the original data-set for signal reconstruction purposes. By virtue of its ability to reduce the complexity of the resulting feature space, the PCA is widely used in a number of pattern recognition applications; recently, it also played a role in the biomedical eld, e.g. for the discrimination of neurogenic and myopathic conditions using EMG signals.(13) It is well known that multilayer perceptrons (MLPs) are universal in the sense that they can approximate any continuous nonlinear function arbitrarily well on a compact interval. As a result MLPs became popular in order to parameterize nonlinear models and classiers, often leading to improved results compared to classical methods. One of the major drawbacks is that MLPs usually solves a nonlinear optimization problem, which has many local minima. SVM is a recently developed pattern classication algorithm with nonlinear formulation.(14) It is based on the idea that the classication that affords dot-products can be computed efciently in higher-dimensional feature spaces.(15) The classes which are not linearly separable in the original parametric space can be linearly separated in the higher-dimensional feature space. Because of this, SVM has the advantage that it can handle the classes with complex nonlinear decision boundaries. Moreover, there are rather few applications in the bioengineering eld and, in particular, in neurology.(16) In an attempt, the present contribution is devoted to applying SVM to classify EMG signals. In this study, the FFT feature sets were computed for each subject. Subsequently, each feature set was subjected to dimensionality reduction using PCA, so as not to overwhelm the classier with high-dimensional data. These input parameters are divided into training, cross-validation and test sets. SVM and MLP are then trained and tested. In testing phase, the classication performance of SVM and MLP are compared with each other.

Classication of EMG Signals Using PCA and FFT


MATERIAL AND METHOD Measurement of EMG Signals All the EMG signals are acquired by using surface electrodes. EMG signals are then amplied and ltered with a 51000 Hz bandpass lter. A direct interface between the circuits and the computer is accomplished using the National Instruments DAQ board (PCI-MIO-16XE-10). Signals are digitized in A/D conversion with 16-bit resolution. The sampling rate was set to 100 kHz, which may be chosen as required. The data at the output of A/D converter is stored on hard disk of computer. The stored EMG signal is subject to feature extraction, in his case producing a feature set consisting of FFT coefcients. This feature set is then subject to dimensionality reduction using PCA. PCA coefcients are used by SVM and MLP to classify the EMG signals belonging to myopathy, neuropathy and normal subjects. Experimental Protocol All records of EMG data at Neurological Service of the Hacettepe University Hospital between September 2001 and May 2002 were reviewed. The nerves and muscles tested have been carefully chosen by the expert doctors. Diagnostic criteria for the subjects selected were based on clinical team, on the other hand if it is required, muscle biopsy can be performed. Neuromuscular diseases such as myopathy, neuropathy related to subjects were evaluated by expert doctors. All the EMG data, collected from 59 subjects have been analyzed. Data were recorded from 19 normal subjects, 20 subjects suffering from myopathy, and 20 subjects suffering from neuropathy. Mean age of the subjects is 28 0.5 years. Filter settings on the EMG machine were adjusted to 20 Hz for lower frequency and 1 kHz for higher frequency. The sampling frequency was set to 5 kHz for all the runs. The recording period was 4 s. EMG recordings were made on the patients in supine position and lying comfortably in a quiet laboratory room. For surface recordings two different bar electrodes were used. For adults, 40 mm sensory bar electrode, and for children and infants, 20 mm sensory bar electrode is used. Two different muscle groups were selected for measurement: biceps and hypothenar group. At biceps, anode of surface electrode was placed on tendon and cathode was placed on belly of the muscle. Recording was performed while maximum forearm exion. At hypothenar group, anode of surface electrode was placed on head of fth metacarpus, and cathode was placed on belly of abductor digitiminimi muscle. Recording was performed while maximum nger abduction. Dimensionality Reduction of the EMG Signals In order to make meaning of EMG signal, spectral analysis should be applied to EMG signal. For this reason, FFT method can be applied to the EMG signal, which is nonstationary since the algorithm of FFT is not complex. In order to take the FFT of a nite EMG signal, it must be framed with the powers of 2, such as 128,


Guler and Kocer

256, etc. Windowing technique is used to evaluate the frequency spectrum for the corresponding frame. By using windowing, the non-existing frequency components appearing in the spectrum are presented. In addition, zero padding is applied to the same signal after windowing process. This entails overhead on the process although it increases the readability of spectrum. Fourier analysis is extremely useful for data analysis, as it breaks down a signal into constituent sinusoids of different frequencies. For sampled vector data, Fourier analysis is performed using the discrete Fourier transform (DFT). The fast Fourier transform (FFT) is an efcient algorithm for computing the DFT of a sequence; it is not a separate transform. It is particularly useful in areas such as signal and image processing, where its uses ltering, convolution, and frequency analysis to power spectrum estimation. The FFT analysis produces a large number of coefcients, rarely larger than the number of points in the original waveform. Therefore, the amount of FFT coefcients has to be reduced using PCA. In order to reduce the volume and to maximize information content of the input data, a compression technique has been applied prior to input the data to the MLP and SVM classiers. This provides data compression for both training and testing datasets, and reduces the dimensionality of the classier network weight space as well. In addition, training and testing on the basis of the EMG signals could contain many redundancies and nonessential information, which may lead to a lengthy training process.(17)

Multilayer Perception MLPs are simplest and therefore most commonly used neural network architectures.(17) An MLP consists of three layers: an input layer, an output layer and an intermediate or hidden layer. Processing element (PEs) or neurons in the input layer only act as buffers for distributing the signals xi to PEs in the hidden layer. Each PE j in the hidden layer sums up its input signals xi after weighting them with the strengths of the respective connections wij from the input layer and computes its output yi as a function f of the sum, yi = f wj i xi (1)

f can be a simple threshold function, hyperbolic tangent function of the output of PEs in the output layer is computed similarly. Standard backpropagation (BP) is a gradient descent technique to minimize some error criteria E and gives the change wj i (k) in the weight of a connection between PEs i and j as follows, wj i (k) = E + wj i (k 1) wj i (2)

where is a parameter called the learning coefcient and the momentum coefcient.(18)

Classication of EMG Signals Using PCA and FFT


Support Vector Machine Support vector machine is a method for nding a hyperplane in a highdimensional space that separates training samples of each class while maximizes the minimum distance between the hyperplane and any training samples.(19) SVM approach can apply any kind of network architecture and optimization function. The advantage of SVM is that it can place each data sample with Gaussian distribution so as to transform the complex decision surface into a simpler surface and then use linear discriminant functions. The learning algorithm employed Adatron algorithm. Adatron algorithm substitutes the inner product of patterns in the input space by the kernel function. The performance function is used as presented in(20) : J (xi ) = i

j wj G(xi xj , 22 ) + b


j =1

M = min J (xi )


where i is the multiplier, wi the weight, G the Gaussian distribution and b the bias. While M is greater than the threshold, we choose a pattern xi to perform the update. After update only some of the weights are different from zero (called the support vectors), they correspond to the samples that are closest to the boundary between classes. Adatron algorithm uses only those inputs for training that are near the decision surface since they provide most of the information about the classication, so it provides good generalization and generally yields no overtting problems, so we do not need the cross-validation set to stop training early. The Adatron algorithm can prune so that its output for testing is given by g(x) = sgn

i wi G(x xi , 22 ) b


so it can adapt an SVM to have an optimal margin. Receiver Operating Characteristic (ROC) For comparison of the diagnostic accuracy of the different classication methods and groups, the concept of receiver operating characteristic (ROC) analysis was used. ROC analysis is an appropriate means to display sensitivity and specicity relationships when a predictive output for two possibilities is continuous. In its tabular form the ROC analysis displays true and false positive and negative totals and sensitivity and specicity for each listed cutoff value between 0 and 1. The ROC curves are a more complete representation of the classication performance than the report of a single pair of sensitivity and specicity value.(21) In order to analyze the output data that are obtained from the application, sensitivity (true positive ratio) and specicity (true negative ratio) are calculated by using confusion matrix. Sensitivity value (true positive, same positive result with the diagnosis of expert physicians) is calculated by dividing the total of diagnosis numbers to total


Guler and Kocer

diagnosis numbers that are stated by the expert physicians. The performance of classication can be determined through correct classication (CC), sensitivity (SE), and specicity (SP) analysis. In order to perform the performance measure of the output classication graphically, ROC curve is calculated by analyzing the output data obtained from the test. The relation between sensitivity and specicity may be seen in this graphic by examining the correct and incorrect classication information. Furthermore, the performance of the model may be measured by calculating the region under the ROC curve. RESULTS AND DISCUSSION In this study, EMG signals obtained from ulnar nerve area of the patients were recorded. The number of total subjects tested is 59. Due to randomness of EMG signals, FFT analysis model was used. The power spectrum analysis of EMG can be used as a diagnostic tool in patients with neuromuscular disorders.(22) It is possible to divide the patients into two main groups: adults and infants. Those who are under the age of 7 were classied as infants; and those who are above the age of 8 were classied as adults. Distribution proles belonging to the patients are summarized in Table I. The amount of FFT coefcients was reduced with PCA to be able to reduce the computing expense and enable the diagnosis to become faster and easier. Fiftynine PCA coefcients were the input vectors in MLP and SVM. Twenty-seven of 59 subjects were used for training set, 27 of them were used for test set and the rest of them were used as cross-validation set. Desired output values obtained from input vectors of EMG signals were determined as [1 0 0] (myopathy), [0 1 0] (neuropathy) and [0 0 1] (normal) vectors. Traditional knowledge from data modeling and recent developments in learning theory clearly indicates that after a critical point an MLP trained with backpropagation will continue to do better in the training set, but the test set performance will begin to deteriorate.(14) One method to solve this problem is to stop training at the point of maximum generalization. This method is called stopping with crossvalidation. There may be some increase in classication performance in terms of determining the hidden layer number of MLP architecture and the neuron number of this layer at an optimum level. In Table II, performance values in different MLP topologies were given. Training was stopped by using cross-validation. In Table II, performance values of different MLP and RBF topologies have been listed in the table TrError and TeError are the error values from training and
Table I. Patient distribution by age among disorders Myopathy Infants (ages 0,2, . . . , 7) Adults (ages 7, . . . , 58) All 8 12 20 Normal 9 10 19 Neuropathy 9 11 20

Classication of EMG Signals Using PCA and FFT Table II. Performance Values in Different MLP Topologies Inputs 1 3 3 3 4 3 3 3 3 3 3 3 3 3 3 Hidden 1 1 2 4 12 5 5 5 7 4 7 3 4 3 6 Hidden(2) 15 5 10 4 4 6 3 6 3 6 TError 0.369 0.355 0.264 0.243 0.238 0.237 0.245 0.248 0.247 0.249 0.245 0.253 0.256 0.252 0.241 TeError 0.373 0.359 0.246 0.237 0.245 0.243 0.241 0.234 0.238 0.240 0.245 0.243 0.238 0.236 0.241


test sets, respectively. This is the root mean square (RMS) of the errors on each individual case, where the error on each individual case is measured by the networks error function. The error test gives a nal check of the performance of the network. As it is demonstrated in Table II, minimum errors were obtained in 3-6-6-3 MLP topology with BP algorithm. BP algorithm of error gradients has shown to be capable of training feedforward neural networks to tackle a large number of classications. However, BP algorithm is generally slow and easily makes MLP plunge into local minimum. After training phase, the testing of the MLP with BP algorithm and SVM were done. The EMG data, that the network had not been trained before, were applied to the MLP and SVM for testing the network performance in Table III. The best percentage of classication (85.42) is obtained in SVM. However, 84.16% classication with MLP is close to the one with SVM performance. Moreover, the balance between sensitivity and specicity in SVM is better than the one in MLP. The value of the area under the ROC curve has shown the performance classication. The bigger is the area under the ROC curve, the higher is the probability of making a correct decision. If ROC in Fig. 1 is examined, SVM classier shows a higher performance with area of 0.923 and MLP classiers has shown slightly lower performance over the entire ROC space with area of 0.916.

Table III. Testing Results for MLP and SVM CC (%) SVM MLP 85.42 84.16 SE (%) 70.64 68.75 SP (%) 97.71 97.65

Note. The CC, SE, and SP are, respectively, the percentages of correct classication, sensitivity, and specicity.


Fig. 1. ROC curve belonging to MLP and SVM. Guler and Kocer

Classication of EMG Signals Using PCA and FFT


It is important to indicate the differences between the SVM and MLP. First, the SVM always nds a global solution that is in contrast to the MLP. On the other hand, the SVM does not minimizes the empirical training error but MLP does. Instead it minimizes the sum of an upper bound on the empirical training error and a penalty term that depends on the complexity of the classier used. Therefore, the proposed method seems to be a potentially useful tool for the automated diagnosis of neuromuscular disorders. CONCLUSION In this study, the classication performances of SVM and MLP were compared in the case of neuromuscular disorders. In order to examine the diagnosis performance of the neuromuscular disorders, myopathy, neuropathy and normal subjects were used. Since mathematically based interpretations require quantitative data spectral analysis was performed. The derived EMG signals were analyzed by FFT. To enable the diagnosis to become faster and easier, PCA coefcients were used as input parameters for SVM and MLP. The optimum MLP architecture is 3-6-6-3 topology. When test performances of both classication systems are examined, the highest percentage of correct classication (85.42) is found in SVM. ROC analysis results of both classications have indicated that SVM shows a higher performance. The results by SVM and ANN classication systems are very similar; however we believe that SVM is a more practical solution to our application: SVM has a signicant advantage compared to ANN as SVM can achieve a trade-off between false positives and false negatives, SVM always converges to the same solution for a given dataset regardless of the initial conditions, and nally, SVM removes the danger of over tting. In conclusion, the SVM learning technique, has shown high anticipation level and has proved this by its test performances when compared to MLP technique in the diagnosis of neuromuscular disorders. REFERENCES
1. Kumaravel, N., and Kavitha, V., Automatic diagnosis of neuromuscular disease using neural network. Biomed. Sci. Instrum. 90:245250, 1994. 2. Butchal, F., An Introduction to EMG, Copenhagen, Gyldendal, 1957. 3. Frize, M., Ennett, M., Stevenson, M., and Trigg, C. E., Clinical decision support for intensive care unit using ANN. Med. Eng. Phys. 23:217222, 52001. 4. Savelberg, H. H., and Herzog, W., Prediction of dynamic tendon forces from electromyographic signals: An articial neural network approach. J. Neurosci. Methods 30:6574, 1997. 5. Pattichis, C. S., Schoeld, I. S., and Fawcett, P., A morphological analysis of the macro motor unit potential. Med. Eng. Phys. 21(10):673679, 1999. 6. Nussbaum, M. A., Chafn, D. B., and Martin, B. J., A back-propagation neural network model of lumbar muscle recruitment during moderate static exertions. J. Biomech. 28(9):10151024, 1995. 7. Bigland-Ritchie, B., Donovan, E. F., and Roussos, C. S., Conduction velocity and EMG power spectrum changes in fatigue of sustained maximal efforts. J. Appl. Physiol. 51(5):13001305, 1981. 8. Blinowska, A., Verroust, J., and Cannet, G., The determination of motor unit characteristics from the low frequency electromyographic power spectra. Electromyogr. Clin. Neurophysiol. 19:281290, 1979.


Guler and Kocer

9. Hiraiwa, A., Shimohara, K., and Tokunaga, Y., EMG pattern analysis and classication by neural network and application to prosthetic forearm control. IEEE Int. Joint Conf. Neural Netw., Singapore 12141219, 1991. 10. Farry, K. A., and Walker, I. D., Myoelectric teleoperation of a complex robotic hand. IEEE Trans. Robotics Aut. 12(5):775788, 1996. 11. Sarbadhikari, S. N., A neural network conrms that physical exercise reverses EEG changes in depressed rats. Med. Eng. Phys. 17(18):579582, 1995. 12. Perez, M. A., and , Nussbaum, M. A., Principal components analysis as an evaluation and classication tool for lower torso sEMG data. J. Biomech. 36:12251229, 2003. 13. Pfeiffer, G., and Kunze, K., Discriminant classication of motor unit potentials (MUPs) successfully separates neurogenic and myopathic conditions. A comparison of multi- and univariate diagnostical algorithms for MUP analysis. Electroenceph. Clin. Neurophysiol. 97:191207, 1995. 14. Vapnik, V. N., Statistical Learning Theory, Wiley Series on Adaptive and Learning Systems for Signal Processing, Communications and Control, Wiley, New York, 1998. 15. Hearst, M. A., Dumais, S. T., Osman, E., Platt, J., and Scholkopf, B., Support vector machines. IEEE Intell. Syst. 13(4):1828, 1998. 16. Millet-Roig, J., Ventura-Galiano, R., Chorro-Gasco, F. J., and Cebrian, A., Support vector machine for arrhythmia discrimination with wavelet transform-based feature selection. IEEE Comput. Cardiol. 407410, 2000. 17. Bishop, C. M., Neural Networks for Pattern Recognition, Oxford University Press, 1995. 18. Fredric, M. H., and Ivca, K., Principles of Neurocomputing for Science and Engineering, McGrawHill, New York, 2001. 19. Cortes, C., and Vapnik, V., Support Vector Machines, Machine Learning, 1995. 20. Pricipe, J. C., Neil, R. E., and Lefebvre, W. C., Neural and Adaptive Systems Fundementals Through Simulations, John Wiley & Sons, 2000. 21. Hanley, J. A., and McNeil, B. J., The meaning and use of the area under the Receiver Operating Characteristic (ROC) curve. Radiology 143:2936, 1982. 22. Fuglsang-Frederiksen, A., and Ronager, J., EMG power spectrum, turns-amplitude analysis and motor unit potential duration in neuromuscular disorders. J. Neurol. Sci. 97(1) 8191, 1990.