{'fraction_non_alphanumeric': 0.03142506535773355, 'fraction_numerical': 0.008056341033986022, 'mean_word_length': 4.927893738140417, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
EMG Signal Classification Using Reflection Coefficients and Extreme Value Machine

Electromyography is a promising approach to the gesture recognition of humans if an efficient classifier with high accuracy is available. In this paper, we propose to utilize Extreme Value Machine (EVM) as a high-performance algorithm for the classification of EMG signals. We employ reflection coefficients obtained from an Autoregressive (AR) model to train a set of classifiers. Our experimental results indicate that EVM has better accuracy in comparison to the conventional classifiers approved in the literature based on K-Nearest Neighbors (KNN) and Support Vector Machine (SVM).


I. INTRODUCTION
Limb amputation is a tragedy that could happen due to different reasons such as diabetes, vascular diseases, accidents or wars. Undoubtedly, mental and physical effects of missing a limb are severe and deprive individuals from normal daily activities. In the united states alone, it has been reported that the total number of upper limb amputees is about 41, 000 and is expected to grow by 131% by 2050 [1]. The monotonic relation between finger movement and that of its associated electromyography (EMG) signal can be explored to control prosthetics. EMG is a technique to measure the electrical activity of nerve's stimulation during the contraction. The data is collected by EMG electrodes placed on the surface of skin or intrusive into the skin in direct contact with the muscles [2].
In fact, pattern recognition is a saddle point in dealing with EMG signals to classify these signals and relate the specified class to the corresponding command [3], [4]. The feature extraction from EMG signals should be done such that the corresponding class with specific signal could be detected [5]. Various feature extraction methods and classification algorithms have been employed by researchers in time and frequency domains [6], [7]. Then, various optimization methods such as Particle Swarm Optimization (PSO) and Genetic algorithm [8], [9] can be applied to select a set of features with significant importance.
The number of extracted features depends on the number of EMG sensors and feature extraction strategy for each sensor. The dimensionality of features can thus be superabundant and may facilitate training of the system.
In [10], two EMG electrodes are used for classification of ten classes of finger movements. The feature extraction includes Time Domain (TD) features, Autoregressive (AR) plus Hjorth features of EMG signals followed by Support Vector Machine (SVM) and k-nearest neighbor (KNN) classifiers for pattern recognition. In [11], twelve surface EMG electrodes are employed to extract features by combining time domain features and autoregressive. Finally, they employed SVM as a classifier of finger gesture. A notch filter and a Butterworth Band Pass Filter are utilized in [12] to filter the signals. Then, the dataset and extracted features are normalized via Fractional Fourier Transform (FFT). Due to a large number of features, feature reduction is inevitable and is performed via t-test and windowing method. The final step in classification done by KNN [12]. Our research group has previously approximated spectral analysis of EMG signals and extracted features using reflection coefficients [13] and classified the results with SVM, without any feature reduction. It is shown in [14] that discrete wavelet transform followed by principal component analysis (PCA) and SVM could enhance the accuracy of classifications. Several other EMG classifiers have been applied using decision trees [15], random forest [16], KNN [12], Naïve Bayes classifier [17], and SVM [13], [18]. Also, it seems using ensemble learning [19] and other neural network architectures such as a multilayer perceptron (MLP) [20], convolutional neural network (CNN) [21], graph convolutional neural network (GCNN) [22], and recurrent neural network (RNN) [23] can significantly improve the classification accuracy.
Block diagram of our proposed mode is demonstrated in Figure 1. To the best of our knowledge, this is the first time that the extreme value machine is proposed for classification of EMG signals. In this paper, the reflection coefficients of an This paper is organized as follows. The background of EVM is described in Section 2. Thereafter, in Section 3, the preprocessing technique is explained and discussed how feature extraction is done. In Section 4, the datasets characteristics are elaborated, and disparate classifiers are applied to the same dataset and results are compared. Finally, conclusion is drawn in the last section.

II. EXTREME VALUE MACHINE A. Background Theory
Most of the classification algorithms do not consider the distribution of data in their learning process. Extreme Value Machine (EVM), derived from statistical Extreme Value Theory (EVT), is a distance-based kernel-free non-linear classifier which mainly focuses on the distribution of dataset especially at extreme values [24]. EVT is a reliable statistical approach to examine datasets that have too low or too high extreme values. In other words, EVT deals with stochastic behavior of rare observations that are unusually greater or smaller than other observations. This is important where the distribution of data at the tails of probability distribution is different from the ones at the center of distribution. More specifically, the advantage of EVT is originated from the fact that because of using the asymptotic theory, the extremes (the tails of dataset distribution) are modeled effectively [25].
Two different parametric methods have been proposed for finding the distribution of extreme values: peaks-overthreshold and block maxima [26]- [28]. In peaks-overthreshold approach, the concentration is only on the observations that exceed a pre-defined threshold. Threshold exceedance method converge to Generalized Pareto Distribution (GPD), a very popular extreme value model which could adequately extrapolate sufficiently high values located at the upper tail. In block maxima approach, the observation period is divided into nonoverlap periods with the same size. Maximum observation at each period is considered for defining the distribution. The probability distribution of such observations is approximately generalized extreme value (GEV) distribution [29].

B. Extreme Value Machine
In EVM, the key factor is to define decision boundary based on probabilistic distribution of each class based on the extreme vector of corresponding class. The extreme vectors are commonly the points that determine the decision boundary of each class in a compact probabilistic form. The Weibull distribution is often used to compute the radial probability of inclusion of point considering the neighbor ones. In fact, the aim of EVM is to select distributions of each class by extreme vectors and compact these probability distributions such that the decision boundary of classes could be determined. A Weibull distribution is fitted on margin distance of each extreme vector. Therefore, this distribution enables us to arrive to the decision boundary of each class could be defined with respect to its extreme vectors. Given a point to EVM, the probability of sample inclusion for the extreme vector of each class is calculated. If the inclusion probability of the sample point is more than a predefined threshold, the point is assigned to that class. For each point of the dataset like x i , the prediction for each class is calculated by: where x is feature of input, W l,k (x) is probability density function of Weibull for kth of extreme vector of class l, ξ is shape parameter of Weibull probability density functionm, µ is shift parameter of Weibull probability density functionm, and σ is scale parameter of Weibull probability density function.
Operation complexity of EVM is discussed in [24]. This classifier is hardware friendly and can run effectively on embedded system platform [30]. We used the Python (Pytorch) GPU accelerated EVM library of paper [29] available in GitHub repository [31].

A. Spectrum Estimation -Background
The myoelectric signal processing is applicable for gesture recognition of human hand based on the fact that there is a monotonic relationship between the properties of EMG signal and that of its related finger movement. Various finger gestures have different EMG signal with different properties. To find the pattern recognition in human hand, EMG signal should be scrutinized in real time. However, due to stochastic characteristics of the EMG signal, it is not processed instantaneously. Instead, it is processed in time blocks called sliding windows that can be overlapped or disjoint. Filtering of EMG signal is another inevitable part of signal processing as these signals are contaminated via environmental factors and therefore, the removal of the noise with filtering approaches is required such that valuable information of signal could be preserved.
Spectral analysis is a signal processing technique to discriminate properties of signals in various applications such as EMG signal and the corresponding finger movements. Based on stochastic nature of EMG signal, it is considered as a random process, and therefore, Fourier series of such condition could not be defined without using autocorrelation model. Autocorrelation model is the way to understand the spectral features of such random processes. This model is described as R(m) = E[V (n)V (n + m)]. R correlates the random processes with the m as the lag. Power spectral density is the Fourier transform of R. This transformation involves spectral characteristics of the signal and enables us to extract features in the frequency domain. As R is unknown, the PSD should be gained by estimation. Two different methods have been proposed for the estimation of PSD: non-parametric and parametric. Nonparametric methods utilize periodogram. The goal of periodogram is to identify innate periodic signals by finding the magnitude of different frequencies. However, the variance of estimation is about the square of its corresponding amount. But in parametric methods, the random process itself is considered as parametric model. The advantage of the latter method is that the amount of parameters for the PSD and models are approximately the same.

B. Parametric PSD -Reflection Coefficients
Let (n) denote a white noise with average zero and variance of σ 2 . For the stationary random process V (n), the auto-regressive model is represented as: where a i s are the model parameters and p denotes the order of the auto-regressive model. The model parameters are used to calculate the power spectral density of the stationary random process as: where i = √ −1. Different methods can be applied to adjust the model parameters such as Yule-Walker [32] method and Burg's method [33]. In this paper, we will focus on Burg's method to estimate the power spectral density of the input frame. Burg's method fits an auto-regressive model to the signal by minimizing (least squares) the forward and backward prediction errors. Such minimization occurs with the autoregressive parameters constrained to satisfy the Levinson-Durbin recursion. Then, without computing the autocorrelation function which is computationally expensive, Burg's method approximates the reflection coefficient directly. In Burg's method, equation (2) is reformulated as a Finite Impulse Response (FIR) filter, i.e., where in this configuration a 0 = 1. The p-order FIR filter contains p taps and is implemented by cascading p building components. The lattice structure of a p-order digital FIR filter is realized as a p-cascaded first-order lattice components. The lattice structure can be represented by scalar reflection coefficients k i as: where f i (n) and b i (n) are forward and backward prediction errors at the i-th stage, respectively. Historically, reflection coefficients are used for evaluating statistical hypothesis corresponding to the auto-regressive model. Considering V (n) as the input EMG signal, at the first stage we have: Also, for the the output of the final stage we expect: For the cases where the auto-regressive model parameters a i s are known, the reflection coefficients k i s are calculated iteratively; Burg's method provides a technique for parameter estimation of the auto-regressive. This technique is based on optimization of forward and backward prediction errors, i.e., f i (n) and b i (n) at the i-th stage.
The model order p is another unknown parameter that must be chosen carefully. Low order models are not able to catch the spetrum peaks and the result will produce a smooth spectra. Also, high order models would be sensitive to the noise and the output will induce false peaks in the spectra. Let K [k 1 , k 2 , · · · , k p ] denote the reflection coefficients of the model by choosing appropriate p empirically. In our work, vector K is considered as the extracted features from input EMG signals to be fed directly into a classifier.

A. Set up
In this paper, the EMG dataset collected at Sydney University [10] is used for feature extraction and classification. The reflection coefficients of the autoregressive model is used for feature extraction. Then, we will compare the accuracy results of EVM against seven well known classifications reported in the literature. We have implemented all classifiers (see Table I) in Python and ran them in a windows-based laptop with 3.00 GHz CPU and 16.0 GB memory.

B. Dataset
The dataset which is used in this paper is provided by Center of Intelligent Mechatronic Systems at the University of Technology at Sydney [10]. This dataset includes EMG data of eight participants (six men and two women at the range of 25 to 30 years old) performing ten different finger movements consisting five individuals as Thumb (T), Index (I), Middle (M), Ring (R), Little (L) and five combined movement as Thumb-Index (T-I), Thumb-Middle (T-M), Thumb-Ring(T-R), Thumb-Little (T-L) and closed hands. In Fig. 2., these fingers movements are illustrated. The duration of each movement from rest pose to contraction pose is five seconds. EMG signals are sensitive to the condition of experiment and effects of neighbor limb. For uniformity, participants sat on the armchair such that their arms were fixed and stable. The EMG data is recorded with two channels at 4, 000 Hz and then amplified to total gain of 1, 000. Each movement of fingers is repeated six times. We select the first four trials for the training of the classification methods and the last two for the test of the methods in order to check the accuracy of the classifiers. Fig. 3. shows the EMG signal of a combined movement, i.e., Thumb-Index.

C. Results and Discussion
At the first step, filtering, standard scaling and feature extraction are done. To have a better comparison between classifiers, the hyperparameters of each classifier are tuned such that achieves the best possible accuracy. After determining  the hyperparameters for each classifier, for the same dataset the comparison is done. In Table I, four performance metrics (accuracy, precision, recall, and F1 score) are compared. The results indicate that EVM outperforms other conventional classifiers. To the best of our knowledge, our work is the first to utilize EVM for EMG analysis. Extreme value machine is a machine learning technique that models probability of each class of training data by fitting a single or multiple Weibull distribution and is not limited to specific condition [24]. The EVM has the best performance which makes it a powerful tool for EMG classification. The higher accuracy of EVM is obtained from cosine metric which is related to the radially covering of each class with EVM. The tail size and cover threshold are tuned by 27 and 0.3 respectively. Extrem vectors (values) are the EMG features that are located in the tail of distribution of each class. Also, the most of widely used methods do not model the tail of probability distribution of each class. So, we expect that although they have very good performance, but they perform poorly on the tail of distribution. The accuracy for each class is shown in Fig. 4. For KNN, the accuracy for different classes is not consistent. For example, the accuracy of KNN for class five is below 60%. SVM has lower fluctuations in the results, but its accuracy is 100% only for the class 0, while for other classes, its accuracy is low. EVM has robust accuracy for each class and its accuracy is not fluctuating a lot for various classes.
In Table 2, we compare the accuracy with similar works reported in [10], [13], [34], [35]. Authors in [35] categorized ten finger movements into two groups of five movements and extracted AR and Root mean Square (RMS) of amplitude of EMG samples as their features. By running artificial neural network (ANN), they could reach 92% accuracy. EVM is a powerful method constructed based on the distribution of data which is rarely considered on many other well-known classifiers.
Reference [34] also restrained their research to five finger movements. They used time domain, Hjorth and RMS as their features and their classifier was ANN. Reference [10] used a combination of time domain features, Hjorth and AR, and trained either a KNN classifier or a SVM classifier on all ten movements. Also, they implemented the fusion approach to vote among different classification methods to get better results. [13] used reflection coefficients of autoregressive model as the extracted features for classification. Similar to [13] and [10], we concentrate on all ten movements, but our accuracy is higher than the similar works. Additionally, our accuracy is obtained without extra processing mechanism like feature selection, feature reduction, voting or fusion.

V. CONCLUSION
In this paper, we proposed EVM as a promissing classifier for EMG datasets. We analyzed an open source data with eight subjects and ten classes. For feature extraction, we used reflection coefficients. These features capture the frequency properties of EMG signals. Then we compared the accuracy of EVM against seven conventional classifiers. The average accuracy of EVM is 91% which is superior or competitive accuracy.
The main focus of this paper was to utilize extreme value machine and validate its strength on EMG signals like Electroencephalography (EEG), Electrocardiography (ECG), etc. Other aspects of research on extreme value machine such as its application on other biomedical signals, its combination with other neural network architectures such as convolutional neural network, graph convolutional neural network, and recurrent neural network remain open for future studies.