Deep Learning-Based Identification Algorithm for Transitions Between Walking Environments Using Electromyography Signals Only

Although studies on terrain identification algorithms to control walking assistive devices have been conducted using sensor fusion, studies on transition classification using only electromyography (EMG) signals have yet to be conducted. Therefore, this study was to suggest an identification algorithm for transitions between walking environments based on the entire EMG signals of selected lower extremity muscles using a deep learning approach. The muscle activations of the rectus femoris, vastus medialis and lateralis, semitendinosus, biceps femoris, tibialis anterior, soleus, medial and lateral gastrocnemius, flexor hallucis longus, and extensor digitorum longus of 27 subjects were measured while walking on flat ground, upstairs, downstairs, uphill, and downhill and transitioning between these walking surfaces. An artificial neural network (ANN) was used to construct the model, taking the entire EMG profile during the stance phase as input, to identify transitions between walking environments. The results show that transitioning between walking environments, including continuously walking on a current terrain, was successfully classified with high accuracy of 95.4 % when using all muscle activations. When using a combination of muscle activations of the knee extensor, ankle extensor, and metatarsophalangeal flexor group as classifying parameters, the classification accuracy was 90.9 %. In conclusion, transitioning between gait environments could be identified with high accuracy with the ANN model using only EMG signals measured during the stance phase.


I. INTRODUCTION
I N THEIR daily activities, pedestrians encounter various walking environments such as flat ground, stairs, and hills, and they either walk continuously on current terrain or transition between existing terrain and another.When a person's physical abilities have weakened, wearable walking assistive devices allow them to walk safely [1], [2], [3].Walking assistive devices have a distinct control strategy based on terrain types [4], [5], [6].When such a device does not obtain information about a user's intention and/or upcoming gait environments in advance, it cannot accomplish the desired control strategy [7].As a result, recognizing users' intentions and/or gait environments in advance is required to properly control walking assistive devices safely based on walking conditions.
Currently, intention recognition based on electromyography (EMG) signals has been used for communication between devices and human motion [8], [9].EMG signals containing neural information can predict user intentions in advance before human movement.EMG signals also provide valuable information for estimating walking speed and environmental conditions in the control system [10], thereby enhancing synchronization between users and machines [11], [12].In addition, as the amplitude of EMG signals is positively correlated with the force during muscle contraction [13], EMG signals can be incorporated into the control criteria for torque estimation of a walking assistive device [14].Previous studies have attempted to control wearable walking assistive devices and identify various situations, including turning left, turning right, standing up, and sitting down, and walking environments, such as flat ground, hill, and stair walking, using only EMG signals [9], [15].The literature above suggests that EMG signals alone could help recognize user intention and identify the current walking environment to control wearable walking assistive devices.
Pedestrians modify gait patterns to safely transit between different walking environments [16], [17].Sheehan and Gottschall reported the alteration in gait strategy by adjusting spatial-temporal parameters such as stride length and walking speed based on the environment being approached [18].Moreover, transitioning between stairs and flat ground during walking affects the kinematics and kinetics of the knee, ankle, and hip joints compared with stair walking [19].In addition, transitioning between different walking environments requires higher neuromuscular recruitment [20].Therefore, upcoming terrain identification is required to properly control walking assistive devices when changing walking environments.
Neural networks based on machine learning and deep learning (DL) algorithms have significant potential for recognizing user intention and solving classification problems such as walking environment identification and gait phase detection [15], [21].Recently, an artificial neural network (ANN) method demonstrated robust mapping capability for both linear and nonlinear data [22].Given the high nonlinearity of mapping from EMG signals to motion intent [23], neural networks can serve as an appropriate coupler for solving the EMG-based intention recognition problem.In particular, DL methods improve the performance of neural networks.Kim et al. used a DL approach based on the whole EMG signal profile during the stance phase to classify five walking environments (flat ground, upstairs, downstairs, uphill, and downhill) and reported a classification accuracy of 96.3% [15].However, their study considered only environments where people were walking continuously in the existing terrain.To mimic human motion seamlessly, an algorithm classifying walking environments, including transitions from one terrain to another, is required for wearable walking assistive devices.To the best of the authors' knowledge, no study has attempted to classify transitions between various terrains using only EMG signals.Therefore, the purpose of this study was to propose an identification algorithm for transitions between various walking environments based on EMG signals using a DL approach.

A. Subjects
Twenty-seven male students (n = 27; age: 24.5 ± 2.7 years; height: 1.73 ± 0.04 m; mass: 69.0 ± 8.0 kg; body mass index: 22.9 ± 2.2 kg/m 2 ) participated in this study.The study was conducted according to the guidelines of the Declaration of Helsinki and approved by the Institutional Review Board.Before participating in the experiment, all subjects were asked to sign an informed consent form approved by the institutional review board.All subjects had no history of lower extremity injuries and could ascend and descend stairs and slopes without any external assistance.
The subjects walked along a straight and flat 6 m walkway for the FG environment.For the US and DS environments, the subjects walked up and down five steps (with each step 0.24 m in height, 0.25 m in width, and 0.60 m in length).For the UH and DH environments, the subjects walked up and down slopes with a slope angle of 15 • .The hill walkway consisted of three pieces, each with dimensions of 0.61 m in length and 0.76 m in width.The three pieces were connected so that the subjects did not walk unnaturally.For stair transitions, an experimental apparatus with three steps and a flat 1.5 m walkway before and after the stairs was installed.For FGUS, the subjects walked a flat walkway and then ascended the stairs.For USFG, the subjects ascended the stairs and then walked a flat walkway.For FGDS, the subjects walked a flat walkway and then descended the stairs.For DSFG, the subjects descended the stairs and then walked a flat walkway.For hill transitions, an experimental apparatus with three parts and a flat 1.5 m walkway before and after hills was installed.The subjects were asked to walk in the same manner as stair transitions for FGUH, UHFG, FGDH, and DHFG.
Prior to the experiments, each subject was instructed to practice the 13 walking tasks to become familiar with the experiment procedures and apparatuses.During the experiments, the subjects walked at self-selected speed over the installed walkway in barefoot condition and were instructed to step on a force platform with their dominant leg (defined as the leg used in kicking a ball).Walking duration of each trial was generally less than 5 seconds.All subjects performed five successful trials for each walking task and rested between each task.

C. Data Collection
A wireless EMG system (Wave plus wireless, Cometa, Milan, Italy) was used to record activations from the vastus lateralis and medialis (VL and VM), rectus femoris (RF), biceps femoris (BF), semitendinosus (ST), tibialis anterior (TA), soleus (Sol), lateral and medial gastrocnemius (LG and MG), flexor hallucis longus (FHL), and extensor digitorum longus (EDL) at a sampling rate of 1200 Hz during walking.Surface electrodes were attached to muscle bellies between an interelectrode distance of 20 mm in recommended locations.
The force platform (9260AA6; Kistler, Winterthur, Switzerland) synchronized the EMG system to record EMG signal data simultaneously at a sampling rate of 1200 Hz.EMG signals were collected during the stance phase of each walking task; this is defined as the period between the initial contact and toe-off, as determined by the force platform recordings.Ground reaction forces measured from the force platform were used to determine the stance phase.

D. Data Processing
Muscle activations acquired from the VL, VM, RF, BF, ST, TA, Sol, LG, MG, FHL, and EDL were processed using MATLAB (MATLAB R2018b, Mathworks, Inc., Natik, MA, USA).Raw EMG signals from walking on FG, US, DS, UH, DH, FGUS, USFG, FGDS, DSFG, FGUH, UHFG, FGDH, and DHFG were passed through a bandpass filter for 20 to 500 Hz.After rectifying the EMG signals, the signals were passed through a fourth-order Butterworth low-pass filter with a 10 Hz cutoff frequency [15].The filtered EMG signals measured from selected muscles in the lower extremity for all walking tasks were normalized for each peak muscle activation amplitude of each subject during FG walking [24].All normalized EMG signals were linearly interpolated to

E. Identification of Walking Tasks
The processed EMG signal data from all walking tasks were separated into the individual muscle, and the separated EMG signals were matched to the walking tasks through labeling.EMG profiles of 1,755 successful trials (27 subjects × 5 successful trials for each walking task × 13 walking tasks) for 13 walking tasks acquired from 27 subjects during the stance phase were used as input into the identification model.1,404 trial data were used as input for training the identification model, and 351 trial data were used as input for evaluating the identification model.
The ANN was used to employ the identification of walking tasks.The ANN architecture consisted of input layers, three hidden layers with the rectified linear unit as an activation function to address the nonlinearity of EMG patterns in our data, and output layers.The entire EMG signal profiles measured from the muscles during the stance phase were fed into the input layer.The output layer was provided a classified walking task.The loss function used a softmax cross-entropy with logits, and the optimizer used adaptive moment estimation to minimize the loss function [15], [25].A regularization technique named dropout was used to prevent overfitting problems in neural networks (Fig. 2) [26].The hyperparameters configuration for our model is listed in Table I.
Thirty-three classification models were trained to identify the current environment and transition from one environment to another as follows: 1 model when using all muscle activations; 6 models when using the activation of the flexor or extensor group for each joint (i.e., knee extensor: RF, VM, and VL; knee flexor: BF and ST; ankle extensor: LG, MG, and Sol; ankle flexor: TA; MTP extensor: EDL; MTP flexor: FHL); 26 models when using a combination of extensor and flexor muscle activations.In addition, the number of electrodes was presented in each model (Table II).The accuracy of each model was computed using the evaluation dataset.The calculation of accuracy and confusion matrix was used for the method defined in previous studies [15], [27], [28].Precision, recall, and F1-score of thirty-three models were calculated to evaluate model performance (supplementary material).
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

III.
The ANN classifier identified each current environment and transition between different terrains during walking with a high degree of accuracy, achieving a success rate of 95.4 % when using muscle activation data from all of the examined muscles (Model #1 in Table II, Fig. 3).
The classification accuracy of the model using the activation of the ankle extensor group (MG, LG, and Sol) showed the highest at 78.1% when the classification accuracy of six models (Models # 2 to # 7 in Table II) trained using the activation of either the flexor or extensor group for each joint was evaluated (knee extensor: 68.1 %; knee flexor:  62.4 %; MTP flexor: 48.4 %; ankle flexor: 45.9 %; MTP extensor: 39.9 %) (Fig. 4).
The classification model using a combination of the knee extensor (RF, VM, and VL), ankle extensor (LG, MG, and Sol), and MTP flexor (FHL) among the 26 models (Models # 8 to # 33 in Table II) showed the highest classification accuracy of 90.9 % (Model #30 in Table II, Fig. 5).
When comparing continuous walking, hill transitions, and stair transitions, the lowest classification accuracy obtained with the model using EMG data from all muscles (Model #1 in Table II) was 89.8 % for hill transitions.Even when using only the ankle extensor and a combination of extensor/flexor muscles for each joint, the hill transition exhibited the lowest classification accuracy, as was the case when all muscle activations were used (Model #4 and #30 in Table II, Fig. 6).

IV. DISCUSSION
The main contribution of this study is that the proposed algorithm using a DL approach based on EMG signal data on the knee, ankle, and MTP joint can identify walking tasks from one environment to another (i.e., FGUS, USFG, FGDS, DSFG, FGUH, UHFG, FGDH, and DHFG).Furthermore, the model trained by the knee extensors, ankle extensors, and MTP flexor provided comparable identification performance to the model trained by all muscle activation.The results of this study indicate that detecting a change in a walking environment using the muscle activation signal of the selected lower extremities during the stance phase could provide the possibility of more accurate device control by obtaining information about the upcoming environment in advance.
The identification accuracy of walking environments, including terrains where the subjects are walking continuously in the existing terrain and transitioning from one terrain to another, was the highest at 95.4 % when using the entire muscle activation profile obtained from all monitored muscles (VL, VM, RF, BF, ST, LG, MG, Sol, TA, EDL, and FHL) of the knee, ankle, and MTP joint during the stance phase (Model #1 in Table II).It should be noted that the high identification accuracy of walking environments using only EMG sensors in this study is comparable to results from previous studies, which used multiple sensors.Su II) during the stance phase.FG, US, DS, UH, DH, FGUS, USFG, FGDS, DSFG, FGUH, UHFG, FGDH, and DHFG indicate walking on flat ground, upstairs, downstairs, uphill, downhill, and transitions from flat ground to upstairs, upstairs to flat ground, flat ground to downstairs, downstairs to flat ground, flat ground to uphill, uphill to flat ground, flat ground to downhill, and downhill to flat ground, respectively.Fig. 6.
Comparison of classification accuracy among continuous walking, stair transitions, and hill transitions when using the EMG signals of (a) the ankle extensor group (Model #4 in Table II), (b) the knee extensor, ankle extensor, and MTP flexor groups (Model #30 in Table II), and (c) all muscle groups (Model #1 in Table II).All muscles used in this study include the vastus lateralis and medialis, rectus femoris, biceps femoris, semitendinosus, tibialis anterior, soleus, lateral and medial gastrocnemius, flexor hallucis longus, and extensor digitorum longus.The knee extensor group indicates rectus femoris, vastus medialis, and vastus lateralis.The ankle extensor group indicates the medial/lateral gastrocnemius and soleus.MTP indicates the metatarsophalangeal joint.The MTP flexor group indicates the flexor hallucis longus.measurement unit sensors; however, classification accuracy of approximately 80 % was achieved when using muscle activation data from only 11 lower extremity muscles [30].In these studies, transitions between walking environments were classified using a machine learning algorithm based on fused data obtained using multiple sensors.However, in our study, we used the entire muscle activation profile obtained during the stance phase as the input of our model without a feature extraction process.Machine learning performance depends on the engineer's experience and the feature extraction method [31], [32].A previous study showed that the entire muscle profile used as input into a DL model classified the five walking environments (flat ground, upstairs, downstairs, uphill, and downhill) due to reflecting the amplitude and timing of the peak amplitude well [15].These findings suggest that it is possible to identify the transition of walking from one terrain to another as well as continuously walking on the current terrain with high accuracy using only EMG signals.
This study found that the muscle activations measured from the ankle extensor muscle groups provide the highest identification accuracy of 78.1 % when grouping the muscles into flexors or extensors of each joint and using them as input into the identification model (Model #4 in Table II).Our finding is consistent with the observations reported by Kim et al. showing a good classification accuracy of 88.9 % for five walking tasks using the activation of the ankle extensor [15].This result implies that the muscle activations of the MG, LG, and Sol may be used as key muscles to classify the walking environments, including transitions between terrains.This information could help reduce the number of inputs required to classify walking environments.In addition, high classification accuracy was shown when using a combination of the muscle activations from the knee extensor, ankle extensor, and MTP flexor as input.Since the decision-making process of the proposed model is a black box, it's difficult to analyze how these muscle groups lead to high classification accuracy of the identification algorithm.However, it is plausible that the corresponding muscle groups acting dominantly in the propulsive phase could improve the accuracy, which is calculated by the probabilistic algorithm [33], [34], [35].This model applying signals of only seven electrodes (Model #30 in Table II) showed an accuracy of Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
90.9 % in classifying the walking environments.Therefore, the number of electrodes (input) could be reduced by using these muscle groups, thereby applying them as key muscles for classifying walking environments, including transitioning from one terrain to another.
Our findings showed that the classification accuracy of hill transition was relatively lower than that of other walking environments when using the activations from all muscles monitored.Furthermore, the classification accuracy of hill transition was also lower when using either the activation of the ankle extensor only or the combination of the knee extensor, ankle extensor, and MTP flexor (Model #4 and #30 in Table II, Fig. 6).Previous studies have reported that classifying uphill and downhill surface transitions during walking is challenging compared with classifying other walking environments [36], [29].This may be due to the similarity of biomechanical parameters during hill walking and transitions between flat ground and hill surface.Although mean LG activation during both downhill walking and transitioning from flat ground to downhill was significantly lower than that during flat ground walking, their patterns and magnitudes were similar in the stance phase [37].Similarly, no significant differences were found in the pattern and mean RF activation during flat ground, uphill walking, and uphill transitioning [37].Taking these previous findings into account, we may conclude that hill transition seemed to be more challenging than other walking environments when classifying walking tasks because of its similarity of muscle activation pattern and/or magnitude.An evidence-based future study is required to increase the classification probability of hill transition based on the overall analysis of each lower extremity muscle.
This study has some limitations.One of the limitations is that we conducted the experiments with only young and healthy subjects who did not put on any walking assistive device.The subjects wearing walking assistive devices may walk in a different way.A previous study has reported that wearing a walking assistive device changes the muscle activation of the lower extremities [38].However, it is considered that the proposed algorithm could adapt to altered EMG patterns because the muscle activation pattern during the stance phase is used as input into the classification model, which is trained through a DL approach.Another limitation is the sample size.Previous studies have investigated the effect of sample size on model accuracy and reported that a small training sample size could exaggerate model accuracy due to overfitting [39], [40], [41].However, in this study, the effect of overfitting on the accuracy of the model was minimized by adopting dropout as a regularization technique, which is a method for preventing overfitting [26].Nevertheless, as the sample size increases, DL performance would increase.In future studies, it is necessary to classify walking environments with more data from subjects.In addition, because only male subjects were included in this study, the current results cannot be generalized to females.To further enhance the identification performance and generalization of the model, more investigation through a larger sample size, including females or subjects wearing walking assistive devices, is warranted.Finally, EMG data from the same subjects was split into training and test sets in this study.This approach may have weakness in the generality of the model, thus further study is required to guarantee the generality of the classification model by testing data from another subject or using the cross-validation technique.

V. CONCLUSION
This study proposed a DL approach for identifying walking environments, including not only terrain in which walking continuously in an existing terrain but also transitions from one terrain to another.This study provides evidence that the entire muscle activation profile of selected lower extremities obtained from a single sensor can be used as input into an ANN model to classify walking environments.Thus, a DL approach based on EMG signals may be considered in the control of walking assistive devices to accomplish seamless motion based on changing walking environments.

Fig. 1 .
Fig. 1.Thirteen walking tasks tested in this study: (a) flat ground, (b) upstairs, (c) downstairs, (d) uphill walking, (e) downhill walking, and (f) transitions from flat ground to upstairs, (g) upstairs to flat ground, (h) downstairs to flat ground, (i) flat ground to downstairs, (j) flat ground to uphill, (k) uphill to flat ground, (l) downhill to flat ground, and (m) flat ground to downhill.The brown box indicates the force plate.

Fig. 2 .
Fig. 2. Artificial neural networks.(a) block diagram for an artificial neural network consisting of input layers, three hidden layers, and output layers.(b) each neuron structure.To prevent the gradient vanishing problem, the rectified linear unit was used as an activation function.The dropout technique was used to prevent overfitting problems in our model.

Fig. 3 .
Fig.3.Confusion matrix for identification of 13 walking tasks using the entire EMG profiles of all muscles (Model #1 in TableII) during the stance phase as input.FG, US, DS, UH, DH, FGUS, USFG, FGDS, DSFG, FGUH, UHFG, FGDH, and DHFG indicate walking on flat ground, upstairs, downstairs, uphill, downhill, and transitions from flat ground to upstairs, upstairs to flat ground, flat ground to downstairs, downstairs to flat ground, flat ground to uphill, uphill to flat ground, flat ground to downhill, and downhill to flat ground, respectively.
et al. reported identification accuracy of 96.3 % when training and evaluating their model using EMG signal, acceleration, and angular velocity data [29].Liu et al. also reported high classification accuracy of 95.1 % based on data obtained from EMG and inertial

Fig. 5 .
Fig. 5. Confusion matrix for identification of 13 walking tasks using the entire EMG profiles of the knee extensor, ankle extensor, and MTP flexor muscle activation (Model #30 in Table II) during the stance phase.FG, US, DS, UH, DH, FGUS, USFG, FGDS, DSFG, FGUH, UHFG, FGDH, and DHFG indicate walking on flat ground, upstairs, downstairs, uphill, downhill, and transitions from flat ground to upstairs, upstairs to flat ground, flat ground to downstairs, downstairs to flat ground, flat ground to uphill, uphill to flat ground, flat ground to downhill, and downhill to flat ground, respectively.

TABLE II TRAINING
MODELS, PARAMETERS, AND NUMBER OF ELECTRODES