Content uploaded by Hong Yin Ajax Lau
Author content
All content in this area was uploaded by Hong Yin Ajax Lau on Mar 26, 2014
Content may be subject to copyright.
ORIGINAL ARTICLE
Support vector machine for classification of walking conditions
using miniature kinematic sensors
Hong-Yin Lau Æ Kai-Yu Tong Æ Hailong Zhu
Received: 7 December 2006 / Accepted: 19 February 2008 / Published online: 18 March 2008
Ó International Federation for Medical and Biological Engineering 2008
Abstract A portable gait analysis and activity-monitor-
ing system for the evaluation of activities of daily life
could facilitate clinical and research studies. This current
study developed a small sensor unit comprising an accel-
erometer and a gyroscope in order to detect shank and foot
segment motion and orientation during different walking
conditions. The kinematic data obtained in the pre-swing
phase were used to classify five walking conditions: stair
ascent, stair descent, level ground, upslope and downslope.
The kinematic data consisted of anterior–posterior accel-
eration and angular velocity measured from the shank and
foot segments. A machine learning technique known as
support vector machine (SVM) was applied to classify the
walking conditions. SVM was also compared with other
machine learning methods such as artificial neural network
(ANN), radial basis function network (RBF) and Bayesian
belief network (BBN). The SVM technique was shown to
have a higher performance in classification than the other
three methods. The results using SVM showed that stair
ascent and stair descent could be distinguished from each
other and from the other walking conditions with 100%
accuracy by using a single sensor unit attached to the shank
segment. For classification results in the five walking
conditions, performance improved from 78% using the
kinematic signals from the shank sensor unit to 84% by
adding signals from the foot sensor unit. The SVM tech-
nique with the portable kinematic sensor unit could
automatically recognize the walking condition for quanti-
tative analysis of the activity pattern.
Keywords Classification Gait analysis Kinematic
Machine learning Sensors
1 Introduction
In the past two decades, most kinematic and kinetic
studies have been conducted in indoor motion analysis
laboratories using sophisticated equipment. As inertial
sensor technology developed, outdoor monitoring of daily
activities can nowadays be achieved with the use of
sensor systems that combine small size with low energy
expenditure. Many studies have described the use of
miniature accelerometers and gyroscopes in the study of
body motion [11, 18, 19] and especially gait analysis [23,
26, 30]. Understanding biomechanics in relation to human
activities [7, 13], sports medicine [15] and human phys-
iology [28] has also become mainstream for clinical
research studies in the analysis of activities of daily living
after interventions.
As such sensor systems can continuously collect kine-
matic data of body movement, researchers have been able
to identify specific movement patterns such as sit-to-stand,
lying down, running, walking, and their particular instances
[22]. Subsequently, analyses of segmental movement have
H.-Y. Lau K.-Y. Tong (&)
Department of Health Technology and Informatics,
The Hong Kong Polytechnic University,
Hong Kong SAR, China
e-mail: k.y.tong@polyu.edu.hk
H.-Y. Lau
e-mail: ajaxlau@yahoo.com.hk
H. Zhu
Research Institute of Innovative Products and Technologies,
The Hong Kong Polytechnic University,
Hong Kong SAR, China
e-mail: rihlzhu@inet.polyu.edu.hk
123
Med Biol Eng Comput (2008) 46:563–573
DOI 10.1007/s11517-008-0327-x
been applied to clinical practices of functional restoration
in rehabilitation [27, 31]. However, although the sensor
systems could reliably measure body movement, identifi-
cation of specific movement patterns and their incidences
could not be achieved without the use of advanced algo-
rithms to improve the accuracy of classification. Therefore,
a range of artificial intelligence, such as machine learning,
fuzzy logic and neural networks, have been investigated by
various studies for the detection of specific movement
features [1, 2, 4, 5, 14, 24, 33].
Classification algorithms have been employed in the
measurement of movement behavior, walking environ-
ment and other daily physical activities. Najafi et al.
studied the sit-to-stand transition in relation to the fall risk
in the elderly by using a gyroscope and wavelet trans-
formation [22]. Williamson et al. used inductive learning
method to generate higher accuracy for real-time gait
event detection compared with using adaptive logical
network and machine learning [33]. Begg et al. studied
gait differences by measuring the minimum foot clearance
owing to ageing using the technique of support vector
machine (SVM) [2]. In studying outdoor activities, Herren
et al. used a tri-axial accelerometer with neural networks
to determine the speed and incline of running movements
[15]. All of these studies are early examples of the
application of miniature sensors and artificial intelligence
to studying human motion.
Stair ascent and stair descent as well as walking up a
slope and walking down a slope are normal daily walking
events in addition to walking on level ground. The gait
characteristics are quite different in each particular
walking condition in terms of energy expenditure [29] and
the physiological capacity required of walkers [34]. The
understanding of these walking conditions could be
advanced as a tool for the evaluation of functional per-
formance after clinical interventions, such as surgical or
rehabilitative treatment on the lower limbs. Analysis of
the conditions could also facilitate the outcome mea-
surement of the design of assistive aids and analysis of
fall risk in the elderly. Walking conditions classification
could provide further information for gait analysis of
various activities of daily living and could be used as
reference data for biomechanical analysis. In this current
study, miniature accelerometers and gyroscopes were
attached to the shank and foot segments on the same
lower limb to capture the kinematic parameters for five
different walking conditions: level ground walking, ups-
lope, downslope, stair ascent, and stair descent. The SVM
method was used to classify these walking conditions and
compared with other artificial intelligence algorithms,
such as artificial neural network (ANN), radial basis
function (RBF) neural network, and Bayesian belief net-
work (BBN).
2 Methodology
2.1 Equipment
Two identical sensor units were designed to measure
kinematic data on the shank and foot segments during
walking. Each sensor unit comprised one dual-axis accel-
erometer (ADXL202E, Analog Devices, Inc., U.S.A.) and
one single-axis gyroscope (ENC-03J, Murata, Japan). The
dimensions of each sensor unit were 2 9 1 9 1 cm. Each
accelerometer measured both the linear acceleration of the
limb it was attached to and an acceleration component due
to gravity. The gyroscope measured the angular velocity
through the Coriolis force. The rate of increase of the
tangential speed which caused by the radial velocity, is the
Coriolis acceleration; and the mass in the gyroscope
experiences this corresponding reaction force is called
Coriolis force. The accelerometer was arranged within each
sensor unit so that it measured the anterior–posterior (AP)
movement of the limb segments. The gyroscope was ori-
ented to measure the angular velocity of the shank and foot
segments with the measurement axis perpendicular to the
sagittal plane. The orientation of the measuring directions
of a sensor unit is illustrated in Fig. 1a. The sensor signals
were captured by a 12-bit analog-to-digital card at a sam-
pling rate of 240 Hz via a Vicon 370 data station.
2.2 Attachment locations
The sensor units were attached at two locations on the
lower limb. One sensor unit was attached at the tibial
tuberosity of the shank. The second sensor unit was
attached at the back of the heel on the shoe. The attachment
locations of the sensor units are shown in Fig. 1b. Both
sensor units were aligned so that the anterior direction of
the accelerometer was the same as the walking direction for
measurements.
2.3 Subjects, walking conditions and gait patterns
Three non-impaired healthy subjects were recruited for the
walking trials to verify the SVM performance. All of the
subjects had no musculoskeletal impairment or injury that
affected their gait. The experimental procedures were
explained to the subjects individually, and each gave his or
her signed written consent before the trials commenced.
The experimental procedures had received prior approval
from the Human Subjects Ethics Sub-Committee of The
Hong Kong Polytechnic University. The subjects were
required to walk under the five different walking condi-
tions. Each subject was given a 5-min practice session to
walk at his or her own pace in order to familiarize himself
or herself with the walking conditions and pathway. Each
564 Med Biol Eng Comput (2008) 46:563–573
123
subject was then required to walk five successful trials,
with a 1-min rest break in between. Each trial excluded the
first two gait cycles for acceleration and the last two cycles
for deceleration. This gave a total of 10 complete gait
cycles of each walking condition by each subject for
analysis. The subjects’ characteristics and walking speeds
are presented in Table 1.
Our study was carried out on the basis that segmental
orientation and kinematics were found to be different in the
five walking conditions from subjects without impairment.
The walking conditions are level ground walking, stair
ascent, stair descent, upslope walking and downslope
walking. The kinematic deviation can be measured as the
walking condition changes from one to another during a
typical walk. However, continual change of kinematic
information is difficult to quantify by analyzing the whole
pattern of a complete gait cycle. It is better to specifically
identify a critical change at a known instance within a gait
cycle, which could show the deviation in different walking
conditions.
Figure 2 shows the segment orientation of three walking
conditions (level ground walking, stair ascent and stair
descent) in the pre-swing phase, which normally occurs
within 50–60% of the gait cycle from the initial contact of
the foot. The pre-swing phase was selected as the particular
gait event because it is the transitional phase between the
stance and swing phases, and the segment orientation and
motion in the preparation to enter the swing phase would
be affected by different walking conditions. The pre-swing
phase could be identified by monitoring the angular
velocity on the shank segment. Based on the study on gait
analysis using kinematic sensors and force sensitive resis-
tors by Lau et al. the pre-swing phase could be identified by
monitoring the angular velocity on the shank segment and
locating the minimum turning point of the angular velocity
within each gait cycle [17].
In the pre-swing phase, the knee performs a different
range of flexion from that during other phases. The shank
and foot segments have different orientations that are
dependent on the specific walking condition and phase.
During stair ascent, the shank segment moves forward
continuously with little or no knee flexion, which slows
down or reverses the acceleration in the forward direction
(Fig. 2b). This is different from the level ground walking
condition in which the shank tilts forward increasingly
in the pre-swing phase in order for the lower leg to get
Shank sensor unit
Foot sensor unit
Walking Direction
Anterior-Posterior
(+) Angular Velocity
Accelerometer
Gyroscope
Anterior-Posterior
(+) Acceleration
(a) (b)
Suspension sleeve for
velcroattachment
Velcro attached on the
sleeve
Cable and wire fixed at
the waist and connected
to the datastation
Foot sensor unit secured
using adhesive velcrotape
Fig. 1 a The structure and
measuring directions of a sensor
unit. b The attachment locations
of sensor units on the dominant
side of the subject
Table 1 Subjects’ characteristics and walking speeds
Subject Age Sex Dominant
side
Level ground
walking (m/s)
Upslope treadmill
walking
Downslope treadmill
walking
Stair ascent
(step/s)
Stair descent
(step/s)
1 25 Male Right 1.42 1.2 1.4 1.5 1.5
2 26 Male Right 1.40 1.2 1.4 1.4 1.5
3 25 Male Right 1.47 1.3 1.4 1.6 1.6
Med Biol Eng Comput (2008) 46:563–573 565
123
prepared for the push-off (Fig. 2a). Therefore, the accel-
eration measured on the shank is lower when compared
with the signals during stair ascent. During stair descent,
knee flexion is larger in the pre-swing phase in order to
position the contra lateral side for the lower step. Hence,
the measuring direction of the accelerometer is tilted
downward and so the accelerometer measures a larger
value when compared with measuring during level ground
walking or stair ascent. This larger amplitude of accelera-
tion is due to the gravitational force that comes with the
tilted shank segment (Fig. 2c).
Based on the aforementioned gait pattern characteristics,
we used the pre-swing phase signals for classification of
the five walking conditions. The detailed description of
each walking condition is shown in Table 2.
2.4 Data processing and feature extraction
The data were processed offline by a second-order But-
terworth low-pass filter with a 10-Hz cut-off frequency.
The signals were calculated in the unit of gravity (g) for
acceleration and degree per second (deg/s) for angular
velocity. Each sensor unit measured AP acceleration and
AP angular velocity of the shank and foot segments. The
minimum turning point obtained from the shank angular
velocity was labeled as Sh(AV
ps
) for identifying the time
point for the pre-swing phase (Fig. 3a), and the amplitude
values of the AP acceleration (Acc
ps
) of the shank (Fig. 3b)
and the foot (Fig. 3c) at this time point during the pre-
swing phase were labeled as Sh(Acc
ps
) and Ft(Acc
ps
),
respectively. Moreover, the orientation and motion of the
lower limb segments during the swing phase are affected
by the walking conditions. The amplitude of the peak
values from the accelerometers during the swing phase
were also extracted for analysis and labeled as Sh(Acc
peak
)
and Ft(Acc
peak
), respectively.
2.5 The SVM classification
Automatic classification of walking condition is a chal-
lenging work, which requires using a classifier to map the
features of the acquired signals to the gait patterns and
segment motions. Design and implementation of various
types of classifiers, ranging from linear methods (Linear
Discriminant Analysis or LDA) to nonlinear methods
(ANN or SVM, etc.), has been addressed in machine
learning theories [6, 12, 20, 21], whereas selection of
classifier for a given problem is an empirical and exper-
imental work. Comparisons of different types of classifier
have been well studied. It is commonly agreed that linear
classifier is more straightforward but poor flexibility, and
its performance mainly depends on the nature of the
problem and the construction of feature space. Nonlinear
classifier is relatively adjustable, and therefore it is eli-
gible for a broader range of problems. The difficulty in
using nonlinear method, such as ANN, lies in the deter-
mination of their capacity. Improper design may also
cause either under fitting or over fitting problems. On the
contrary, SVM is a new type of learning machine that can
automatically adjust its capacity according to the scale of
a specific problem by maximizing the width of the clas-
sification margin [3, 9, 32]. One of the benefits is its
ability to explore more information from the given data
by using a nonlinear function to map the original features
into a high-dimensional space as shown in the following
description.
Let the training set D be {(x
i
, y
i
)}
i = 1
l
, with each input x
i
[ <
m
and the output label y
i
[{±1}. With the nonlinear
function /, input vector x is mapped to /(x). The optimal
Negative value
in the Angular
velocity (-ve AV)
(a)
(b)
(c)
-ve AV
-ve AV
Fig. 2 The shank segment orientation and motion in pre-swing.
a Level ground walking: the shank segment is under deceleration.
b Stair ascent: shank segment moves forward with little or no knee
flexion. c Stair descent: since the shank segment is pointing
downward, the gravitational force has a significant contribution in
the measured acceleration
Table 2 Description of the five walking conditions
Walking condition Description
Level ground walking The subjects walked along a 10-m
straight path inside the gait
laboratory
Upslope treadmill walking The subjects walked on a +15°
inclination on the treadmill
Downslope treadmill walking The subjects walked on a -15°
inclination on the treadmill
Stair ascent The subjects climbed up a staircase of
six steps. Each step had a height of
15 cm and a breadth of 20 cm
Stair descent The subjects descended the same
staircase as for stair ascent
566 Med Biol Eng Comput (2008) 46:563–573
123
classifier is obtained by solving a quadratic optimization
problem:
WðaÞ¼
X
l
i¼1
a
i
1
2
X
l
i;j¼1
a
i
a
j
y
i
y
j
/ðx
i
Þ/ðx
j
Þ
with 0 a
i
C; i ¼ 1; ...; l;
ð1Þ
in which C is the regularization parameter that controls the
trade-off between model complexity and empirical risk.
According the Kuhn–Tucker theorem, samples that have
a
i
[ 0 must lie along the margins of the decision boundary,
which are called support vectors, To avoid computation
of the inner product h/(x
i
), /(x
j
)i in a high-dimensional
space, only those functions that can satisfy Mercer’s
condition, K(x
i
, x
j
) = h/(x
i
), /(x
j
)i, is considered to be the
kernel. With the derived support vectors, the decision
function for a new sample x is expressed as
f ðxÞ¼sgn
X
support vectors
y
i
a
i
K x
i
xðÞ
!
ð2Þ
Typical kernel functions include linear, polynomial and
RBF. Although no analytical study exists about the optimal
choice of kernel function, RBF is widely used as the kernel
function in gait classification studies [1]:
K x
i
; x
j
¼ exp
x
i
x
j
2
2r
2
!
ð3Þ
where r controls the width of the RBF kernel. Considering
the optimal selection of kernel function, Kamruzzaman
et al. compared different kernel functions for the diagnosis
of cerebral palsy gait and reported that RBF and polyno-
mial kernel function obtained more than 96% overall
accuracy [16]. Begg et al. reported comparable results in
gait classification of young and elderly people [2]. In this
study, a RBF-kernel SVM is used to modeling the walking
conditions based on the signal of kinematic sensors
attached to the shank and the foot.
During the implementation of a RBF-based SVM, two
parameters, the width of RBF kernel (r) and the regulari-
zation parameter (C) are needed to be determined. In our
experiment, these two parameters are optimized by grid-
search and cross-validation procedures. The parameters are
firstly digitized through a number of grids, and for each
grid, the performance of the SVM classifier is evaluated by
the leave-one-out-cross-validation (LOOCV). The optimal
values can be found by exhaustively searching in all of the
parametric grids.
To implement the SVM in walking conditions detection,
a demonstration of a 2-class problem to classify stair des-
cent (labeled by +1) and the other walking conditions
(labeled by -1) with the input features of Sh(AV
ps
) and
Sh(Acc
peak
). The total dataset was divided into two inde-
pendent datasets: a training set of 86 samples, and a testing
set of 85 samples. The SVM algorithm is implemented in
Fig. 3 Graphical illustration of
the gait parameters for walking
condition classification. a Shank
AP angular velocity: Sh(AV
ps
)
is defined by the amplitude of
the minimum turning point of
shank AP angular velocity
detected in pre-swing. b Shank
AP Acceleration: Sh(Acc
ps
)is
defined by the amplitude of the
shank or foot AP acceleration at
the instance defined by
Sh(AV
ps
). Acc
peak
is defined by
the amplitude of the peak
following Acc
ps
. c Foot AP
acceleration: for level walking,
Acc
ps
and Acc
peak
coincided at
the same instance and Acc
peak
appeared before Acc
ps
for stair
ascent in measuring foot AP
acceleration. Acc acceleration,
AV angular velocity, Amp
amplitude
Med Biol Eng Comput (2008) 46:563–573 567
123
Matlab. The training result is shown in Fig. 4a when r = 6
and C = 100, in which stair descent and other walking
conditions are represented by 9 and D, respectively. The
samples marked with circles are the support vectors (a total
of 13, comprising six from stair descent and seven from the
other conditions), which obviously lie along the boundary.
The whole space was separated into three areas, with the
middle one for stair descent and the other two areas for the
other conditions. One sample of stair descent was mis-
classified to other conditions. Thus, in this case, the
training accuracy was 98.8%. The test result of the SVM
classifier is shown in Fig. 4b, in which five samples were
misclassified (one from stair descent, and four from the
other conditions) and the testing accuracy was 94.1%.
Moreover, we also demonstrated the SVM classification
between stair ascent (labeled by +1) and the other condi-
tions (labeled by -1). Again, the input features are
Sh(AV
ps
) and Sh(Acc
peak
), and the dataset was divided to
training set (86 samples) and test set (85 samples). The
training and testing results are shown in Fig. 5a and b when
r = 3.5 and C = 200, where the stair ascent and the other
conditions are represented by 9 and D, respectively. In
Fig. 5a, there are 17 support vectors (eight from stair
descent and nine from the other conditions). Figure 5b
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
1
2
3
4
5
6
stair descent
other conditions
support vectors
Sh(Acc
peak
) Shank peak acceleration (g)Sh(Acc
peak
) Shank peak acceleration (g)
Sh(Acc
ps
) Shank acceleration in pre-swing phase (g)
x Stair descent
Level & sloped walking
Support vectors
(a)
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
1
2
3
4
5
6
s tair desc ent
o ther con ditio ns
Sh(Acc
ps
) Shank acceleration in pre-swing phase (g)
x Stair descent
Level & sloped walking
(b)
Fig. 4 SVM classification for stair descent (X) and other conditions
(q) with input features of shank (Acc
ps
, Acc
peak
). The solid lines
represent the classifier, and the samples marked with circles are
support vectors. a SVM training. One sample of stair descent is
misclassified. The training error is 1.2%. b SVM testing. One sample
of stair descent and four samples of other conditions are misclassified.
The testing accuracy is 94.1%
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
1
2
3
4
5
6
s tair asc e nt
o ther con ditio ns
support vectors
Sh(Acc
peak
) Shank peak acceleration (g)Sh(Acc
peak
) Shank peak acceleration (g)
Sh(Acc
ps
) Shank acceleration in pre-swing phase (g)
Sh(Acc
ps
) Shank acceleration in pre-swing phase (g)
x Stair ascent
Level & sloped walking
Support vectors
(a)
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
1
2
3
4
5
6
stair ascent
other conditions
x Stair ascent
Level & sloped walking
(b)
Fig. 5 SVM classification for stair ascent (X) and other conditions
(q) with input features of shank (Acc
ps
, Acc
peak
). The solid lines
represent the classifier, and the samples marked with circles are
support vectors. a SVM training. Six samples of other conditions are
misclassified. The training error is 7%. b SVM testing. Five samples
of other conditions are misclassified. The testing accuracy is 94.1%
568 Med Biol Eng Comput (2008) 46:563–573
123
shows that five samples (among 85) were misclassified,
thus making the testing accuracy to be 94.1%.
2.5.1 Comparison experiments
To further test the capability of SVM in walking con-
dition detection, two comparison experiments were
performed. Some well-known machine learning tech-
niques were applied to the dataset, including ANN, RBF
neural network and BBN. All of these methods were
implemented and optimized by Weka toolbox
1
. Again,
LOOCV was employed to evaluate performance of the
classifiers.
In the first experiment, three features from shank AP
acceleration signals Sh(AV
ps
), Sh(Acc
ps
) and Sh(Acc
peak
)
were utilized in various classification tasks, including two-
class (stair descent, and other conditions), 2-class (stair
ascent, and other conditions), three-class (stair descent,
stair ascent, and other conditions), and five-class (stair
ascent, stair descent, upslope, downslope, and level ground
walking). The aim of the second experiment was to
improve the classification accuracy for five-class. There-
fore, two more features from foot AP acceleration,
Ft(Acc
ps
) and Ft(Acc
peak
), were considered.
2.5.2 Strategy of classification
The data were separated into equally proportioned training
and testing datasets for building and testing the SVM
model. The amplitudes of angular velocity were rescaled
by dividing 500 in order to minimize the data range com-
parable to acceleration for analysis. The five walking
conditions were assigned to four classification tasks, as
shown in Table 3. The purpose of three-class and two-class
analysis is to distinguish stair ascent and stair descent from
the other walking conditions.
3 Results
The results revealed that the shank segment showed
acceleration in the AP direction with increased signal
amplitude of forward acceleration during the pre-swing
phase in stair ascent and stair descent. This feature was
found while the knee was flexed and the shank segment
was rotated, identified by acquiring the signal amplitude of
the acceleration with reference to the minimum turning
point of the shank AP angular velocity in the pre-swing
phase, i.e., Sh(AV
ps
) (Fig. 3). Although a similar feature
was observed for stair ascent and stair descent, these two
conditions showed a difference in signal amplitude of
shank acceleration in the pre-swing phase. In level ground,
upslope and downslope walking, the terminal stance pro-
ceeded to the initial swing from heel-off to push-off, during
which forward acceleration showed measurements of lower
values in the pre-swing, as the shank was decelerating in its
preparation for swinging forward. However, for stair ascent
and stair descent, the shank appeared to maintain forward
AP acceleration during the pre-swing phase.
Similarly, increased signal amplitude was also observed
in the measurement of foot AP acceleration in stair ascent
in the pre-swing phase (Fig. 3c). When the amplitudes of
Ft(Acc
ps
) were plotted against the amplitudes of Ft(AV-
peak
), clustering of data points could be observed. These
two input features achieved 100% accuracy in classifying
stair ascent from the other walking conditions.
The classification accuracies of different machine
learning techniques were compared and are illustrated in
Fig. 6a. It appeared that SVM always performed with the
highest accuracy for all of the classification tasks, and it
achieved 100% classification for two-class and three-class
problems. Meanwhile, the classification accuracy of SVM
was found to be monotonously increasing as the number of
classes was reduced. However, the results of ANN and
BBN for 2-class (stair descent and others) were worse than
those for three-class, which implied there were overfitting
problems. For all the methods, the detection accuracies for
two-class and three-class were higher than 90%, while
those for five-class were less than 80%, which indicated
that the selected features could adequately describe three
(or fewer) types of walking conditions but could hardly
distinguish more details.
The results are presented in Fig. 6b. Comparing them
with those in Fig. 6a, the performance of SVM for five-
class increased from 78 to 85%, whereas the performances
of the other methods obtained no more than a 3% incre-
ment. From the two experiments, we concluded that SVM
was the most effective and consistent learning machine.
For instance, SVM was able to detect up to three types of
walking conditions with 100% accuracy by only using
features from the AP acceleration sensor attached to the
Table 3 SVM classification tasks for different combinations of
walking conditions
Mode of
classification
Classification of walking conditions being
investigated
5-class All five walking conditions were classified
independently
3-class Stair ascent, stair descent, and a single class
comprising the remaining three walking
conditions were classified
2-class: stair
ascent
Stair ascent was classified from the other four
walking conditions
2-class: stair
descent
Stair descent was classified from the other four
walking conditions
Med Biol Eng Comput (2008) 46:563–573 569
123
shank. SVM also produced more benefits than the other
methods when more information was added. This, to some
extent, indicated that SVM could fully utilize the non-lin-
ear relationship among available features to maximize its
generalization ability.
Figure 7 shows the three-dimensional scatter plot of the
selected input features of Sh(AV
ps
), Sh(Acc
ps
) and
Sh(Acc
peak
) for classification of walking conditions. The
results showed that the data points from each walking
condition demonstrated various degrees of data clustering.
The data for stair ascent and stair descent were more sep-
arated from the data of the other conditions. However, the
data points for level ground walking, upslope and down-
slope walking overlapped relatively and affected the
classification performance. This pattern was found to be
consistent for the three subjects. With the plotting of the
input features in three-dimensional space, the region
occupied by the stair ascent and stair descent data could be
distinguished visually and classified from the other three
walking conditions with 100% accuracy.
Table 4 shows the overall performance of the SVM in
the classification of the different walking conditions using
different combinations of input features extracted from the
signals of shank and foot AP acceleration. The results
showed 100% classification using the input features
Sh(AV
ps
, Acc
ps
, Acc
peak
) in three classes: stair ascent, stair
descent, and the group of sloped and level walking con-
ditions. The results also implied that 100% accuracy could
be obtained for 2-class classification for both stair ascent
and stair descent from the other walking conditions using
the same input features. The results also showed that a
higher performance could be obtained by adding more
60.00
65.00
70.00
75.00
80.00
85.00
90.00
95.00
100.00
5-class 3-class 2-class 2-class
SVM
ANN
RBF
Bayes
Classification Tasks
Classification Accuracy (%)
Stair Ascent Stair Descent
5-class 3-class 2-class 2-class
Classification Tasks
Stair Ascent Stair Descent
(a)
60.00
65.00
70.00
75.00
80.00
85.00
90.00
95.00
100.00
SVM
ANN
RBF
Bayes
Classification Accuracy (%)
(b)
Fig. 6 Classification of walking conditions with various methods
(support vector machines(SVM), artificial neural network (ANN),
radial basis function (RBF) neural network, and Bayesian belief
network (Bayes)). a Classification results with input features of shank
(AV
ps
, Acc
ps
, Acc
peak
). b Classification results with input features of
shank (AV
ps
, Acc
ps
, Acc
peak
) and foot (Acc
ps
, Acc
peak
)
Fig. 7 Three-dimensional
scatter plot for the 3-class
classification. The graph shows
the data Sh(AV
ps
, Acc
ps
,
Acc
peak
) clustering for the
walking conditions stair ascent
and stair descent. The graph is
oriented so that each clustering
can be seen with a clear
boundary
570 Med Biol Eng Comput (2008) 46:563–573
123
input features to build up the training model. For five-class
classification, performance improved from 78.82% using
the input features Sh(AV
ps
, Acc
ps
, Acc
peak
) to 84.71% by
adding another two input features Ft(Acc
ps
, Acc
peak
).
Moreover, stair ascent was also discriminated with 100%
accuracy using input features Ft(Acc
ps
, Acc
peak
) from other
conditions without the use of any signals from the shank
segment. However, the ability of only using these foot
features for classifying stair descent was low at 85.88%.
4 Discussion
In our study, it was found that the walking features in the
pre-swing phase could discriminate stair ascent/descent
from the level and sloped walking conditions. The results
showed that the differences in segmental movement in pre-
swing were able to be classified using SVM based on the
same training model built from normal gait pattern data.
In level and sloped walking, as the knee flexed and the
shank rotated during pre-swing, the shank segment expe-
rienced maximum deceleration relative to the body forward
progression. Therefore, the AP acceleration measured was
the lowest and negative. In contrast, knee flexion might not
have been noticeable in pre-swing during stair ascent. The
knee was maintained as neutral or fully extended to achieve
maximum height for the contralateral side to position for
the higher step. This resulted in higher amplitude mea-
surements in AP acceleration. In stair descent, increased
knee flexion was present in pre-swing, which further
increased the AP acceleration via the contribution of
gravity as the direction of measurement of the acceler-
ometer gradually changed to be more downward.
Therefore, the amplitude for level ground walking was
the lowest when compared with stair ascent and stair des-
cent. The slight difference in segment orientation and
signal amplitude provided important information for the
classification of stair ascent and stair descent from the other
walking conditions.
Previous studies have described the use of kinetic and
kinematic data to predict walking conditions. Riener et al.
studied the kinetic and kinematic data for stair ascent and
stair descent of different inclinations and level ground
walking [25]. They found that joint power made a signifi-
cant difference owing to the different intensities of muscle
power for stair ascent and stair descent. However, these
features could be confused with other activities requiring
the same level of muscular effort. Their results might not
be directly applicable for identifying different conditions in
activity monitoring. Coley et al. have successfully identi-
fied stair ascent from stair descent and level ground
walking by using wavelet transformation [8]. However,
their study recognized stair ascent only. In the current
study, the data points collected could be classified accu-
rately between stair ascent, stair descent, and level and
sloped walking conditions using SVM. In Fig. 7, the data
clusters for stair ascent and stair descent can be seen in the
three-dimensional space. The accuracy for 3-class classi-
fication was higher than for five-class. In Fig. 7, the data
clusters for the three walking conditions of level ground
walking, upslope and down slope were distinguished in
three-dimensional space. It can be shown that SVM has the
ability to generate a well-defined support vector boundary.
Increasing the dimensions from three input features to five
input features could further improve the performance of the
classification tasks (Table 4).
Our results also showed that a single sensor unit on the
shank segment, which comprised an accelerometer and a
gyroscope, could accurately predict the walking conditions
of stair ascent, stair descent and general walking. Similarly,
a single sensor unit on the foot segment could also accu-
rately classify stair ascent from the other walking
conditions. These findings could be applied to the moni-
toring of daily, walking and other physical activities.
Table 4 The classification accuracy of SVM analysis using different combinations of selected input features
Input Features 5-class (%) 3-class (%) 2-class (stair ascent) (%) 2-class (stair descent) (%)
Sh(AV
ps
, Acc
ps
) 63.53 87.06 87.06 89.41
Sh(AV
ps
, Acc
ps
, Acc
peak
) 78.82 100.00 100.00 100.00
Sh(Acc
ps,
Acc
peak
) 69.41 94.12 94.12 94.12
Sh(AV
ps
), Ft(Acc
ps
) 67.06 89.41 95.29 92.94
Sh(AV
ps
), Ft(Acc
ps
, Acc
peak
) 74.12 95.29 96.47 91.76
Ft(Acc
ps
, Acc
peak
) 60.00 88.24 100.00 85.88
Sh(Acc
ps
), Ft(Acc
ps
) 61.18 94.12 95.29 94.12
Sh(AV
ps
, Acc
ps
), Ft(Acc
ps
) 71.76 92.94 92.94 92.94
Sh(AV
ps
, Acc
ps,
Acc
peak
), Ft(Acc
ps
, Acc
peak
) 84.71 100.00 100.00 100.00
Sh shank, Ft foot
Med Biol Eng Comput (2008) 46:563–573 571
123
Besides other gait-assisting walking systems used in
rehabilitation [10], the method described in our study could
be applied to gait controlling devices, which would help in
restoring a normal gait pattern and providing feedback.
Our study showed the ability for classification of
walking conditions by SVM was remarkable. The study
also compared the performance of different machine
learning algorithms (Fig. 6). SVM showed higher and more
consistent results than RBF and BBN using input features
Sh(AV
ps
, Acc
ps
, Acc
peak
). The performance of SVM was
also superior to ANN in 3- and two-class classification.
Moreover, the building model for SVM was straightfor-
ward, in that more input features could be added and
different combinations of SVM parameters could be used.
In future studies, more inputs from other sensor units or
gait events could be investigated to improve accuracy, and
SVM could also be further developed for the classification
of other movement patterns or for detection of gait devia-
tion, such as a pathological gait pattern. Through the SVM
algorithm, it is also practical to develop a classifier for real-
time application provided that the classifier has been
trained and optimal values of the parameters (r and C) are
found. Since a well-defined classifier is developed, decision
making process becomes straight forward. In addition,
simple threshold detection was used to extract the kine-
matic features in our study, the computation load is
relatively lower than other machine learning methods.
Therefore, it is feasible to develop a portable real-time gait
classifier and monitoring system. The system could be
validated in outdoor environment by integrating other
walking conditions encountered in daily activities together
with the five walking conditions being studied in this study.
Acknowledgments This project was supported by the Research
Grants Council of the Hong Kong Special Administrative Region,
China (grant no. PolyU 5284/06E).
References
1. Begg R, Kamruzzaman J (2005) A machine learning approach for
automated recognition of movement patterns using basic, kinetic
and kinematic gait data. J Biomech 38(3):401–408
2. Begg RK, Palaniswami M, Owen B (2005) Support vector
machines for automated gait classification. IEEE Trans Biomed
Eng 52(5):828–838
3. Boser BE, Guyon IM, Vapnik VN (1992) A training algorithm for
optimal margin classifiers. In: 5th Annual ACM Workshop on
COLT, Pittsburgh, pp 144–152
4. Chau T (2001) A review of analytical techniques for gait data.
Part 1: Fuzzy, statistical and fractal methods. Gait Posture
13(1):49–66
5. Chau T (2001) A review of analytical techniques for gait data.
Part 2: neural network and wavelet methods. Gait Posture
13(2):102–120
6. Christopher MB (2007) Pattern recognition and machine learn-
ing. Springer, Heidelberg
7. Coleman KL, Smith DG, Boone DA, Joseph AW, del Aguila MA
(1999) Step activity monitor: long-term, continuous recording of
ambulatory function. J Rehabil Res Dev 36(1):8–18
8. Coley B, Najafi B, Paraschiv-Ionescu A, Aminian K (2005) Stair
climbing detection during daily physical activity using a minia-
ture gyroscope. Gait Posture 22(4):287–294
9. Cortes C, Vapnik V (2005) Support-vector networks. Mach Learn
20(3):273–297
10. Dai R, Stein RB, Andrews BJ, James KB, Wieler M (1996)
Application of tilt sensors in functional electrical stimulation.
IEEE Trans Rehabil Eng 4(2):63–72
11. Dejnabadi H, Jolles BM, Casanova E, Fua P, Aminian K (2006)
Estimation and visualization of sagittal kinematics of lower limbs
orientation using body-fixed sensors. IEEE Trans Biomed Eng
53(7):1385–1393
12. Ethem A (2004) Introduction to machine learning (adaptive
computation and machine learning). Mass: MIT Press,
Cambridge
13. Haeuber E, Shaughnessy M, Forrester LW, Coleman KL, Macko
RF (2004) Accelerometer monitoring of home- and community-
based ambulatory activity after stroke. Arch Phys Med Rehabil
85(12):1997–2001
14. Hansen M, Haugland MK, Sinkjaer T (2004) Evaluating robust-
ness of gait event detection based on machine learning and
natural sensors. IEEE Trans Neural Syst Rehabil Eng 12(1):81–
88
15. Herren R, Sparti A, Aminian K, Schutz Y (1999) The prediction
of speed and incline in outdoor running in humans using ac-
celerometry. Med Sci Sports Exerc 31(7):1053–1059
16. Kamruzzaman J, Begg RK (2006) Support vector machines and
other attern recognition approaches to the diagnosis of cerebral
palsy gait. IEEE Trans Biomed Eng 53(12 Pt 1):2479–2490
17. Lau H, Tong K (2008) The reliability of using accelerometer and
gyroscope for gait event identification on persons with dropped
foot. Gait Posture 27:248–257
18. Luinge HJ, Veltink PH (2005) Measuring orientation of human
body segments using miniature gyroscopes and accelerometers.
Med Bio Eng Comput 43(2):273–282
19. Mayagoitia RE, Nene AV, Veltink PH (2002) Accelerometer and
rate gyroscope measurement of kinematics: an inexpensive
alternative to optical motion analysis systems. J Biomech
35(4):537–542
20. Michalski RS, Carbonell JG, Mitchell TM (1983) Machine
learning: an artificial intelligence approach, vol I. Morgan Ka-
ufmann, Los Altos
21. Michalski RS, Kodratoff Y, Bareiss R (1990) Machine learning:
an artificial intelligence approach, vol III. Morgan Kaufmann,
San Mateo
22. Najafi B, Aminian K, Loew F, Blanc Y, Robert PA (2002)
Measurement of stand-sit and sit-stand transitions using a mini-
ature gyroscope and its application in fall risk evaluation in the
elderly. IEEE Trans Biomed Eng 49(8):843–851
23. Pappas IP, Popovic MR, Keller T, Dietz V, Morari M (2001) A
reliable gait phase detection system. IEEE Trans Neural Syst
Rehabil Eng 9(2):113–125
24. Perl J (2004) A neural network approach to movement pattern
analysis. Hum Mov Sci 23(5):605–620
25. Riener R, Rabuffetti M, Frigo C (2002) Stair ascent and descent
at different inclinations. Gait Posture 15(1):32–44
26. Sabatini AM, Martelloni C, Scapellato S, Cavallo F (2005)
Assessment of walking features from foot inertial sensing. IEEE
Trans Biomed Eng 52(3):486–494
27. Shimada Y, Ando S, Matsunaga T, Misawa A, Aizawa T, Shi-
rahata T, Itoi E (2005) Clinical application of acceleration sensor
to detect the swing phase of stroke gait in functional electrical
stimulation. Tohoku J Exp Med 207(3):197–202
572 Med Biol Eng Comput (2008) 46:563–573
123
28. Song KM, Bjornson KF, Cappello T, Coleman K (2006) Use of
the StepWatch activity monitor for characterization of normal
activity levels of children. J Pediatr Orthop 26(2):245–249
29. Terrier P, Aminian K, Schutz Y (2001) Can accelerometry
accurately predict the energy cost of uphill/downhill walking?
Ergonomics 44(1):48–62
30. Tong K, Granat MH (1999) A practical gait analysis system using
gyroscopes. Med Eng Phys 21(2):87–94
31. Tong KY, Mak AF, Ip WY (2003) Command control for func-
tional electrical stimulation hand grasp systems using miniature
accelerometers and gyroscopes. Med Biol Eng Comput
41(6):710–717
32. Vapnik V (1995) The Nature of Statistical Learning Theory.
Springer, New York
33. Williamson R, Andrews BJ (2000) Gait event detection for FES
using accelerometers and supervised machine learning. IEEE
Trans Rehabil Eng 8(3):312–319
34. Zhang K, Werner P, Sun M, Pi-Sunyer FX, Boozer CN (2003)
Measurement of human daily physical activity. Obes Res
11(1):33–40
Med Biol Eng Comput (2008) 46:563–573 573
123