Study of K-Nearest Neighbour Classification Performance on Fatigue and Non-Fatigue EMG Signal Features

For our body to move, the muscle must activate by relaxing and contracting. Muscle activation produces bio-electric signals that can be detected using Electromyography or EMG. The signal produced by the muscle is affected by the type of contraction done by the muscle. The eccentric contraction generating different EMG signals from concentric contraction. EMG signal contains multiple features. These features can be extracted using MATLAB software. This paper focuses on the bicep brachii and brachioradialis in the upper arm and forearm, respectively. The EMG signals are extracted using surface EMG whereby electrical pads are placed onto the surface of the muscle. Features can then be extracted from the EMG signal. This paper will focus on the MAV, VAR, and RMS features of the EMG signal. The features are then classified into eccentric, concentric or isometric contraction. The performance of the K-Nearest Neighbour (KNN) classifier is inconsistent due to the EMG data variabilities. The accuracy varies from one data set to another. However, it is concluded that non-fatigue signal classification accuracy is higher than fatigue signal classification accuracy. Keywords—Electromyography; surface electromyography; knearest neigbour classifier; feature extraction; dynamic contraction


I. INTRODUCTION
The movement of the body is a complicated process that requires a specific group of muscles to contract and relax in a specific order. Continuous contraction of the muscle over a prolonged period of time would eventually result in fatigue. Fatigue is the state of the muscle during the onset of fatigue caused by muscle contraction, whereas Non-Fatigue refers to the state of muscle before the onset of fatigue [1]. In order to extract information from the muscle to assess the Non-Fatigue and Fatigue condition of the muscle, sEMG, or surface electromyography is often used. sEMG is a method whereby electrodes are placed on the surface of the muscle to acquire the bioelectrical activity of the muscle. The signals acquired can then be analyzed for distinctive features that can be observed quantitatively such as the size of the signal or the shape of the signal: smooth or spiky, and fast or slow [2]. As the muscle enters a fatigued state, the ability of the muscle to do work would decrease as the muscle struggles to produce enough force to do the work. This, in turn, would affect the EMG signal produced as the muscle behaves differently. Furthermore, the change in muscle state would also affect the behaviour of the muscle when doing the same type of work as in the previous state.
Generally, muscle contractions are divided into two groups: (1) Isometric and (2) Dynamic. These contractions are divided based on the movement of the muscle, which is lengthening, shortening, or static. Dynamic contractions are further divided into Eccentric and Concentric contractions. Contraction of the muscle when the muscle is lengthening is called the Eccentric Contraction, whereas contraction of the muscle when the muscle is shortening is called Concentric Contraction. Isometric contraction is when the muscle exerts a force, but the muscle length does not change [3].
A muscle uses ATP (Adenosine Triphosphate) to contract and shorten, producing a force on the objects it is connected to [4]. The upper arm is located between the shoulder joint and the elbow joint. It contains four muscles: three in the anterior compartment (biceps brachii, brachialis, coracobrachialis), and one in the posterior compartment (triceps brachii) [3]. When a muscle contracts in a minimal interval, it is called a muscle twitch. There usually are two forms of muscle fibres, the slowtwitch fires and fast-twitch fibres. Slow-twitch fibres are muscle fibres that twitch for a shorter time. They are more unaffected to fatigue and have higher endurance, but they cannot generate rapid force. In contrast, high-twitch fibres are muscle fibres which can twitch for a longer time [5]. They have higher endurance but low resistant to fatigue, but they can generate rapid force. The biceps muscle is consists of 46% slow-twitch fibre and 54% fast-twitch fibre. The composition of the muscle fibre will have some effect on the sEMG signal obtained as a different type of fibre will produce different types of neuromuscular activity [6].
"Fatigue" is generally a term which is used to describe the decrease in the physical performance of the muscle group in performing a particular task related to the muscle group. Relating to exercise, fatigue can be defined as the failure to maintain the exercise in the correct form. Fatigue is caused by multiple physiological phenomena such as "central fatigue" and "peripheral fatigue". "Central fatigue" indicates the decrease in the voluntary contraction of the muscle, whereas *Corresponding Author www.ijacsa.thesai.org "Peripheral fatigue" indicates the decrease in the contraction strength of the muscle. During exercise such as the "bicep curl", the fatigue onset is usually caused by the "Central Fatigue" whereby fatigue is induced progressively by the exercise performed and degrading the voluntary contraction of the muscle [7]. Another way to look at muscle fatigue as seen in [8], [9]. It can be described as the reduction in the maximal force a muscle can produce in a related task that utilizes the specific muscle.
The steps to reduce skin-to-electrode impedance is divided into several types [10]. Firstly is the surface preparation. The most effective method, according to [11], was found to be applying abrasion on the surface with electrolytic gel. Next is the electrode metal. Ag is chosen over Cu as Cu tends to corrode faster, making it unsuitable for most electrode applications. After that is the electrode size. After extensive comparison by W. Besio et al. [10], it was discovered that a smaller diameter of concentric ring electrodes yields better and more consistent. Other than that, applying pressure onto the electrode will help to keep it in place, reducing motion artefact.
Time statistics based features are preferred over frequency domain and time-frequency domain features due to the better accuracy it provides [12]. Muscle endurance is measured with time. Thus, the time-domain feature is useful in detecting muscle fatigue. From the amplitude of the EMG, we can observe the pattern of muscle contraction. These amplitudes are affected by the rate of firing of motor units [13]. Therefore, the time-domain feature is chosen to be used in this research. Other than that, time-domain features have lower computational complexity and can be implemented faster.
"Inherent noise" is a type of electrical noise that is present in all electronic equipment. This inherent noise has a frequency range of 0 Hz to several thousand Hz. Surface EMG uses noninvasive or adhesive type electrodes which can be directly applied on the skin of the subject. Silver/silver chloride (10 × 1 mm) have an adequate signal-to-noise ratio and is very steady electrically. This makes it suitable to use as surface electrodes [14]. The impedance is inverse with the electrode size, the larger the electrode, the smaller the impedance. However, the electrode size must be in accordance with the SENIAM standard. Therefore, both parameters should be taken into consideration. Other than that, the inherent noise can also be eliminated with suitable circuit design or higher quality equipment. The motion artefact is created when there is the movement of the cable connecting the electrode to the amplifier. The association between the detection surface of the electrode and the skin also creates motion artefacts. When the muscles activate, it generates electrical activity or bioelectrical signals. To record the EMG signal, electrodes are placed on the skin covering the target muscle group. During the contraction and relaxation of the muscle, the muscle changes in length and stretches the skin. This will cause the electrode on the skin to move. This undesired movement of the electrode will cause motion artefact. Typically, the motion artefact has a range of 1 Hz to10 Hz. The voltage generated from this noise has an amplitude that is comparable to the amplitude of the EMG signal. This type of motion artefact can be removed by using recessed electrodes. Recessed electrodes are electrodes which have a conductive layer of gel between the skin surface and the electrode. This helps the electrode to detect EMG signals despite the motion of the skin provided the electrode is in contact with the skin. However, recessed electrodes cannot remove motion artefact caused by the potential difference between skin layers. Thus, this type of artefact must be removed by reducing skin impedance [15]. Scratching the skin reduces these artefacts [10]. Alcohol or any alcohol rubbing solution or gel can be used to apply abrasion on the skin to reduce skin impedance.
For dynamic contraction, acquiring an EMG signal can be difficult as noise can be quickly introduced into the signal from the swaying of the electrical wire used for EMG. These noises can be removed in a study done on the bicep brachii by Kuthe and co. [16], the muscle strength in terms of muscle force and fatigue for biceps brachii, was computed using supervised and unsupervised subjects in static contraction (isometric contraction). The raw EMG signals were filtered using a bandpass filter (second-order Butterworth) with a frequency range of 5-500Hz. Using this method, they were able to filter out most of the noise.
Specific features such as Mean Absolute Value (MAV), Root Mean Square (RMS), and Variance (VAR) can be extracted from the EMG signal. These specific features are useful in detecting muscle fatigue as it is a time-domain feature, and muscle endurance is measured with time [12].
In this study, the performance of the KNN classifier in classifying fatigue EMG signal will be compared to the nonfatigue EMG signal. Section 2 will describe the methods used to drive the muscle into fatigue condition from the nonfatigued condition while doing dynamic and isometric contraction. The KNN classification performance will be shown in Section 3. Section 4 discusses the observations made in Section 3, which later a conclusion will be made from the observation made in Section 4.

A. Subject
Six healthy male volunteers without any history of neuromuscular skeleton disorder participated in this study. A consent form was filled by the volunteers before participating in the study. The subjects were asked to avoid any activity that may overexert their body 12 hours before the experiment. The volunteers were given instruction and training without load before starting the exercise.

B. Equipment Selection
The equipment chosen to be used in this study is: The EKG-BTA Sensor evaluates cardiac electrical potential shown as waveforms (voltages formed during the contraction of the heart). It can be used to make standard 3-lead EKG tracings to record electrical activity in the heart, or to collect surface EMG recordings to study contractions in muscles in your arm, leg or jaw. From Fig. 1, the EKG-BTA sensor is www.ijacsa.thesai.org equipped with a connector which connects to the interface (LabQuest Mini) and three leads (Red, Green, and Black) which connect to the electrodes. The Red, Green and Black leads represent positive, negative, and ground, respectively. The leads will relay the signal detected by the electrodes to the sensor.
The Vernier LabQuest Mini is a powerful (Fig. 2), affordable, and easy to use sensor interface for computer-based data collection. It receives the data from the EKG-BTA sensor and converts it into a format that can be easily interpreted. The example of the format is shown in Fig. 4 and 5.
The Vernier Disposable electrode is adhesive type electrodes (Fig. 3). They have adhesive of the sensor face to attach to the surface of the subject. The adhesive surface is covered out of the box, and the cover can be removed when needed, much like a sticker.

C. Data Collection
Before proceeding with the experiment, the skin of each subject must be cleaned with alcohol rub in order to reduce skin impedance and acquire more precise EMG signals. Isopropyl alcohol was used in this study. According to SENIAM or Surface Electromyography for the Non-Invasive Assessment of the Muscle, the inter-electrode distance must be 2cm from the centre point to centre point. The electrodes are applied parallel to the muscle fibre direction. In this study, the muscle group that will be focused on is the Biceps Brachii (long head and short head) and the brachioradialis.   There are a total of six subjects that participated in this study. The average age, height, weight, and BMI (Body Mass Index) of the subjects are listed in Table I. The subjects are required to do the "bicep curl" exercise using a standard 5kg dumbbell. For the movement of the bicep curl exercise, the subjects are to lean against a wall with knees bent as shown in the image below, to limit the involuntary involvement of other muscles during the exercise. When doing the exercise, the subjects are to keep their elbows close to their body with palms facing forward. In the initial position, the subjects are to keep the dumbbell at the side of their body, perpendicular to the floor, as shown in Fig. 6.
The elbow is tugged to the side of the body to avoid the involuntary involvement of other muscle groups such as the front deltoid, especially during the fatigue state. The workout is separated into two stages, with three types of contraction: Eccentric, concentric, and isometric. The first stage is to acquire the non-fatigued condition of the muscle, and the second stage is to acquire the fatigue condition of the muscle. (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 44 | P a g e www.ijacsa.thesai.org The steps of the biceps curl exercise for isometric contraction are as shown below: 1) Subjects start in the initial position with elbow flexion at 90° empty-handed. Their back lay flat on the wall in the upright position with knees bent slightly at about 45°, and elbows tugged tightly to the side of the body. Throughout the exercise, only the elbow is allowed to move while the other parts of the body are to remain in the same position.
2) The 5 kg dumbbell is then placed in the palm of the subject for the subject to hold.
3) The subjects are to hold the position for 10 seconds. 4) After 10 seconds, the dumbbell is removed, and the subject rests for 2 minutes before starting the next set.

5)
Step 1 to 4 is repeated for the next set. 6) A total of 3 sets were done.
For dynamic contraction, the initial position in step 1 is replaced with max muscle flexion with the dumbbell at shoulder height for eccentric contraction and minimum muscle flexion at waist height for concentric contraction. The subject then moves the dumbbell from shoulder level to waist level for eccentric contraction and from waist level to shoulder level for concentric contraction within 10 seconds in step 3.
Step 4 to 6 is the same for all three types of muscle contractions.

D. EMG Signal Preprocessing
Pre-processing must be done in order to remove unwanted information such as crosstalk, motion artefacts and power line interference (PLI) from the raw EMG signal. To remove the motion artefacts in the EMG signal, a high pass filter needs to be used. The frequency range of motion artefacts is 10-20Hz, whereby the 10Hz represents walking artefacts while 20 Hz for the rapid movement artefacts.
In this case, we used 20 Hz to eliminate sudden rapid movements when executing the bicep curl exercise. The low pass Butterworth filter has been applied to a raw EMG signal to optimize the frequency of the EMG signal and to remove high-frequency components. The cut off frequency is set at 1000Hz. Besides filtering, the EMG signal was segmented before feature extraction according to the contraction. EMG signal was segmented into the 1-second window with 0.5 seconds overlap between segments to reduce data loss during feature extraction.

III. RESULTS AND DISCUSSION
From the result, three types of graphs are obtained. The scatter plot shows the predictions made by the classifier. Besides the plot, there is a legend for the predictions made. A dot means correct guess whereas a cross means the wrong guess. Each of the dots and crosses has its own colour. Blue for Concentric contraction "CON", orange for Eccentric contraction "ECC" and yellow for Isometric contraction "ISO". The plot provides a view on the distribution and range of the data as well as the region of error for the prediction.
The confusion matrix shows the performance of a classifier. The matrix shows the True Positive Rate and False Negative rate of the classifier based on the predictors "ECC", "CON", and "ISO". True Positive is indicated by green while False Negative is indicated by red. The hue of the colour changes depending on the percentage of prediction. The more the predictions are True Positive or False Negative, the higher the percentage, the deeper the hue and vice versa. This shows which predictors have the most errors and vice versa.
The Receiver Operating Characteristics (ROC) curve shows the performance of the classifier. The AUC or "Area Under Curve" is a measure of the degree of separability. It shows how well the classifier can categorize the data. The closer the AUC is to 1.0, the better the degree of separability, the better the classifier performs. The examples of the graphs obtained are shown in Fig 7, Fig. 8, and Fig. 9.   (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 45 | P a g e www.ijacsa.thesai.org The classifier is divided into four types. Each type of classifier corresponds to each data type:  Referring to ROC Curve from Tables II and III, the AUC (Area Under Curve) of the BicNF Classifier for ECC, CON and ISO is 0.86, 0.76, and 0.63 respectively whereas the BraNF classifier has AUC of 0.68, 0.81 and 0.80 respectively. An AUC above 0.5 indicates the capability of separability. Both BicNF and BraNF had AUC above 0.5 for all EMG features. The closer the AUC is to 1.0, the better the performance of the classifier. This shows that the KNN classifier has a decent performance in classifying EMG features.
The accuracy of the BicNF classifier is 62.2% whereas for BraNF classifier is 57.8%. The KNN classifier can classify EMG signal features of Biceps Brachii better than brachioradialis for the non-fatigued condition.
Referring to the Confusion Matrix in Tables II and III, the BicNF classifier has an accuracy of 73% for ECC and 73% for CON whereas the BraNF classifier has an accuracy of 33% for ECC and 73% for CON. Compared to the BicNF classifier, the BraNF classifier was not able to classify Eccentric contraction features as well as the BicNF classifier. This is implied by the higher accuracy of the BicNF classifier compared to the BraNF classifier.
For the ISO classification, the BicNF classifier has an accuracy of 40% whereas the BraNF classifier has an accuracy of 67%. The KNN can classify the Isometric contraction feature better in brachioradialis compared to Biceps Brachii. This is also implied by the AUC as the ISO AUC of BraNF is 0.80, whereas the ISO AUC of BicNF is 0.63. This shows that the BicNF classifier has lower separability compared to the BraNF classifier in classifying Isometric contraction features.
Referring to Tables II and III, the performance of the KNN classifier was not affected by the pattern of the data scatter plot. This can be seen in the BicNF classifier when CON had four outliers, but accuracy remained high at 73.3% and also in the BraNF classifier when CON had most outliers but has the highest accuracy compared to ECC and ISO.

B. Fatigue EMG Signal KNN Performance
Tables IV and V show the summary of the result obtained from the Scatter Plot, Confusion Matrix, and ROC curve. These results are for the Fatigue EMG signal KNN performance.
Referring to ROC Curve from Tables IV and V, the AUC of the BicF Classifier for ECC, CON and ISO is 0.82, 0.89, and 0.75 respectively whereas the BraF classifier has AUC of 0.65, 0.61 and 0.82 respectively. An AUC above 0.5 indicates the capability of separability. Both BicNF and BraNF had AUC above 0.5 for all EMG features. This shows that the KNN classifier has a decent performance in classifying EMG features. The accuracy of the BicF classifier is 71.1% whereas for BraF classifier is 53.3%. The KNN classifier can classify EMG signal features of Biceps Brachii better than brachioradialis for fatigue condition. Referring to the Confusion Matrix in Tables IV and V, the BicF classifier has an accuracy of 73% for ECC and 80% for CON whereas the BraF classifier has an accuracy of 47% for ECC and 60% for CON. Compared to the BicF classifier, the BraF classifier was not able to classify Eccentric and Concentric contraction features as well as the BicF classifier. This is implied by the www.ijacsa.thesai.org higher accuracy of the BicF classifier compared to the BraF classifier. For the ISO classification, the BicF classifier has an accuracy of 60% whereas the BraNF classifier has an accuracy of 53%. The KNN can classify the Isometric contraction feature better in Biceps Brachii compared to brachioradialis. However, the ISO AUC of BraF is 0.82, whereas the ISO AUC of BicF is 0.75. This shows that despite having lower accuracy than the BraF classifier, the BicF classifier has a better separability compared to BraF. Referring to the scatter plot in Tables IV and V, the BicF classifier ISO has concentrated pattern but had the lowest accuracy at 60% when compared to ECC and CON. Since the data for ISO is concentrated, there should be less error in classifying as the distance between neighbours of the same data type is near. However, the ISO also has five outliers which may contribute to the lower accuracy. For the BraF classifier, CON had an irregular pattern as well as the most outliers at 5. However, the accuracy of CON is highest at 60%. This shows that the pattern of the data scatter does not affect the accuracy directly. This is supported by the AUC of the classifier. Despite having the highest accuracy, the CON AUC is lowest at 0.61. This shows that the BraF classifier has the lowest separability for CON features. Meaning it is least capable of classifying ISO features.

IV. CONCLUSION
In conclusion, the KNN classifier is not suitable for classifying time-domain features of EMG data due to inconsistent performance. The accuracy of the KNN classifier in classifying signals into eccentric, concentric, or isometric contraction during dynamic and isometric movement is subjective to the data used. Accuracy differs from one set of data to another. The accuracy of the KNN classifier in classifying time-domain features into eccentric, concentric or isometric contraction when the muscle is in Non-Fatigue condition is higher than in Fatigue condition. The lower accuracy for Fatigue condition may be due to the varying degree of muscle twitch when their muscle is fatigued for different individuals. Muscle twitch promotes much higher muscle action potential, which causes spikes in the EMG data. Even after applying filters to the raw data, there is still too much variation in the data from one person to another. The KNN classifier was not able to classify correctly due to this variation. Overall, the KNN classifier has higher accuracy in classifying Biceps Brachii EMG data compared to Brachioradialis EMG data. The accuracy of KNN in classifying dynamic and isometric movement is also inconsistent with varying degree of separability from one muscle group to another.

V. RECOMMENDATIONS
The number of volunteers that are involved in this study is six people. More volunteers would help to ensure the data obtained is not biased. The age group, height, and BMI of the volunteer is recommended to be about the same to ensure data collected is not biased. With more volunteers, the performance of the KNN classifier may become more consistent due to more training data. When doing the biceps curl exercise, it is best to maintain a straight posture while keeping elbow tugged tightly to the side of the body and keeping the arms perpendicular to the ground. Volunteers should breathe in a controlled manner while doing the exercise. The wire that connects the EKG-BTA and the surface electrodes should be fixed to any surface to ensure minimal wire sway when doing the exercise. The EKG-BTA must be kept further away from any electronics which may produce sound such as laptop fan. The main reason for the discrepancy in the result which causes inconsistent performance is due to the wrong method of comparison. A different individual would inevitably produce different EMG. Therefore, for future research, it is suggested to collect multiple sets of data from one individual and one test data from the same individual. The KNN is trained and tested with the data of the same individual. This is done for multiple individuals. The results of the test data from different individuals can then be compared with one another. This will remove the discrepancy resulted from the difference in physiology.The finding of this study may benefit as reference for those who are considering using the KNN classifier for the application of EMG signal classification.