Human Gait Recognition System Based on Support Vector Machine Algorithm and Using Wearable Sensors

Human gait recognition is very important for controlling exoskeletons and achieving smooth transformations. Gait information must be obtained accurately. Therefore, in order to accurately control the exoskeleton movement, a multisensor fusion gait recognition system was developed in this study. The system acquires plantar pressure and acceleration signals of human legs. In the experiment, we collected the pressure signals of both feet and the movement data of the waist, left thigh, left calf, right thigh, and right calf of five test subjects. We investigated the gaits of standing, level walking, going up the stairs, going down the stairs, going up the slope, and going down the slope. The gait recognition accuracy of support vector machine (SVM), back propagation (BP) neural network and radial basis function (RBF) neural network were compared. The different sliding window sizes of SVM algorithm were analyzed. The results showed that the recognition rate was higher for the SVM algorithm with an average recognition accuracy of 96.5%. The accurate recognition of the human gait provides a good theoretical basis for the design of an exoskeleton robot control strategy.


Introduction
Lower extremity exoskeleton robots can help patients with mobility problems to walk normally, thereby greatly improving their ability to exercise.At present, most exoskeletons are energy-passive; although they are widely used, they have inevitable disadvantages, such as high metabolic energy consumption and walking asymmetry. (1)Therefore, the study of exoskeletons of the lower extremities has attracted the attention of an increasing number of researchers.Unlike an energy-passive exoskeleton, an active power exoskeleton can recognize the human gait and appropriate parameters can be used to achieve safe and effective motion control. (2)herefore, gait recognition plays an important role in the control of exoskeleton robots.
Many methods have been developed for the pattern recognition of exoskeleton movements in the lower extremities.The pattern recognition is achieved by identifying the signals and biosignals measured by mechanical sensors.Donath et al. identified three gaits of standing, sitting, and walking by collecting data such as the joint angle and angular velocity signals of the knee and ankle joints, sagittal moment, and plantar pressure. (3)However, there is a half-second delay in this identification method.Young et al. developed a gait recognition method that allows the lower extremity exoskeleton to complete a flat walk, walking up and down the slope, and walking up and down the stairs. (4)The system identifies the signals collected by the mechanical sensors mounted on the exoskeleton.Although the method is simple, the recognition accuracy was only 90.9%.Huang et al. identified six motion patterns and motion transitions by measuring the electromyographic (EMG) signals from the lower extremities and the signals measured by a six-degree-of-freedom pressure sensor. (5)However, this method was only suitable for offline testing.
In this paper, a new gait recognition system and an algorithm based on multisensor fusion are proposed.The foot pressure signal and the acceleration signals of the back and legs of the human body are fused using a support vector machine (SVM) algorithm, a back propagation (BP) neural network algorithm, and a radical basis function (RBF) neural network algorithm.The average recognition rate of the SVM algorithm is 95%; therefore, this method is used for the recognition algorithm of the system and the sliding window size is optimized to achieve a higher recognition rate.The experimental results show that the proposed SVM algorithm recognition method can be applied to the lower extremity exoskeleton and accurately recognizes the human gait.

Hardware system
The inertial sensor consists of an accelerometer, a gyroscope, and a magnetometer, as shown in Fig. 1.The design uses an MPU-6000 board with the combined accelerometer and gyroscope.The magnetometer is a surface-mounted modular chip that is suitable for applications with low magnetic inductance and digital disturbances.ATMEGA328 is the microcontrol unit (MCU) used for data acquisition on the inertial measurement unit (IMU) board. (6)The data obtained by the gyroscope is used to evaluate the direction of the IMU board and the data obtained by the magnetometer and accelerometer is used to compensate for the direction deviation.The data output by the IMU board includes the helix angle, the roll angle, and the acceleration along the two axes.
To measure as much useful motion information as possible, the location of the sensor on the subject is important, as shown in Fig. 2. Five inertial sensors were placed on the subject's waist, left thigh, left calf, right thigh, and right calf to measure the acceleration of the lower limb in the sagittal plane.Two pressure insoles were placed in both shoes to detect the gait pattern during the standing phase and to record the plantar pressure.

Foot pressure sensor and position selection
The plantar pressure detection system consists of a sensor that measures the foot pressure, a control portion that receives the signal and detects the gait phase, and a communication device that transmits/receives data.The system is shown in Fig. 3.
The pressure sensor in the gait information acquisition system is FlexiForce A401, as shown in Fig. 4, which is a force-sensitive sensor that is inversely proportional to the force acting on its surface. (7)The sensor has the advantages of small size, high sensing accuracy, and pressure measuring range of 0-110 N, which can meet the gait testing requirements. (8)The characteristics of the FlexiForce A401 pressure sensor are shown in Table 1.In the walking phase, it is important to choose a suitable location for the sensor to collect the plantar pressure data.During walking, the heel is the initial contact part and the toe contact represents the end of the supporting phase.Therefore, the four key points selected for the location of the sensor are the big toe, little toe, second toe, and heel, (9) as shown in Fig. 5.

Measuring system
The system configuration diagram of the gait recognition system is shown in Fig. 6.The gait data acquisition system obtains the leg acceleration data of the human body from the inertial sensors and the foot pressure acquisition system obtains the pressure information of the foot; the data are transmitted to the upper computer and then to the host computer through wireless transmission.The role of the host computer is to display and store the data, and perform preprocessing and feature extraction.The extracted features are input into the gait recognition algorithm for training and detection, the recognition accuracies of several different recognition algorithms are compared, and the optimal algorithm for the gait recognition result is determined.
The human gait data acquisition system consists of sensor signal acquisition and signal transmission.The acquisition part of the sensor signal is divided into seven controller area network(CAN) bus communication nodes, namely, the sensor signal acquisition nodes of the left thigh, left calf, right thigh, right calf, waist, left foot, and right foot.Each IMU module collects the acceleration data of a group of test subjects and the collected data is transmitted to the MCU module of the corresponding slave.When the host sends a data request through the CAN bus, the seven slaves transmit the sensor data to the MCU of the host through the CAN bus.The host transmits the data to the upper computer through the wireless serial port .The data acquisition system is shown in Fig. 7.

Test subjects
Five subjects were used in this experiment (age: 26 ± 2 years old, height: 170 ± 6 cm, weight: 56 ± 4 kg, shoe size: 24.5 ± 2 cm).The specific information (age, height, weight, and shoe size)  of the test subjects is shown in Table 2. Everyone was asked to perform a series of exercises; all subjects were healthy, were able to walk normally, and did not have gait disorders.For accuracy, the material of the shoes was the same and the size of the insole sensor was adapted to the size of the foot.This satisfies the requirements of the experiment.The subjects did not perform strenuous exercise one week before the experiment.A consent form was signed.

Testing protocol
The testers wore inertial sensors and a plantar pressure device, and five inertial sensors were attached to the left thigh, left calf, right thigh, right calf, and waist.The test lasted 3 min and   consisted of standing, going up the stairs, going down the stairs, going up the slope, going down the slope, and walking on level ground.The test conditions are shown in Fig. 8.The walking pace was about 1 m/s.The order of the motions was standing, going up the stairs, going down the stairs, going up the slope, going down the slope, and walking on level ground.Each test was conducted 6 times for each subject.
The frequency of the daily activity of the human body is below 10 Hz. (10) According to the Nyquist sampling theorem, the frequency of the acquisition system of the inertial sensor and plantar pressure device was set at 25 Hz. Figure 9 shows the diagram of the direction of movement.The X-axis direction indicates the forward direction, the Z-axis indicates up and down movements, and the Y-axis indicates left and right movements.
After the data was collected by the MCU, it was sent to the host computer via the CAN bus.The host computer wrote the received data to a TXT file.In the experiment, some of the data were used as training samples for the classification algorithm and as test samples.

Data processing
The raw data consisted of the signal obtained from the microcontroller and the unprocessed sensor data. 1) After the original data were obtained, they were preprocessed using various methods, including filtering, data normalization, and principal component analysis, to minimize noise and prevent redundant data from adversely affecting the subsequent processing.
2) The gait analysis data are time series data and the relevant data features had to be extracted to be used as inputs for the classification algorithm.3) We used the training data in the algorithm to establish the relationship between the features and the gait type.The classifier was corrected to achieve the highest accuracy and the test dataset was used to test the classification accuracy.A wavelet refers to an attenuating wave that is used to analyze and process the time and frequency features of a signal. (11)A wavelet transform can be used to perform a frequency analysis while representing time and the details of the frequency bands in the signal can be determined.A wavelet transform effectively overcomes the problems of the Fourier transform.Wavelet denoising is a denoising method based on the wavelet transform and has been used extensively in many applications. (12)The following three steps were performed: 1) We selected a wavelet base type, set the decomposition level as N, and performed wavelet decomposition transformation on the signal containing noise.
2) The high-frequency coefficients obtained after wavelet decomposition were processed through threshold quantization.3) Wavelet reconstruction was performed using the high-frequency coefficients processed in the previous step and the low-frequency coefficients of the lowest layer after wavelet decomposition.

Sensor data
The gait data were analyzed using MATLAB software.The results of analyzing the X-axis data of the right thigh acceleration sensor are shown in Fig. 10.The movement data represent the data after preprocessing.The data of the six movements/gaits (standing, walking, going up the stairs, going down the stairs, going up the slope, and going down the slope) indicate that the waveforms have periodicity, except for the standing, in which the output of the acceleration sensor is only the gravitational acceleration.The acceleration of each gait cycle in the walking state shows a trend of initial increase, followed by a decrease with the start and end of the movement.There is more complexity when going up and down the stairs and slope, and there are more fluctuations.

Gait recognition based on neural network
The BP neural network is a neural network in which the signals are propagated from the front to the back and the error is only fed back when there is an error in the output results. (13)A schematic diagram of the BP neural network algorithm topology is shown in Fig. 11.
X 1 , X 2 , ..., X m are the inputs of the BP neural network algorithm; ω 1 and ω 2 are the connection weights (percentage); Y 1 , Y 2 , ..., Y m are the outputs of the neural network.
The RBF neural network algorithm belongs to the forward neural network.This function is a real value function that examines the distance between a given value and a central point in space.When applied to the neural network, the approximation degree between the output and expected values of the neural network can be inspected. (14) flowchart of the neural network classification and recognition process is shown in Fig. 12.Using 20-dimensional human gait data, BP and RBF neural network algorithms are realized by using the neural network toolbox in the software of MATLAB 2014.There are 20 input features and 6 output features.The following model built by the MATLAB 2014a neural network toolbox can achieve gait recognition: 1) The input layer has 20 neurons.2) We set the number of hidden layer nodes to 12 using the number of training samples and the input and output layer dimensions.3) In the output layer, an output of 1 means that the respective gait was detected and the other values are 0.There are 6 output classes, namely, standing [1, 0, 0, 0, 0, 0], walking on level ground [0, 1, 0, 0 , 0, 0], walking up the stairs [0, 0, 1, 0, 0, 0], walking down the stairs [0, 0, 0, 1, 0, 0], walking up the slope [0, 0, 0, 0, 1, 0], and walking down the slope [0, 0, 0, 0, 0, 1].4) A tansig-logsig function is used as the transfer function of the error from the input layer to the hidden layer and the hidden layer to the output layer.5) The learning function selects trainlm.6) The number of learning sessions on the network is set to 3000, the learning rate is set to 0.005, and the training target is set to 0.004.The network is trained with 180 groups of samples and tested with 180 groups of samples.The classification accuracy and mean square error of the test results are used to assess the performance.
The classification models based on the BP and RBF neural network algorithms are established in MATLAB.The accuracy of the gait recognition classification is shown in Table 3.
As can be seen from Table 3, the recognition rate of the BP neural network algorithm is obviously higher than that of the RBF neural network algorithm.The average recognition rate of the BP neural network algorithm is 93.3%, and the average recognition rate of the RBF neural network algorithm is 91.2%.12. Flowchart of neural network classification and identification.

Gait recognition based on SVM
The support vector is the point closest to the hyperplane and the objective is to maximize the distance from the support vector to the hyperplane to distinguish the two categories.The two-class SVM algorithm can be extended to a multiclass SVM algorithm.For the k-category problem, an objective function is used with the objective to maximize the boundary distance between each category and all other categories. (15)The optimization function used in the SVM algorithm method is defined as where w and b are the hyperplane parameters, c is the penalty factor, y i is the label of the first category, and ϕ(x i ) is the kernel function.
The optimization problem can be converted into a constrained problem, as shown in the equations subject to * , ( ) , , ( ) + -y , , 0, where c is the penalty factor, , i w x 〈 〉 is the data dot product, (x i , y i ) are the input and output data, * , i i ξ ξ and * , i i ξ ξ are the slack variables, and ϕ is the kernel function.N-dimensional data are nonlinearly separable and it is necessary to use a low-dimensional feature space and map it to a high-dimensional feature space.In this case, it is necessary to use a kernel function to complete the transformation, thereby achieving linear separability in a high dimension.In this study, linear and polynomial kernel functions are used for the gait classification.
The SVM algorithm classifier is defined as , The linear kernel function is defined as ( ) The polynomial kernel function is defined as , , The sliding window size is 50 and the cell size is 1 s is; 180 samples are used as training samples and 180 samples are used as test samples.The absolute acceleration characteristics in the 2D time domain and the peak characteristics of the angular acceleration of a fast Fourier transform in the Z-direction in the 4D frequency domain are used for preliminary testing.The classification accuracies of the two kernel functions are shown in Table 4.
It is observed in Table 4 that the recognition rate is higher for the linear kernel function than for the polynomial function.Therefore, the linear function is selected as the kernel function of the SVM for the subsequent control variable experiment.To achieve real-time gait recognition, the gait should be detected within one-third of the gait cycle of the subject under ideal conditions.Therefore, the sliding window size is used as a variable to assess the accuracy of the gait recognition.The results are shown in Table 5.Table 5 shows that with the increase in sliding window size, the recognition rate increases gradually.The recognition delay time is within the range of 0-1.5 ms, all within the acceptable range.When the sliding window is 30, the average recognition rate is the highest, reaching more than 85%.To achieve gait recognition with good accuracy, a sliding window size of 30 is chosen.The recognition feature is extended from the 6-dimensional feature space to the absolute acceleration feature in the 4D time domain and to the peak feature of the 12-dimensional feature space in the frequency domain of the angular acceleration of the fast Fourier transform, resulting in a total of 16-dimensional features.The recognition accuracy is shown in Table 6.
As shown in Table 6, the SVM algorithm uses a linear kernel function, the sliding window size is 30, the data have a 16-dimensional feature space, and the recognition accuracy rate is 93.94%.The classification accuracy is excellent.To achieve a more accurate recognition rate, we reduce the sliding window size to 15 and the dimensions to 16, and maintain the other variables constant.The recognition accuracy results are shown in Table 7.
The classification accuracy is higher for the sliding window size of 15.Therefore, this window size is used for the final gait classification.A comparison is conducted between the correct and predicted labels for the classes, and the classification accuracy is calculated.The results are shown in Table 8.

Classification results
According to the above results, human gait recognition is achieved using the SVM algorithm and BP and RBF neural network algorithms.As shown in Table 3, the accuracy of the BP neural network algorithm is higher than that of the RBF neural network algorithm.Therefore, we only compare the SVM algorithm with the BP neural network algorithm.The classification results for the gait recognition using the SVM algorithm and BP neural network algorithm are shown in Table 9.
Table 9 shows the classification accuracies for detecting the gaits of standing, walking, going up the stairs, going down the stairs, going up the slope, and going down the slope.It is evident that when the sliding window is 15, the accuracy is significantly higher for the SVM algorithm than for the BP neural network algorithm.Both algorithms exhibit good accuracy for detecting the standing phase and the accuracy is 98% for the SVM algorithm.In the walking phase, the accuracy of the SVM algorithm is 97% and that of the BP neural network algorithm is 96%.The accuracy of the SVM algorithm is significantly higher than that of the BP neural network algorithm in the going up the stairs, going down the stairs, going up the slope, and going down the slope, and the accuracy of these stages is higher than 95%.The average recognition rate of the SVM algorithm is 96.5% and that of the BP neural network algorithm is 93.3%.Therefore, the gait recognition algorithm using the SVM algorithm is very suitable for gait detection and the recognition rate is high, making it highly suitable for controlling exoskeleton robots.

Conclusions
The accurate identification of human movements and gaits is of great significance for the control of exoskeleton robots.In this study, we developed a human gait recognition system, with the acquisition and analyses of human leg movement data and plantar pressure information, so as to recognize human gait.With the fusion of acceleration and plantar pressure signals, the system achieves high-precision gait recognition.The gait recognition accuracy of SVM algorithm and neural network algorithm were compared.When the sliding window of the SVM algorithm is 15, the gait recognition rate is 96.5%.The recognition rate of the BP neural network is 93.3%, and that of the RBF neural network is 91.2%.The recognition rate of the SVM algorithm is obviously higher than those of the neural network algorithms.The experimental results show that the gait recognition system based on the SVM algorithm is capable of detecting the human gait with high accuracy, demonstrating that the movement of an exoskeleton robot can be effectively controlled.

Table 2
Test subject information.

Table 3
Classification accuracy of gait recognition using the BP and RBF neural network algorithms.

Table 4
Accuracy of the classification based on different kernel functions.

Table 6
Accuracy of the SVM classification based on different feature space dimensions.

Table 7
Accuracy of the SVM algorithm classification based on different sizes of moving windows.

Table 8
Gait recognition classification accuracy using the SVM algorithm classifier.

Table 9
Classification accuracy for gain recognition using SVM algorithm and BP neural network algorithm.