15
Page 1 of 15 User Activity Recognition Based on Kalman Filtering Approach EEC 592, Prosthesis Design and Control Final Project Report Gholamreza Khademi [email protected] December 02, 2014 Abstract Different control methods are used to control a prosthetic leg. Finite-state machine is one of the well-known strategies applied in the control design. Since, the dynamic and kinematics of human motion is changing during various walking modes, a separate controller is used for different phases. Finite-state machine is used for this purpose. To let the prosthetic leg choose the suitable control mode and transit from one phase to another, the user intent recognition is required. The concept behind user intent recognition is to compare the current state of prosthesis to the trained probabilistic models obtained for each activity such as standing, walking, sitting and etc. to identify the activity a user is performing. The main focus of this project is to use the mechanical information of sensors such as joint position, velocity and ground reaction force (GRF) to train a model to determine the user activity recognition. It is assumed the human walking is quasi- periodic, and a Fourier series based model is fitted to each activity mode. The coefficients of Fourier series are different for each activity. The difference is a rich feature to classify various walking modes. Two different approaches are implemented to estimate the coefficients of Fourier series. First, offline user activity recognition is developed by solving a minimization problem. Then, a kalman filtering approach is implemented to estimate the coefficients of Fourier series model. The model is trained for standing, level walking, ramp up and ramp down with slope of 5 degree. Some human walking test data is applied to the system; and performance of obtained model is verified by identifying the user’s activity. 1. Introduction According to the literature, most of user intent recognition is based on Electromyography (EMG) signals. In [1, 2], EMG based user intent recognition is applied and signals from the stump residual is collected to determine the user purpose. This is done for level walking, ramp up and down with various slopes. However, in some papers, mechanical information from sensors on the prosthetic leg is used to determine the user intent. In [3], an EMG based pattern recognition is tested on different able-bodied and above knee amputation subjects. They could obtain 90% accuracy to identify the user intent. They improved the accuracy by fusion of mechanical information from sensors and the EMG signals. Moreover, in [4] sensors information for a patient with transfemoral amputation is recorded for different locomotion modes and showed 100% accuracy in detecting the transition. The application of user intent recognition is not merely restrained to human prosthetic limb. In [5], the measured data from the cellphone accelerometer is utilized to perform activity recognition. Either EMG or sensor based user intent recognition are similar to each other. Actually, both strategies attempt to obtain specific features from the collected data to train a model and classify different locomotion modes. Then, the resulting model is utilized to conclude the user’s intent. General architecture of user intent recognition system is shown in Figure 1.

User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

  • Upload
    others

  • View
    41

  • Download
    1

Embed Size (px)

Citation preview

Page 1: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Page 1 of 15

User Activity Recognition Based on Kalman Filtering Approach

EEC 592, Prosthesis Design and Control

Final Project Report

Gholamreza Khademi [email protected]

December 02, 2014

Abstract Different control methods are used to control a prosthetic leg. Finite-state machine is one of the

well-known strategies applied in the control design. Since, the dynamic and kinematics of human

motion is changing during various walking modes, a separate controller is used for different

phases. Finite-state machine is used for this purpose. To let the prosthetic leg choose the suitable

control mode and transit from one phase to another, the user intent recognition is required. The

concept behind user intent recognition is to compare the current state of prosthesis to the trained

probabilistic models obtained for each activity such as standing, walking, sitting and etc. to

identify the activity a user is performing. The main focus of this project is to use the mechanical

information of sensors such as joint position, velocity and ground reaction force (GRF) to train a

model to determine the user activity recognition. It is assumed the human walking is quasi-

periodic, and a Fourier series based model is fitted to each activity mode. The coefficients of

Fourier series are different for each activity. The difference is a rich feature to classify various

walking modes. Two different approaches are implemented to estimate the coefficients of

Fourier series. First, offline user activity recognition is developed by solving a minimization

problem. Then, a kalman filtering approach is implemented to estimate the coefficients of

Fourier series model. The model is trained for standing, level walking, ramp up and ramp down

with slope of 5 degree. Some human walking test data is applied to the system; and performance

of obtained model is verified by identifying the user’s activity.

1. Introduction According to the literature, most of user intent recognition is based on Electromyography (EMG)

signals. In [1, 2], EMG based user intent recognition is applied and signals from the stump

residual is collected to determine the user purpose. This is done for level walking, ramp up and

down with various slopes. However, in some papers, mechanical information from sensors on the

prosthetic leg is used to determine the user intent. In [3], an EMG based pattern recognition is

tested on different able-bodied and above knee amputation subjects. They could obtain 90%

accuracy to identify the user intent. They improved the accuracy by fusion of mechanical

information from sensors and the EMG signals. Moreover, in [4] sensors information for a

patient with transfemoral amputation is recorded for different locomotion modes and showed

100% accuracy in detecting the transition. The application of user intent recognition is not

merely restrained to human prosthetic limb. In [5], the measured data from the cellphone

accelerometer is utilized to perform activity recognition. Either EMG or sensor based user intent

recognition are similar to each other. Actually, both strategies attempt to obtain specific features

from the collected data to train a model and classify different locomotion modes. Then, the

resulting model is utilized to conclude the user’s intent. General architecture of user intent

recognition system is shown in Figure 1.

Page 2: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

Figure 1: General architecture of user intent recognition system, taken from [3].

In the present project, the same steps as shown in general architecture of user intent recognition

system are followed. An appropriate set of sensors data will be selected as the input to the user

intent recognition system. The selected input sets are knee angle and hip angle for the standing,

level walking, and ramp up and down with the slope of 5 degree. The data are provided by VA.

Then, the model is trained based on these sets of data for each activity.

Since the human walking is similar to a periodic signal, it is possible to fit a Fourier series to

each periodic signal. Thus, the Fourier series is used as the model. The coefficients of Fourier

series are different at each walking mode. Two approaches are used to obtain the coefficients.

First, the Fourier series is fitted to knee and hip angle for different walking modes. This is done

by solving a minimization problem. Levenberg-Marquardt algorithm is used for this purpose.

Then, the coefficients are labeled and classified with a simple classification method. This

approach is called offline user activity recognition, since it requires the whole human gait data at

a time to fit a Fourier series. This is the main drawback of this method. To resolve the problem,

kalman filtering approach is proposed to obtain the coefficients at each time step. In this way, it

is possible to have real time user intent recognition.

The project is outlined as follows. In section 2, offline user activity recognition is introduced.

Moreover, Levenberg-Marquardt Algorithm and k-NN classification method is introduced in this

section. Online user activity recognition and kalman filter is described in section 3. Finally,

conclusions and future work are discussed in section 4.

Page 3: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

2. Offline user activity recognition Human gait data is similar to a periodic signal. It is possible to fit a Fourier series to each

periodic signal. Figure 2 shows a normal able-bodied gait data for several strides. It is obvious

the data trend is periodic.

Figure 2: normal able-bodied gait data for several strides, taken from [6].

Fourier series is used as the model. The coefficients of Fourier series are different at each

walking mode. The Fourier series is fitted into the knee and hip angle for different walking

modes. This is done by solving a minimization problem. The Levenberg-Marquardt algorithm is

used for this purpose. Then, the coefficients are labeled and classified with a simple

classification method. This approach is called offline user activity recognition, since it requires

the whole human gait data at a time to fit a Fourier series. This is the main drawback of this

method. After training step, the model is used to identify the user’s activity for a sample test

data. The offline user activity recognition approach is summarized in Figure 3.

Figure 3: offline user activity recognition approach

In the following subsection, 2.1, the general form of Fourier series is reviewed. Then, in

subsection 2.2, Levenberg-Marquardt algorithm is applied to fit Fourier series into the knee and

hip angle. k-NN classification method is introduced in subsection 2.3.

Page 4: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

2.1. Fourier series A periodic function, ����, can be represented as a Fourier series with an unlimited sum of cosine

and sine terms. The study of Fourier series is a part of harmonic analysis. Fourier series is a

useful tool to approximate any periodic function with a preferred or practical accuracy. In Figure

4, a square wave is approximated by sum of cosine and sine.

Figure 4: a square wave approximated by Fourier series

The Fourier series of a given periodic function ����, with period � is ���� � 12 � � �cos�������

��� � ��sin���������� �1�

2.2. Levenberg-Marquardt algorithm Levenberg–Marquardt method (LM) was introduced by Levenberg and Marquardt, suggests a

solution to the minimization problem of a nonlinear function [7]. The LM algorithm is an

iterative gradient based method that finds the local optimum in a search domain. The LM

algorithm combines the simple steepest descent and the Gauss–Newton algorithms. It has the fast

convergence benefit of Gauss–Newton method and the stability of steepest descent method.

The LM method is wildly used to solve nonlinear least square optimization problems. Curve

fitting problems can be defined in terms of nonlinear least square optimization problem. The LM

optimization method finds the local optimum value for the decision variables, so as to minimize

any objective function. The curve fitting minimization problem can be defined as follows [8]: minimize� ���� � 12 ! �2�

Where ���� is given as the objective function and � represents decision variable vector which is

Fourier series coefficients. is given as the error vector. The error is defined as equation (3),

where " is the human gait data like knee and hip angle and "# is the Fourier series model. � $ �⋮ &' � " ( "#����3�

The gradient based algorithms require the derivative of objective function with respect to the

decision variables. The derivative of objective function is given by

Page 5: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

*+�, � -����-� � .! �4� . is called Jacobian matrix. The Jacobian matrix is given as

. �01112- �-�� ⋯ - �-��⋮ ⋱ ⋮- &-�� ⋯ - &-��56

667�5�

Where 9 is the number of weights and � is the number of decision variables. The update rule of

LM approach could be written as �: � �:;� ( <.!. � =>?;�.! �6�

.!. is known as the second order Hessian matrix and the term => is added to make sure the

Hessian matrix is always invertible. > is an identity matrix and = is the damping parameter.

Selection of damping parameter is important in performance and fast convergence of LM

algorithm. If a step is acceptable, it means there is decrease in objective function. Thus, it is

preferred to decrease damping parameter to have more speed in convergence toward the correct

direction. Similarly, if the step is unaccepted, damping parameter must be increased until an

acceptable step is achieved. The LM method pseudocode is summarized as follows.

Initialize ��, =, =BC,=DEF� and G � 0

While not (termination criterion)

Calculate the objective function: �:��:� Calculate the derivative of objective function: *+�:, � .! :

Calculate the Hessian matrix: I � .!. � => Loop to adjust =

Update decision variable with LM rule: �:J� � �: ( I;�*+�:,

Calculate objective at new obtained point: �:J���:J�� If �:J� < �: then �:J� is acceptable & = � = =DEF�⁄ & Next iteration

If �:J� > �: then �:J� is unacceptable & = � = × =BC & Loop to adjust =

Next iteration G ← G � 1

The curve fitting problem is solved by LM optimization method. A Fourier series with 2

frequencies is fitted into the knee angle. The optimum values of coefficients are obtained. The

coefficients are compared with their initial values in Table 1. The LM method can stuck in the

local optimum. To prevent that LM method is ran for different random initial guess.

Table 1: coefficients of Fourier series with 2 frequencies fitted into the knee angle

Simulation Case � � �� P �P �� RMSE

LM method = � 0.5, =DEF� � =BC � 10

Initial 0 0 0 0 0 6 34.2169

Optimum 27.7027 8.3295 18.9662 -12.34 14.432 4.8893 4.5006

In Figure 5, the Fourier series with optimum coefficients is plotted versus the knee angle.

Moreover, the variations of coefficients for achieving their optimum values are shown in this

Figure.

Page 6: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

0 0.2 0.4 0.6 0.8 1 1.2 1.40

10

20

30

40

50

60

70

Kn

ee A

ng

le

Time (Sec)

Knee Angle

Fitted Knee Angle

1 2 3 4 5 6 7 8 9 10 11-30

-20

-10

0

10

20

30

Iterations

Co

eff

icie

nts

a0

a1

b1

a2

b2

w0

Figure 5: fitted Fourier series versus knee angle (Right), coefficients update (Left)

An important question about this method will remain unanswered. How many frequencies are

needed for the Fourier series to achieve a suitable curve fitting? To reply this question, the usual

system order selection approach will be used. There are different ways to select an appropriate

order for the estimated models. There are two main principles: goodness of fit and parsimony.

According to the goodness of fit principle, appropriate order is the one that fits the model output

to the reference output as close as possible. The parsimony principle selects the simplest model

with reasonable fitness. There are various mathematical criteria allow to select the best model

order. These methods create balance between the model fit and model simplicity.

The error of curve fitting is computed for different number of frequencies. Figure 6 shows the

root mean square error (RMSE) with respect to number of Fourier series frequencies.

Figure 6: RMS error with respect to number of frequencies

1 2 3 4 5 6 7 8 9 100

2

4

6

8

10

12

14

No. of Frequency

RM

SE

Page 7: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

0 0.2 0.4 0.6 0.8 1 1.2 1.40

20

40

60

80

y

1 Freq.

2 Freq.

3 Freq.

4 Freq.

5 Freq.

6 Freq.

7 Freq.

8 Freq.

9 Freq.

10 Freq.

0 0.2 0.4 0.6 0.8 1 1.2 1.40

20

40

60

80

Knee A

ngle

0 0.2 0.4 0.6 0.8 1 1.2 1.40

20

40

60

80

Time (Sec)

y

10 Freq.

y

3 Freq.

According to the principle of Parsimony, the Fourier series with 3 frequencies is used. By this

choice, it is tried to make a balance between the models fit and model simplicity. The Fourier

series with different frequencies is fitted to the knee angle in Figure 7. In this Figure, it is shown

that the fitness of Fourier series with 3 frequencies is approximately close to the one with 10

frequencies. To show that numerically, LM method is applied to fit the Fourier series. RMS error

is computed for different frequencies and placed in Table 2. The RMS error obtained from LM

method is compared to the RMS error provided by curve fitting tool in MATLAB. It could be

shown that the LM method performs better than MATLAB curve fitting toolbox. It should be

noted that MATLAB curve fitting tool could not fit a Fourier series with more than 8

frequencies.

Figure 7: Fourier series with different frequencies versus the knee angle

Table 2: Fourier Series RMS error with respect to number of frequencies

RMSE LM Method MATLAB Cftool

1 Freq. 13.1157 13.32

2 Freq. 4.5006 4.607

3 Freq. 1.8200 1.878

4 Freq. 1.5021 1.562

5 Freq. 0.9706 1.018

6 Freq. 0.6738 0.7126

7 Freq. 0.5909 0.6304

8 Freq. 0.4086 0.4397

9 Freq. 0.3208 -

10 Freq. 0.2305 -

As a result, a Fourier series with 3 frequencies is selected to fit into the knee and hip angle for

standing, level walking, ramp up and ramp down modes. The Fourier series coefficients are

obtained for each mode by solving the LM optimization method. For simplicity, the coefficients

which are explicitly different in each walking mode are inserted in Table 3. These coefficients

represent the user activity mode. They are used as the features and classified by k-NN

classification algorithm. "�R� � � � � cos���R� � �� sin���R� � P cos�2��R� � �P cos�2��R� � S cos�3��R� � �S cos�3��R��7�

Page 8: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

Table 4: Fourier series coefficients for different walking modes

Training Phase Knee Angle Hip Angle

Standing � � 0.7825 �� � 4.44 � � (12.27 �� � 0.88

Level Walking � � 25.5 �� � 5.13 � � 2.1 �� � 5.14

Ramp Up � � 26.25 �� � 4.92 � � 9.8 �� � 4.89

Ramp Down � � 25.11 �� � 4.95 � � (1.8 �� � 4.87

2.3. k-NN classification method k-Nearest Neighbors algorithm (k-NN) is the simplest machine learning algorithm for classifying

a test object. The classification method is divided into training and testing categories. In the

training case, the training objects are stored with a class label. In testing phase, the test object is

classified based on a similarity measure. In other words, the distance of test object to every

training object is calculated. Then, the test object is classified based on the majority vote of its G

nearest neighbors. If G � 1, the class of test object is assigned to the nearest training object class.

A usual similarity measurement is the distance between the test and training object. The common

continues distance function used in the k-NN algorithm is Euclidean distance and Sum of

absolute differences.

EuclideanDistance � ^ ��_ ( "_�P�_�� �8�

AbsoluteDifference � |�_ ( "_|�_�� �9�

Where "_ is the training vector and �_ is the test vector. An example of k-NN algorithm is shown

in Figure 8. There are two classes. The first class is blue squares and the red triangles are the

second class. The test example is green circle. For G � 3, the three nearest neighbors of test

example is covered by a solid line circle. It is obvious that the test object is assigned to the

triangle class. However, it is assigned to the square class according to the majority vote of its 5

nearest neighbors for G � 5 [9, 10, 11].

Figure 8: If G � 3, green circle is classified as triangle class. If G � 5, the circle is assigned to the square

class.

Page 9: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

The Fourier series coefficients obtained by LM method represent the user activity mode. They

are used as features and classified by k-NN classification algorithm. The coefficients for 4

standing, 4 level walking, 9 ramp up and 10 ramp down trials are obtained and used as training

set. A standing, level walking, ramp up, ramp down, level walking and standing mode are used

as test data, respectively. The coefficients are obtained for these test dataset and classified with

k-NN. k-NN assigned the correct class to each walking mode. The result is shown in Figure 9.

Figure 9: Knee and hip angle for a test walking trial

It could be concluded that the knee angle is not suitable sensor information for user activity

recognition. Since, the knee angle is quite the same in different activity modes such as level

walking, ramp up and down.

3. Online user activity recognition As discussed, it is impossible to apply offline user activity recognition in practice. Since, it

requires the whole human gait data at a time to fit a Fourier series. This is the main drawback of

this method. To resolve the problem, kalman filtering approach is proposed to obtain the

coefficients at each time step. In this way, it is possible to have real time user intent recognition.

The online user activity recognition approach is summarized in Figure 10. Finally, k-NN

classification method is used to classify the obtained coefficient for various activities.

Figure 10: online user activity recognition approach

To utilize kalman filter approach for estimation of Fourier series coefficients, a state-space

realization is required for the Fourier series. In subsection 3.1, a state-space equation is

developed for the Fourier series. Then, the continues-time extended kalman filter is used to

estimate the coefficients for different walking mode. These coefficients are used as training

dataset.

Page 10: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

3.1. Fourier series state-space realization A periodic signal can be represented by a Fourier series. Suppose the signal period is �. Thus,

the angular frequency is given as �� � 2e �⁄ . " � � � �cos����R��

��� � ��sin����R����� �10�

It is possible to obtain a linear state-space realization for the Fourier series [12]. fgh � igg ∈ ℛ�" � lg" ∈ ℛ �11� Where,

g �011111112

� cos����� � ��sin�����(� sin����� � ��cos�����P cos�2���� � �Psin�2����(P sin�2���� � �Pcos�2����⋮� cos������ � ��sin������(� sin������ � ��cos������� 566666667

i �0111112 0 ��(�� 0 0 ⋯ 00⋮ 0 2��(2�� 0 ⋮

0 ⋯ 0 ⋱ 0 ���(��� 0 5666667

l � <1 0 1 0 ⋯ 1 0 1?�12�

Since, the angular frequency is varying for different walking mode; it may be a useful feature for

classification. Thus, it is desired to estimate the angular frequency, too. As a result, the state-

space is changed from linear into nonlinear. A Fourier series with 3 frequencies is again used to

fit to the human gait data. "�R� � � � � cos���R� � �� sin���R� � P cos�2��R� � �P cos�2��R� � S cos�3��R� � �S cos�3��R��13�

mnnnonnnp�� �� cos����� � �� sin������P � (� sin����� � �� cos������S � P cos�2���� � �P sin�2�����q � (P sin�2���� � �P cos�2�����r � S cos�3���� � �S sin�3�����s � (S sin�3���� � �S cos�3�����t � ��u � ��

→ mnnnonnnp �h� � �u�P�hP � (�u���hS � 2�u�q�hq � (2�u�S�hr � 3�u�s�hs � (3�u�r�ht � 0�hu � 0" � �� � �S � �r � �t

�14�

Page 11: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

The coefficients of Fourier series could be updated by solving the linear algebraic equation of

(15). w���x � y cos��u�� sin��u��( sin��u�� cos��u��z;� w���Px � ��;� w���Px w���x � y cos��u�� sin��u��( sin��u�� cos��u��z;� w�S�qx � �P;� w�S�qx w���x � y cos��u�� sin��u��( sin��u�� cos��u��z;� w�r�sx � �S;� w�r�sx � � �t�15�

Where ��, �P and �S matrices are always invertible.

3.2. Continues-time extended kalman filter The continues-time extended kalman filter can be summarized as follows [13].

1. The system equations are given as �h � ���, {, |, R�,|~�0, ~� " � ℎ��, �, R�,�~�0, ���16�

2. Calculate the following partial derivative of matrices: i � -�-���# � � -�-|��# l � -ℎ-���# � � -ℎ-���# �17�

3. Calculate the following matrices: ~� � �~�! �� � ���!�18�

4. Kalman filter update equations: �#�0� � �<��0�? ��0� � �<���0� ( �#�0�����0� ( �#�0��!? �#h � ���#, {, 0, R� � �<" ( ℎ��#, 0, R�? � � �l!��;� �h � i� � �i! � ~� ( �l!��;�l��19�

Where the nominal noise values |� and �� are zero. The following values are chosen for ~, �

and ��. �� � ��*�<11111111 ( 16?�� � 0.1~ � 700 ∗ ��*�<11111110.00001?��20�

Page 12: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

Continues-time extended kalman filter is used to estimate the Fourier series coefficients. The

coefficients represent the user activity mode. They are used as features and classified by k-NN

classification algorithm. The coefficients for 4 standing, 9 ramp up and 10 ramp down trials are

obtained and used as training set. Since, the human gait data for transient mode is not available;

the classifier is trained with steady state values of coefficients. Thus, it must be noted that the

training is merely done for the last 2 second at each activity mode. Then, knee and hip angle for

standing, ramp up and ramp down are given to the system separately as test data. The

coefficients are obtained for these test dataset at each time step. The activity mode is checked by

k-NN classification method only every 100 steps. This is just done for simplification of

simulation. Figure 11, 12 and 13 shows the satisfactory performance of kalman filter in tracking

knee and hip angle at standing, ramp up and ramp down mode, respectively. k-NN classifier

assigned the correct class to each walking mode for the last 2 seconds. It is completely

reasonable, since the classifier is only trained for that period.

Figure 11.a: standing mode test data

Figure 11.b: result of classifier

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80

0.2

0.4

0.6

0.8

Kn

ee A

ng

le

Standing Mode

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8-8

-6

-4

-2

0

Time (Sec)

Hip

An

gle

Hip

Estimated

Knee

Estimated

1 2 3 4 5 6 7 8

Standing

Ramp Up

Time Sample

Walking Mode

Page 13: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

Figure 12.a: ramp up mode test data

Figure 12.b: result of classifier

0 1 2 3 4 5 60

20

40

60

80

Kn

ee

An

gle

Ramp Up Mode

0 1 2 3 4 5 6-30

-20

-10

0

10

20

30

40

Time (Sec)

Hip

An

gle

Hip

Estimated

Knee

Estimated

0 10 20 30 40 50 60Standing

Ramp Up

Ramp Down

Time Sample

Walking Mode

Page 14: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

Figure 13.a: ramp down mode test data

Figure 13.b: result of classifier

4. Conclusion In the present project, a Fourier series is fitted into human gait data. The Fourier series

coefficients are different at each activity mode. Thus, the difference is a valuable feature to

identify user activity mode. Knee and hip angle are used for standing, level walking, ramp up

and ramp down mode. An offline and online user activity recognition is developed. In offline

activity recognition, a LM minimization problem is solved to obtain the optimum values for

coefficients. Then, k-NN classification method used to classify the training coefficients. Each

coefficient vector is related to an activity mode. Some test gait data applied to the trained system.

The results verified the performance of method.

However, the offline activity recognition is not useful for real time implementation. Therefore,

the online activity recognition is proposed. In online activity recognition, to establish the model

and obtaining the Fourier series coefficients appropriately; kalman filtering approach is used to

estimate the coefficients. Then, the classification method is completely the same as before.

Kaman based activity recognition resulted in satisfactory performance.

0 1 2 3 4 5 6-50

0

50

100

Kn

ee

An

gle

Ramp Down Mode

0 1 2 3 4 5 6-40

-20

0

20

40

Time (Sec)

Hip

An

gle

Hip

Estimated

Knee

Estimated

0 10 20 30 40 50 60Standing

Ramp Up

Ramp Down

Time Sample

Walking Mode

Page 15: User Activity Recognition Based on Kalman Filtering Approachembeddedlab.csuohio.edu/Prosthetics/media/GKhademi.pdf · User Activity Recognition Based on Kalman Filtering Approach

Final Project Report Gh. Khademi

In this project, many other important human gait data such as GRF and hip torque were not

available. In future work, these valuable information will be used. They will certainly increase

the accuracy of user intent recognition. Moreover, the classifier will be trained for transient

modes. Applying a more advanced classification method such as support vector machine (SVM)

is in mind, too. Finally, it will be tried to implement the proposed user intent recognition.

References

[1] F. Zhang, H. Huang, “Decoding movement intent of patient with multiple sclerosis for the

powered lower extremity exoskeleton,” Engineering in Medicine and Biology Society,

Beskrivelse, pp. 4957–4960, 2013.

[2] L. Peeraer, B. Aeyels and G. Van der Perre, “Development of EMG-based mode and intent

recognition algorithms for a computer-controlled above-knee prosthesis,” Journal of

Biomedical Engineering, vol. 12, pp. 178–182, 1990.

[3] F. Zhang, H. Huang, “Real Time Recognition of User Intent for Neural Control of Artificial

Legs,” Proceedings of the MyoElectric Controls/Powered Prosthetics Symposium

Fredericton, New Brunswick, pp. 45–50, 2011.

[4] H. Varol, F. Sup and M. Goldfarb, “Multiclass Real-Time Intent Recognition of a Powered

Lower Limb Prosthesis,” IEEE Transactions on Biomedical Engineering, vol. 57, no. 3, pp.

542–551, 2010.

[5] J. R. Kwapisz, G. M. Weiss and S. A. Moore, “Activity Recognition using Cell Phone

Accelerometers,” SensorKDD, Washington, pp. 44–46, July 2010.

[6] V. D. Bogert, Kinematics, kinetics, amputee gait,

http://academic.csuohio.edu/simond/courses/prosthesis/.

[7] K. Levenberg, “A method for the solution of certain problems in least squares, The Quarterly

of Applied Mathematics, vol. 2, pp. 164–168, 1944.

[8] D. Marquardt, “An algorithm for least-squares estimation of nonlinear parameters,”

Journal of the Society for Industrial and Applied Mathematics, vol. 11, pp. 431–441, 1963.

[9] G. Toussaint, “Geometric proximity graphs for improving nearest neighbor methods in

instance-based learning and data mining,” International Journal of Computational Geometry

and Applications, vol. 15, pp. 101–150.

[10] J. Gou, T. Xiong and Y. Kuang, “A Novel Weighted Voting for K-Nearest Neighbor Rule,”

Journal of Computers, vol. 6, no. 5, pp. 833–840, 2011.

[11] T. M. Cover, and P. E. Hart, “Nearest neighbor pattern classification,” IEEE Transactions

on Information Theory, vol. 13(1), pp. 21–27, 1967.

[12] R. Bitmead, A. Tsoi and P. Parker, “A Kalman Filtering Approach to Short-Time Fourier

Analysis,” IEEE Transactions on Acoustic, Speech, and Signal Processing, vol. 34, no. 6, pp.

1493–1501, 1989.

[13] D. J. Simon, “Nonlinear Kalman filtering,” in Optimal State Estimation, 1st ed. New Jersey,

John Wiley & Sons, Inc., 2006, 13, 13.2, pp. 400–407.