Classification of Walking Environments Using Deep Learning Approach Based on Surface EMG Sensors Only

Classification of terrain is a vital component in giving suitable control to a walking assistive device for the various walking conditions. Although surface electromyography (sEMG) signals have been combined with inputs from other sensors to detect walking intention, no study has yet classified walking environments using sEMG only. Therefore, the purpose of this study is to classify the current walking environment based on the entire sEMG profile gathered from selected muscles in the lower extremities. The muscle activations of selected muscles in the lower extremities were measured in 27 participants while they walked over flat-ground, upstairs, downstairs, uphill, and downhill. An artificial neural network (ANN) was employed to classify these walking environments using the entire sEMG profile recorded for all muscles during the stance phase. The result shows that the ANN was able to classify the current walking environment with high accuracy of 96.3% when using activation from all muscles. When muscle activation from flexor/extensor groups in the knee, ankle, and metatarsophalangeal joints were used individually to classify the environment, the triceps surae muscle activation showed the highest classification accuracy of 88.9%. In conclusion, a current walking environment was classified with high accuracy using an ANN based on only sEMG signals.


Introduction
Recent research in the field of robotic walking assistance exoskeletons or prostheses has seen many studies that look to achieve natural movement of the assisting robot through communication between the user and robot [1][2][3]. This human-robot interaction is intended to enable robots to recognize the user's intended motion through cognitive interactions that occur between the human user and the robot that take place over various communication channels [4,5]. Intention recognition is important to accomplish synchronization between the motion of the robot and the human [6,7]. The other studies have reported various methods for recognizing the user's intended movement based on bioelectrical signals, such as electromyography (EMG), electroencephalography (EEG), and electrooculogram (EOG) signals [8][9][10].
Surface electromyography (sEMG) signals contain neural information associated with human movement [3,11]. Human motion intention can be recognized by analyzing EMG signals, and that motion can also be classified to appropriately control any assisting devices [12][13][14]. However, analyzing sEMG signals is difficult due to their complicated patterns and non-linear nature [15]. Neural networks have the ability to understand and analyze complex systems, as such, in recent years they have been applied in many fields such as pattern recognition and adaptive control [5,16]. In particular, Morbidoni et al. used artificial neural networks (ANN) to classify the gait phase by applying the sEMG signals as input data [17]. Therefore, neural networks method and EMG signals can be effectively exploited to recognize the intended motion and to classify human motion.
Previously, both machine learning and traditional pattern recognition methods have utilized handcrafted features that were manually extracted from EMG signals in order to classify human movement [18,19]. However, the performance of these algorithms was greatly influenced by their handcrafted features, meaning their performance often depends on the experience of the engineer and the design of the feature extraction method [20,21]. Recently, it has been shown that extracting features using deep learning is more robust than relying on handcrafted features. For instance, Morbidoni et al. reported that a deep learning feature-based method was able to classify the gait phase with higher accuracy than a handcrafted features-based approach [17]. Roy et al. also proposed a deep learning-based classification framework that classifies hand motion with high accuracy [22]. In that study, the authors adopted an approach where features were extracted using deep learning as this leads to better overall classification performance.
Users of walking assistive devices will inevitably encounter various kinds of environments outside of flat, level ground during their daily life. Proper changes to the control of those walking assistive devices are required to adapt to the changes that occur in the sEMG signals and in the kinematics/kinetics of the joints in the lower extremities as they attempt to tackle various walking environments [23][24][25][26]. As such, classifying and/or recognizing the current walking environment is the first requirement in order to appropriately control the assistive device [27]. To the best of our knowledge, however, no study has attempted to classify the competing five conditions, including a flat-ground, upstairs, downstairs, uphill, and downhill walking, using only sEMG signals. sEMG signals have often been used in the classification of patterns as inputs to machine learning algorithms or artificial neural network (ANN); relying on these kinds of signals has been proven as a valid approach to classifying nonlinear data or complicated patterns [28]. Motivated by the state of research described above, the purpose of this study is to classify the current walking environment based on the entire sEMG profile from selected muscles in the lower extremities using an ANN.

Participants
Twenty-seven male students (age: 24.5 ± 2.7 years, height: 1.73 ± 0.04 m, mass: 69.0 ± 7.99 kg, BMI: 22.9 ± 2.2 kg/m 2 ) participated in this study. Prior to participation, all participants were asked to sign an informed consent form approved by the Institutional Review Board (IRB); all participants were capable of ascending and descending stairs and slopes without any external assistance.

Experimental Protocol
All participants walked barefoot in the following five environments: on flat-ground, upstairs, downstairs, uphill, and downhill ( Figure 1). For the flat-ground environment, the participants walked along a straight and level 6 m walkway. For the stairs, the participants walked up and down a total of 5 steps (with each step 0.60 m in length, 0.25 m in width, 0.24 m in height) and there was a force platform embedded in the third step. For the uphill and downhill environments, a walkway with a 15 • slope was used. The slope angle of 15 • was selected, as it has been suggested in previous research that, at this angle, the effects of slope that come with walking uphill and downhill are apparent [29,30]. The sloped walkway consisted of three pieces, with each piece being 0.61 m in length and 0.76 m in width. The three pieces were joined together so that the participants could take a few natural steps along the walkway; a force plate was embedded below the second piece. Prior to the actual trials, each participant was instructed to perform several practice runs in the five experimental environments to become familiar with the procedures and instrumentation. During the tests, the participants were instructed to walk at a self-selected speed and to step on the force plate with their dominant leg each time. The dominant leg was defined as the more comfortable leg when kicking a ball [31,32]. All participants rested between each of the five walking tasks in order to prevent muscle fatigue. sEMG data from five successful trials was recorded for each environment, any trials where the participants did not correctly place their foot on the force plate were discarded. The sloped walkway was made of three pieces joined together, the force plate was embedded in the second piece as shown in (d,e).

Data Collection
A wireless EMG system (Wave plus wireless, Cometa, Milan, Italy) was used to record muscle activation data from the participants' rectus femoris (RF), vastus medialis and lateralis (VM and VL), semitendinosus (ST), biceps femoris (BF), tibialis anterior (TA), soleus (Sol), medial and lateral gastrocnemius (MG and LG), flexor hallucis longus (FHL), and extensor digitorum longus (EDL) at a sampling rate of 1200 Hz while walking. The sEMG sensors were attached to the muscle bellies, while an inter-electrode distance of 20 mm at the recommended locations was maintained ( Figure 2). The force plate (9260AA6; Kistler, Winterthur, Switzerland) recorded data at a sampling rate of 1200 Hz, and their data collection was synchronized with that of the wireless EMG system to identify the stance phase in each participant's walk. The force plate and EMG data for each walking environment were recorded simultaneously; in particular, the vertical ground reaction force (vGRF) was used to find the stance phase in each trial.
The force plate was embedded in different positions as appropriate for each walking environment ( Figure 1).

Data Processing
Muscle activation data was collected during the stance phase of each participant's walk, this is defined as the period between the initial heel contact and toe-off. Initial heel contact was identified by finding the first frame in which the vGRF exceeded 20 N [33,34]. Toe-off was determined by the first frame after initial heel contact in which the vGRF returned 0 N.
The muscle activation data from the selected muscles in the lower extremities were processed using MATLAB (MATLAB R2017b, Mathworks, Inc., Natik, MA, USA) [35]. The sEMG signals were processed to extract linear envelopes from the raw sEMG signals. Raw sEMG signals from walking on flat-ground, uphill, downhill, upstairs, and downstairs were passed through a fourth-order Butterworth filter for 20-500 Hz before being full-wave rectified. The rectified sEMG signals were subsequently passed through a fourth-order Butterworth low-pass filter at 10 Hz. The processed sEMG signals for all environments were normalized against each individual's peak muscle activation amplitude during the flat-ground trial [36,37]. The individual peak muscle activation amplitude was defined as the maximum amplitude in the stance phase while walking on flat-ground. All sEMG signal data for each muscle during the stance phase were linearly interpolated to 1000 points to match the length of the input dataset before training and testing the model. An entire sEMG profile consists of the data collected during the stance phase from all muscles that were monitored. These data, from each trial of each individual, after being processed as described above, were used as the sole input to the ANN which then attempts to classify the walking environment ( Figure 3). The number of input data points used for training and testing each model is shown in Table A1. LG, FHL, and EDL indicate the rectus femoris, vastus lateralis, vastus medialis, semitendinosus, biceps femoris, tibialis anterior, soleus, medial gastrocnemius, lateral gastrocnemius, flexor hallucis longus, and extensor digitorum longus, respectively. The blue, orange, grey, yellow, and sky-blue lines indicate walking on flat-ground, upstairs, downstairs, uphill, and downhill, respectively.

Walking Environment Classification
The processed sEMG signals from all walking environments were sorted by muscle, then the sorted sEMG signals were labeled to match the actual walking environment they were collected from (Table 1). Entire sEMG profiles of 135 successful trials for each walking environment obtained from 27 subjects during the stance phase were used as the sole input to the classification model. The input data was divided into 2 parts: 80% was used for training the classification model and 20% was used for testing it. The ANN was used as a classifier. The processed sEMG muscle activation data were fed into the ANN as the input for the ANN to classify the walking environment. The ANN's training model consisted of an input layer, a single hidden layer with the rectified linear unit (ReLU) activation function, and the output layers. Entire sEMG profiles from the muscles of each joint being monitored during the stance phase were fed to the input layer. The output layer then classified the input data as being from one of the five walking environments. A Softmax cross-entropy with logits was employed as a loss function, and Adaptive Moment Estimation (Adam) was used as an optimization algorithm to minimize the loss function [38][39][40][41].
Classification models were created for each muscle and combinations of muscles, each model's accuracy was calculated after applying the test data. Specifically, each classification model was created by dividing the data from each joint's flexor and extensor muscles (knee, ankle, and metatarsophalangeal (MTP) joint), and then the classification accuracy of each model was calculated after using the test dataset input (Figure 4). Accuracy, sensitivity, and specificity are model evaluation indicators commonly used with classification problems [42]. For our ANN model, accuracy and confusion matrices were used to evaluate its classification performance. Accuracy of the ANN model is defined as an Equation (1).
where N c is the number of correctly classified environments, and N total is the total number of tests. A confusion matrix is used to better quantify the specifics of the classification performance [43], this matrix is defined as follows: where the elements of the matrix are defined by an Equation (2) where b ij is the number of samples for the ith walking terrain that are identified as the jth walking terrain, and b total,i is the total number of samples for the ith walking terrain. The diagonal elements in the matrix represent the percentage of correct classification events and are used to find the model's accuracy, while the other elements in the matrix show the percentage of misclassified events. In addition, sensitivity and specificity were calculated to further evaluate the model's performance. They are defined as Equations (3) and (4).
where true positive (TP), true negative (TN), false positive (FP), and false negative (FN) are defined in Table 2. In this study, the current walking environment was considered as positive; the other four walking environments were then considered negative for that particular trial. As such, five sensitivities and specificities were calculated, for when each walking environment was taken as the positive result.

Results
The ANN was able to classify each walking environment with a high degree of accuracy, achieving a success rate of 96.3% when using activation data from all the muscles being monitored (RF, VL, VM, ST, BF, MG, LG, Sol, TA, EDL, and FHL) (Tables 3 and 4). The sensitivity and specificity for our model's walking environment classification are shown in Table 4.  When separate flexor and extensor muscle group activations for each joint were used as the classifying parameters, data from MG, LG, and Sol, which are the ankle extensor muscles, achieved the highest classification accuracy (MG, LG, and Sol: 88.9%; ST and BF: 75.6%; VL, VM, and RF: 68.1%; FHL: 67.4%, TA: 63.0%; EDL: 45.2%; Table 5).  Table 6).

Discussion
This study proposed using an artificial neural network-based approach to classify whether a human user was walking on flat-ground, upstairs, downstairs, up a ramp, or down a ramp using only sEMG profiles collected from muscles in the lower extremities. When separating the flexor and extensor muscle groups of each joint (i.e., the knee, ankle, and MTP joints) to use as the input to the model, ankle extensors provided the best classification performance. This study proves it is possible to accurately classify the current walking environments based on an ANN using only sEMG signals. The results of this study show that classification accuracy was highest (96.3%) when using muscle activation data from all monitored muscles: the VM, VL, RF, ST, BF, TA, MG, LG, Sol, FHL, and EDL. It should be noted that this high accuracy is comparable and even higher than accuracies from the other studies that used a combination of multiple types of sensor. Kyeong et al.
reported a classification accuracy of 96.1% when training and testing the model using the data obtained from multiple sensors (including sEMG, position sensors, GRF sensors, and interaction force sensors). However, the classification accuracy was 76.7% when training and testing the model using only the data obtained from the sEMG sensors [19]. Joshi et al. reported on their model, which classified the walking environment correctly 67.1% of the time when only relying on data from sEMG sensors [44]. In these studies, the walking environment was classified using a machine learning method based on time domain features calculated in the feature extraction process as a parameter. However, in our study, we utilized the entire sEMG profile collected during each participant's stance phase as input data for our deep learning method. As muscle activation data from each time point may reflect any peak amplitude characteristics of the sEMG signals during the stance phase, we believe this is the reason for the higher accuracy of our model compared to other studies. Therefore, our results suggest that it is possible to classify the walking environment with a high degree of accuracy using only sEMG sensors when we use the entire muscle activation profile as input to the classification model.
This study found that muscle activation data from the ankle extensor group of muscles (i.e., the MG, LG, and Sol) gave the highest accuracy when classifying the walking environment. This result indicates that ankle extensor muscle activation provides the most important data when classifying the walking environment. This finding might be linked to differences in the lower limb joint kinetics of the sagittal plane when walking in different environments. Lay et al. reported that there were significant differences in the peak ankle joint moment in both early and late stance phases when walking on flat-ground, uphill, or downhill [45]. In addition, significant differences were found in the peak knee joint moment during the late stance phase between walking on flat-ground and downhill [45]. In the case of walking up and down stairs, the peak ankle joint moment has shown significant differences in the early stance phase between walking up stairs and walking down [26]. Differences in the peak knee joint moment appear in the late stance phase, regardless of whether we are walking upstairs or walking down, compared to walking on flat-ground [26]. Taking these previous findings together, we may conclude that the ankle joint has more significance than the knee joint in relation to classifying the current walking environment; this, in combination with the results of this study, suggests that muscle activation data from the ankle extensors should be monitored to properly control walking assistive devices as the user moves between different environments.
Although a high degree of accuracy while classifying the current walking environment was shown in this study, there is still room to increase the classification rate of our system for terrain detection, and to apply proper control of walking assistive devices. This study considered the current situation while walking in various environments, however, a system which could provide early detection of transitions between terrains would be preferable to enable timely control of walking assistive devices. Thus, future study into detecting transitions between the walking terrain is warranted. In addition, only male subjects were included in this study, so the current results cannot be generalized to females. To further enhance classification performance and generalize the classification model, more investigation into classifying various walking terrains through a larger sample size, including female subjects, is warranted.

Conclusions
This study proposed an ANN-based approach to classifying the user's competing conditions as walking on flat-ground, upstairs, downstairs, uphill, or downhill. The main contribution of this study is to classify the walking environment by applying an entire sEMG profile from the stance phase as the only input to the ANN classification model. This study suggests that using all the sEMG data from every muscle group in the lower extremities is sufficient to determine a user's gait characteristics as they change according to the walking conditions and that current deep learning methods can extract these gait characteristics successfully from these inputs. In conclusion, the current walking environment could be accurately classified using an ANN with only sEMG signals as input.

Conflicts of Interest:
The authors declare no conflict of interest.