Int. J. Mach. Learn. & Cyber.
DOI 10.1007/s13042-017-0666-8

ORIGINAL ARTICLE

OKRELM: online kernelized and regularized extreme learning
machine for wearable-based activity recognition
Lisha Hu1,2,3 · Yiqiang Chen1,2,3 · Jindong Wang1,2,3 · Chunyu Hu1,2,3 ·Xinlong Jiang1,2,3

Received: 30 September 2016 / Accepted: 27 March 2017
© Springer-Verlag Berlin Heidelberg 2017

Abstract Miscellaneous mini-wearable devices (Jawbone
Up, Apple Watch, Google Glass, et al.) have emerged inrecent years to recognize the user’s activities of daily living(ADLs) such as walking, running, climbing and bicycling.
To better suits a target user, a generic activity recognition(AR) model inside the wearable devices requires to adapt
itself according to the user’s personality in terms of wearing styles and so on. In this paper, an online kernelized
and regularized extreme learning machine (OKRELM) is
proposed for wearable-based activity recognition. A smallscale but important subset of every incoming data chunk
is chosen to go through the update stage during the online
sequential learning. Therefore, OKRELM is a lightweightincremental learning model with less time consumption
during the update and prediction phase, a robust and effective classifier compared with the batch learning scheme.
The performance of OKRELM is evaluated and comparedwith several related approaches on a UCI online available* Yiqiang Chenyqchen@ict.ac.cn
Lisha Hu
hulisha@ict.ac.cn
Jindong Wangwangjindong@ict.ac.cn
Chunyu Hu
huchunyu@ict.ac.cn
Xinlong Jiang
jiangxinlong@ict.ac.cn
1

Institute of Computing Technology, Chinese Academyof Sciences, Beijing, China

2

Beijing Key Laboratory of Mobile Computing and Pervasive
Device, Beijing, China

3

University of Chinese Academy of Sciences, Beijing, China

AR dataset and experimental results show the efficiency
and effectiveness of OKRELM.
Keywords Extreme learning machine · Kernel · Activity
recognition · Online learning · Wearable computing

1 Introduction
Human activity recognition (AR) techniques promote
the development of large amounts of meaningful applications such as context awareness [1, 2], energy expenditure [3], disease detection [4] and personal healthcare [5].
Moreover, with the development of wearable techniques inrecent years, diverse of sensors (accelerometer, gyroscope,et al.) are embedded into the mini-wearable devices (e.g.
smartwatch [6], wristband [7], armband [8], head-belt [9,10]). Consequently, wearable AR techniques are widely
employed to improve the users’ health conditions by collecting and analyzing their data of activities of daily living(ADLs), and then giving them feedback.
Wearable AR technologies grow extremely fast and agreat deal of work has been proposed [11, 12]. Owing to
the limited computation and storage resources of the wearable devices, a wearable AR model ought to be lightweightwith reduced computation complexity [13]. In some realapplications, real-time feedback is greatly important andnecessary. For instance, a jogger might see how many steps
he has made when he is running, then decides whether tocontinue running or not. The AR model inside a wearable
device should fulfill the recognition task in real time. To dothis, a great number of machine learning algorithms (Decision Tree [14], Support Vector Machine [15, 16], Extreme
Learning Machine [17], Dynamic Bayesian Network [18],Hidden Markov Models [19], Boosting [20], etc.) and a13Vol.:(0123456789)

Int. J. Mach. Learn. & Cyber.

couple of improved methods [21–26] have been proposed,
then employed for a large number of application fields[27–32] and specially for wearable AR.
Among them, ELM is widely used owing to its good performance and extremely fast learning speed. ELM [33–36]
is proposed as a single hidden layer feedforward neural network, in which the hidden layer doesn’t need to be tuned
and the output weight is computed by the Moore–Penrose
generalized inverse. Due to its simple implementation
and universal approximation capabilities, ELM has been
widely used in multiple areas [37]. Recently the regularized
extreme learning machine (RELM) [38–40] is proposed
as a unified framework for binary, multiclass classification and regression problems. RELM is superior to ELM
with more improved and stable generalization performance.
Besides, RELM incorporated with kernels can be beneficial
in contexts when an appropriate and explicit hidden layer
mapping function is either unknown or difficult to find out.
Recently, a new reduced extreme kernel sparse learning
methodology is proposed in [41] for tactile object recognition to deal with the dictionary learning and the classifier
learning simultaneously. Besides, authors in [41] developed
a reduced kernel dictionary learning method to tackle thelarge storage requirement problems. Therefore, kernelized
RELM (RELM with kernels) is attracting more and more
researchers’ attention.
The kernelized RELM deals with the batch learning
problem in which the training data comes all together. Generally, such a generic and static AR model may not well fit
for a specific user with distinctive personalities in terms ofwearing styles and ADLs [42]. For example, an AR model
learned based on the data from the dominant wrist (e.g.
right wrist) may not work well for a target user wearing thedevice on his/her non-dominant wrist (e.g. left wrist), or
having an opposite dominant wrist. Based on the incremental data of a target user, a generic model can adjust itself tobe a personalized model according to the online learning
mechanism.
Online learning is much relevant to the dynamic sequence
recognition since both of them deal with the dynamic andtime series signals. Besides, considering the fact that timeseries do not usually lie in the Euclidean space, conventional
applications relevant to vector spaces (e.g. sparse coding[43]) may not work well in such applications. Fortunately,
kernel trick is widely employed to address this problem. For
instance, a joint kernel sparse coding method fuses the tactile
sequences from separate fingers with a Gaussian DTW kernel [44] and a joint group kernel sparse coding method deals
with the multivariate-time-series fusing both the tactile andvisual data [45]. In the online learning scenario when training
data comes one by one or chunk by chunk, online sequential
extreme learning machine (OSELM) [46] is proposed basedon ELM, and multiple online learning models have been

13

proposed based on the kernelized RELM. For instance: OSELMK [47], FOKELM [48] and CF-FOKELM [49] havebeen proposed for time series prediction; KOS-ELM [50]is for binary classification and regression; KB-IELM [52]is for binary, multiclass classification as well as regression
problems.
Since all the training data of KB-IELM [52] have to be
saved after the training stage and used again during the prediction. It is greatly different from OSELM in that all thetraining data will be discarded once the training stage is finished. As a consequence, the memory requirement grows
incrementally along with the online learning stages, which
may not be affordable for the wearable devices. A decremental algorithm is developed for time series prediction toremove the oldest training data according to fixed memory
schemes [47–49]. TransRKELM randomly chooses a subset
of initial data to generate the initial model, and update witha subset of high confidential labeled incremental data during
the multiclass classification problem [51]. For binary classification and regression problem, KOS-ELM [50] rejects to process an incremental data if its distance to the linear span of
all the existing training data is less than a predefined threshold, and removes the least important data from the training
dataset.
In this paper, we propose an online kernelized and regularized extreme learning machine (OKRELM) for AR withmini-wearable devices. Contributions of this paper are as
follows:• OKRELM is a lightweight and robust classification modelcompared with related methods since it uses a few andimportant data from each data chunk to update the modelin the online training stage.
• OKRELM is able to deal with both the binary and multiclass classification problems.
• OKRELM shows its superiorities in dealing with wearable AR problems. We validate OKRELM on a UCI online
activity recognition dataset. Experimental results show
the efficiency and effectiveness of OKRELM in AR.
The rest of the paper is organized as follows. Section 2
gives the review of some related work. In Sect. 3, we elaborate the motivations and the OKRELM is proposed. The
performance of OKRELM is validated in Sect. 4. At last,
we conclude the paper and discuss some future extensions.

2 Related work
2.1 Regularized extreme learning machine (RELM)
Regularized extreme learning machine (RELM) is a single hidden layer feedforward neural network, which is

Int. J. Mach. Learn. & Cyber.

proposed as a unified framework for binary, multiclass classification and regression problems [38–40]. In this paper,
we only focus on the classification problems using the kernelized RELM (RELM with kernels).
thetrainingbe{( Let )} dataset
xi , ti |xi ∈ 𝐑d , ti ∈ Rm , i = 1, … , N , in which instancexi is a d-dimensional feature vector and ti is the label of xi .
Within each label vector ti = (ti1 , … , tim )T , one single element tik equals 1 representing the( instance) xi belonging toclass k, and the other elements tij , j ≠ k equal −1. m, N
represent the number of classes and instances, respectively.
The optimization problem of RELM is presented in
Eq. (1). 𝛃 is a L × m matrix to be solved. 𝝃 is a m × N
dimensional slack variable in which the ith column of 𝝃,
notated by 𝝃 :,i, is the training error of the instance xi. h(x)maps x into some higher but unknown Hibert feature space
using the kernel trick. C is the penalty parameter balancing‖ ‖the maximum generalization ability 1∕2‖𝛃2 ‖ and minimum
‖ ‖
N
∑
2
�
training error 1∕2 ��𝝃 :,i � .
i=1

N
1
C∑ 2
𝝃
min 𝛃2 +𝛃,𝝃 2
2 i=1 :,i( )s.t.𝛃T ⋅ h xi = ti − 𝝃 :,i , i = 1, … , N.

(1)

Based on the Karush–Kuhn–Tucker (KKT) Theorem, tosolve the problem in Eq. (1) is equivalent to solve its dual
problem. The objective function of its dual problem is in
Eq. (2). 𝛂 is a N × m matrix in which the ith column of 𝛂
is the Lagrange multiplier of the instance xi. we call 𝛂 the
Lagrange matrix.
N m
N
(
)
( )
1 2 C ∑ 2 ∑∑αi,j 𝛃T:,j h xi − ti,j + 𝝃 j,i .
𝝃 :,i −𝛃 +2
2 i=1i=1 j=1(2)
Let the partial derivative of D with respect to all
the variables
we have the following equations.
[ ( ) be (0, )]T
is a matrix of N rows.
𝐇 = h x1 , … , h xN

D=

N
∑
( )
𝜕D
= 𝛃:,j −𝛂i,j h xi = 0, ∀j → 𝛃 = 𝐇T 𝛂,
𝜕𝛃:,j
i=1

𝜕D
1
= C𝝃 j,i − 𝛂i,j = 0, ∀i, j → 𝝃 i = 𝛂Ti,: ,𝜕𝝃 j,iC
1
1∀i → 𝝃 = 𝛂T → 𝝃 T = 𝛂,
C
C

(3a)

(3b)

( )
( )
𝜕D
= 𝛃T:,j h xi − ti,j + 𝝃 j,i = 0, ∀i, j → 𝛃T h xi − ti + 𝝃 i = 0, ∀i,
𝜕𝛂i,j

(3c)

Equation (3a) and [(3b) are ]substituted in Eq. (3c), weT
can get Eq. (4). 𝐓 = t1 , … , tN is a N × m matrix. 𝐈N×N
represents an N × N identity matrix.
(
)−1
1
(4)
𝛂 = 𝐇𝐇T + 𝐈N×N
𝐓.
C
Equation (4) is substituted in Eq. (3a), we attain:()−1
1
𝛃 = 𝐇T 𝐇𝐇T + 𝐈N×N𝐓.
C
At last, the output function of RELM is:

(5)

(
)−1
1
(6)
f (x) = 𝛃T h(x) = T T 𝐇𝐇T + 𝐈N×N
𝐇h(x).
C
For any testing instance x, f (x) is a m × 1 vector. The
prediction of RELM on x is in Eq. (7). fk (x) is the kth element of f (x).
Prediction(x) = argmax fk (x).

(7)

k∈{1,…,m}

In Eq. (6), replace 𝐇𝐇T by the Gram matrix 𝛀(𝛀ij = k(xi , xj ), i, j = 1, … , N ) of a kernel k(u, v) and 𝐇h(x)by the kernel form, we have the output function of kernel
based RELM:

(
)−1 [
]T
1
(8)
f (x) = 𝐓T 𝛀 + 𝐈N×N
k(x1 , x), … , k(xN , x) .
C
The kernelized RELM is a batch learning model. It
can only deal with the problem that all the training data isavailable before training process begins. A generic RELM
model could be learned offline based on the data from several people. The generic model requires update to better
suit a single target user of the wearable device. Moreover,the update process needs to be done using online learningwith the training data coming one-by-one or chunk-bychunk. In the following section, we review KB-IELM, oneof the online learning model proposed based on the kernelized RELM.
2.2 Kernel based incremental extreme learning
machine (KB‑IELM)
Based on the kernelized RELM, Kernel based incremental
extreme learning machine (KB-IELM) is proposed to deal
with the problem of training data coming one-by-one or
chunk-by-chunk [52]. Two stages (which we call the initialand online stage) are contained in the online learning of
KB-IELM. Here we introduce these two stages.
• In the initial stage, supposing that the initial data
chunk (𝐗0 , 𝐓0 ) contains N0 training instances,
𝐗0 = [x1 , … , xN0 ]T , 𝐓0 = [t1 , … , tN0 ]T . The Lagrange
matrix 𝛂(0) and the output function f 0 (x) are in

13

Int. J. Mach. Learn. & Cyber.

Eqs. (9) and (10). 𝛀0 represents the N0 × N0 Grammatrix with respect to the chunk (𝐗0 , 𝐓0 ).

𝛂

(0)

(

1
= 𝛀0 + 𝐈N0 ×N0
C

)−1
𝐓0 ,

(
)T [
]T
f 0 (x) = 𝛂(0) k(x1 , x), … , k(xN0 , x) .

(9)
(10)

• In the online stage, supposing that the first dataN1[ training instances,
chunk[ (X1 , 𝐓1 ) contains]T]T
𝐗1 = xN0 +1 , … , xN0 +N1 , 𝐓1 = tN0 +1 , … , tN0 +N1 .
The Lagrange matrix 𝛂(1) becomes:

[

𝛂

(1)

A11 𝐀12=
𝐀T12 𝐀22

]−1 [

]
𝐓0
,
𝐓1

(11)

where as⎧𝐀 = 𝛀 + 1𝐈0
C N0 ×N0
⎪ 11
𝐀
=
𝛀
,
⎨ 12
01
⎪ 𝐀22 = 𝛀1 + 1 𝐈N ×N
C 1 1
⎩

(12)

𝛀1 represents the N1 × N1 Gram matrix with respect tothe chunk( (𝐗1), 𝐓1 ). (𝛀01 represents
a N0 × N1 matrix in)which
𝛀01 ij = k xi , xN0 +j , i = 1, … , N0 , j = 1, … , N1.
According to the block matrix inverse formula [53], The
Lagrange matrix 𝛂(1) is calculated by:[][ ]𝐁11 𝐁12 𝐓0
(1)
𝛂 =
,
(13)
𝐁T12 𝐁22 𝐓1

3 Online kernelized and regularized extreme
learning machine (OKRELM)
3.1 Motivation
In this section, we will think of the update process from a different perspective. 𝛂 is a N × m matrix, whose rows increasein the online stage when the training instances come continuously. In this section, we change the notations a little bit different from those in Sect. 2.2.
• In the initial stage, supposing that the initial data chunk(𝐗0 , 𝐓0 ) also contains N0 training instances. Therefore,
let the Lagrange matrix corresponding to (𝐗0 , 𝐓0 ) in thisstage be 𝛂(0), where the superscript represents the stage0
and the subscript represents the data chunk. After the initial training is finished, 𝛂(0), 𝛃0, and the output function0f 0 (x) can be computed by:

(
)−1
1
T
𝛂(0)
=
𝐇
𝐇
+
𝐈
𝐓0 ,
0
N
×N
0
0
C 0 0

(16a)

𝛃0 = 𝐇T0 𝛂(0)
,
0

(16b)

f 0 (x) = 𝛃T0 h(x) → f 0 (x)
(
)−1
1
(16c)
= 𝐓T0 𝐇0 𝐇T0 + 𝐈N0 ×N0
𝐇0 h(x).
C
Replace 𝐇0 𝐇T0 by the Gram matrix 𝛀0 and 𝐇0 h(x) by
the kernel form, we have:where as

(
)−1
1
𝛂(0)
=
𝛀
+
𝐈
𝐓0 ,
0
N
×N
0
C 0 0

(17a)

(
)−1 T −1
𝐀12 𝐀11 , (14a)𝐁11 = 𝐀−1
+ 𝐀−1
𝐀 𝐀22 − 𝐀T12 𝐀−1
𝐀
11
11 12
11 12

𝛃0 = 𝐇T0 𝛂(0)
,
0

(17b)

(
)−1
,
𝐁12 = −𝐀−1
𝐀 𝐀22 − 𝐀T12 𝐀−1
𝐀
11 12
11 12

(14b)

(
)−1
.
𝐁22 = 𝐀22 − 𝐀T12 𝐀−1
𝐀
11 12

(14c)

𝐓 . In other words, 𝐀−1
It is easy to see that 𝛂(0) = 𝐀−1
11 0
11is already computed in the initial stage. To compute 𝛂(1), we only need to invert a matrix of N1 × N1 in Eq. (14c).
Meanwhile, the output function f 1 (x) is:()T [ ()()]Tf 1 (x) = 𝛂(1) k x1 , x , … , k xN0 +N1 , x .
(15)()
After that, if another new data chunk 𝐗n , 𝐓n comes,
repeat steps (13)–(15) to update the output function
f n (x).

13()−1 [ ()()]T1
f 0 (x) = 𝐓T0 𝛀0 + 𝐈N0 ×N0
k x 1 , x , … , k x N0 , x .
C(17c)• In the online stage, supposing that the first coming data
chunk (𝐗1 , 𝐓1 ) also contains N1 training
instances.
At this[]T, in which, 𝛂(1)
time, the Lagrange matrix 𝛂(1) = 𝛂(1)01and 𝛂(1)correspond to (𝐗0 , 𝐓0 ) and (𝐗1 , 𝐓1 ), respec𝛂(1)10tively. According to Eq. (4) we have:

([

𝐇0
𝐇1

][

𝐇0
𝐇1

]T

1
+ 𝐈(N0 +N1 )×(N0 +N1 )
C

)[

𝛂(1)
0
𝛂(1)
1

]

[

]
𝐓0
=
.
𝐓1

(18)
Equation (18) is equivalent to the following two equations:Int. J. Mach. Learn. & Cyber.

(

𝐇0 𝐇0 T +)1
𝐈N0 ×N0 α(1)+ 𝐇0 𝐇1 T α(1)= 𝐓0 ,
0
1
C

(
)
1
T
𝐇1 𝐇0 T 𝛂(1)
+
𝐇
𝐇
+
𝐈
𝛂(1) = 𝐓1 ,
1
1
N
×N
0
C 1 1 1can be represented by 𝛂(1)in a manner of:
𝛂(1)
1
0

(19a)
(19b)

(
)−1
1
(0)
T
(20)
𝛂(1)
=
𝛂
−
𝐇
𝐇
+
𝐈
𝐇0 𝐇1 T 𝛂(1)
.
0 0
0
0
1
C N0 ×N0
Equation (20) is substituted in Eq. (19b), we can solve𝛂(1)in a way of:
1
(
)−1 (
)
𝛂(1)
= C IN1 ×N1 + 𝐇1 𝛄0 𝐇1 T
𝐓1 − 𝐇1 𝛃0 ,1𝛄n is defined by:

(21)

(26)
In fact, 𝛄n cannot be saved owing to the implicit mapping while using kernels. Therefore, we define a new function gn (x, y) which can be saved during the online stage:(27)
Therefore, the new output function f 1 (x) canbe( updated) [based( on) the old( one)]Tf 0 (x) by Eq. (28).
g1 𝐗1 , x = g1 x1 , x , … , g1 xN1 , x .

gn (x, y) = h(x)T 𝛄n h(y).

(( ))T ()
f 1 (x) = f 0 (x) + 𝐓1 − f 0 𝐗1 g1 𝐗1 , x .

(22)

𝛄0 is equal to Eq. (23) according to the Sherman–Morrison–Woodbury (SMW) formula [54].

To summarize,n = 1, 2, …
(29)

�
�
� ��T �⎧⎪ f n−1�(x) + 𝐓n − f n−1 �𝐗n gn 𝐗n , x , n = 1, 2, …
−1
f n (x) = ⎨ T,
1T
𝐇0 h(x), n = 0⎪ 𝐓0 𝐇0 𝐇0 + C 𝐈N0 ×N0
⎩

(30a)

�
��
�
��−1
�
�
⎧
g
(x,
y)
−
g
x,
𝐗
𝐈
+
g
𝐗
,
𝐗
g
𝐗
,
y
, n = 1, 2, …
n−1
n−1
n
N
×N
n−1
n
n
n−1
n
n
n
⎪ �
�
�−1
�
gn (x, y) = ⎨
.
1
T
T
T
T
𝐇0 h(y) , n = 0⎪ C h(x) h(y) − h(x) 𝐇0 𝐇0 𝐇0 + C 𝐈N0 ×N0
⎩
)−1
(
1
𝛄0 = 𝐇0 T 𝐇0 + 𝐈L×L
C
(
(
)−1 )
1
T
T
= C 𝐈L×L − 𝐇0 𝐇0 𝐇0 + 𝐈N0 ×N0
𝐇0 .
C

(28)

Generally, f n (x) is updated by f n−1 (x) according to:(( ))T ()
f n (x) = f n−1 (x) + 𝐓n − f n−1 𝐗n gn 𝐗n , x ,−1⎞⎧ ⎛⎡ 𝐇 ⎤T ⎡ 𝐇 ⎤⎟⎪ ⎜⎢ 0 ⎥ ⎢ 0 ⎥ 1⎪ ⎜⎢ ⋮ ⎥ ⎢ ⋮ ⎥ + C 𝐈L×L ⎟ , n = 1, 2, …
,
𝛄n = ⎨ ⎜⎣ 𝐇 ⎦ ⎣ 𝐇 ⎦
⎟
n
n
⎠
⎪ ⎝�
�−1
⎪
1
T
,n = 0⎩ 𝐇0 𝐇0 + C 𝐈L×L()T
f 1 (x) = f 0 (x) + 𝐓1 − f 0 (𝐗1 ) 𝐇1 𝛄1 h(x).

(30b)

Replace the Equations (30a) and (30b) by the kernel
form, we have:(23)

According to Eq. (3a), 𝛃1 can be represented by:��� ��T �⎧(x) + 𝐓n − f n−1 𝐗n gn 𝐗n , x , n = 1, 2, …
⎪ f n−1�−1 � �f n (x) = ⎨ T �
,
�
�
��T
1
k x 1 , x , … , k x N0 , x , n = 0⎪ 𝐓0 𝛀0 + C 𝐈N0 ×N0
⎩

(31a)

�
��
�
��−1
�
�
⎧
gn−1 𝐗n , y , n = 1, 2, …
⎪ � gn−1 (x, y) − gn−1 x, 𝐗n 𝐈Nn ×N�n + gn−1 𝐗n , 𝐗�n�−1 � �
�
�
��T
� �
�
�
��
.
gn (x, y) = ⎨1C,n = 0
𝐈
k
x
,
y
,
…
,
k
x
,
y
k(x,
y)
−
k
x,
x
,
…
,
k
x,
x
𝛀
+
1
N0
1
N0
0
⎪
C N0 ×N0
⎩
[
𝛃1 =

𝐇0
𝐇1

]T [

]
𝛂(1)
0
= 𝐇0 T α(1)+ 𝐇1 T 𝛂(1)
.
0
1
𝛂(1)
1

(24)

Equations (20)–(21) are substituted into Eq. (24). By
making use of the SMW Formula again, 𝛃1 can also be represented by:()
𝛃1 = 𝛃0 + 𝛄1 𝐇1 T 𝐓1 − 𝐇1 𝛃0 .

(25)

(31b)

( )
If f n−1 𝐗n = 𝐓n, f n (x) equals to f n−1 (x) according to
Eq. (31a). Therefore, there is absolutely( ) no need to update
the output function. What if f n−1 𝐗n ≠ 𝐓n but all 𝐗n (or amajority of them) can be correctly predicted using f n−1 (x)?
It seems we do not need to update the output function all
the time. In the following section, we propose when to
update and how to select a subset of the new data chunk to
update.

According to Eq. (6), we can get f 1 (x) by:

13

Int. J. Mach. Learn. & Cyber.

into a subset for update by comparing the predictions withthe ground truth (Eq. 36). In the end, we update the output
function with those misclassified instances in the subset(Eq. 38). When another data chunk comes, repeat the steps
in the online stage to update the output function.
Both the approaches in [41, 51] and OKRELM tackle
the expensive storage requirement in the training phase andexpensive time consumption in the testing process whenexperienced with the kernels. Their differences are listed
as follows: (a) The approach in [41] is a batch learningmodel, whereas the approach in [51] and the OKRELM in
this paper are especially proposed for incremental learning.
(b) Authors in [41] selected a subset of training samples as
prototypes by solving an optimization problem to decrease
the large storage requirement; about 10% initial data are
randomly selected to generate the initial model, and thedata with high confidence levels are chosen from the data
streams to update the model in [51]. For OKRELM, we
use all the available data to initialize, and choose only the
misclassified samples from each incremental data chunk to
update the model in the online stage.

4 Performance evaluation
Fig. 1  Main pipeline of OKRELM

3.2 The proposed OKRELM
Considering the large amounts of computation during theonline stage and the high possibility of redundant datacontained in the new data chunk. We propose the Online
Kernelized and Regularized Extreme Learning Machine(OKRELM). The main contribution of OKRELM is themodel updating. When new data chunk comes, we firstly
predict their labels using the current model. If some ofthem are misclassified, we will update the output function
based on only the misclassified ones. Figure 1 illustrates themain pipeline of OKRELM. The algorithm of OKRELM isshown in Table 1.
It consists of the initial and online stages during thetraining process of OKRELM, which is similar to the other
online learning methods. During the initial stage, a Grammatrix is firstly computed according to the initial data chunkwith N0 instances, then we attain the output function by
inverting a matrix of N0 × N0 (Eqs. 32–33).The Gram matrix
is updated first every time new data come in the online
stage. Then we predict the labels of instances in the newdata chunk using the current output function (Eqs. 34–35).
After that, all the misclassified instances can be gathered13

4.1 Data description and preprocess
We employ the Daily and Sports Activities Data Set(DSADS) [55] from UCI Machine Learning Repository tovalidate the performance of OKRELM. This dataset contains
19 daily and sports activities [(1) sitting,(2) standing, (3)lying on back, (4) lying on right side, (5) ascending stairs, (6)descending stairs, (7) standing in an elevator still, (8) moving around in an elevator, (9) walking in a parking lot, (10)walking on a treadmill with a speed of 4 kmh, (11) walking
in flat and 15° inclined positions, (12) running on a treadmill with a speed of 8 kmh, (13) exercising on a stepper, (14)exercising on a cross trainer, (15) cycling on an exercise bikein horizontal positions, (16) cycling on an exercise bike invertical positions, (17) rowing, (18) jumping, (19) playing
basketball] performed by eight participants (four males andfour females). Contributors explored the potential of recording activities on five different body parts (torso, right arm,
left arm, right leg and left leg) with three-axial accelerometer, three-axial gyroscope and three-axial magnetometeron each part respectively. Each participant performed eachactivity in his own style. That produced 45 sensor readings
per frame (3 × 5 × 3).
Features are extracted from every sensor. Firstly, we
combinethe three axes of one sensor together using√a = x2 + y2 + z2 . Then we exploit the sliding window
technique to extract features (window length = 5 s [55]).

Int. J. Mach. Learn. & Cyber.
Table 1  The OKRELM
algorithm

27 features from both time and frequency domain are
extracted (see Table 2), leading to 405 dimensions in total(27 × 3 × 5 = 405). After feature extraction, we perform
Principal Component Analysis (PCA) to reduce the dimensions to 30 [55]. Specifications of the DSADS dataset isshown in Table 3.

4.2 Parameter selection()
Gaussian kernel k(xi , xj ) = exp( − xi − xj 2 ∕g) is used
for RELM, KB-IELM and OKRELM. Therefore, we needto find the optimal value combination for two parameters(penalty parameter C and kernel parameter g). Grid search

13Int. J. Mach. Learn. & Cyber.
Table 2  Features extracted per
sensor on each body part

Table 3  Specifications of the
DSADS dataset

ID

FeatureDescription

1
2
3
4
5
6
7
8
9–13
14–18
19
20–23
24–27

Mean
STD
Minimum
Maximum
Mode
Range
Mean crossing ratedc
Spectrum peak position
Frequency
EnergyFour shape features
Four amplitude features

Average value of samples in window
Standard deviation
Minimum
Maximum
The value with the largest frequency
Maximum minus minimum
Rate of times signal crossing the mean value
Direct component
First five peaks after FFT
Frequencies corresponding to the five peaks
Square of norm
Mean, STD, skewness, kurtosis
Mean, STD, skewness, kurtosis

Name

DSADS dataset

Class number 1–19
User number 1–8
Total data size 9120

technique is employed and 50 different values {2−24, ­2−23,…, ­224, ­225} are tried for both C and g. The optimal value
combination of (C, g) is chosen from 2500 pairs.
We divide the DSADS dataset into the training and testing sets using repeated random sub-sampling (RRSS) technique [56]. That is, for all the instances of each class ofeach user, one-third is randomly selected at the testing set
and the other two-thirds are used as the training set. Therefore, the training set and testing set consist of 6080 and
3040 instances, respectively.
For each pair of (C, g), the RELM, KB-IELM and
OKRELM models are all learned. For KB-IELM, 1000
training instances are randomly selected as the initial data
chunk, a series of data chunks with random size are randomly generated in the online stage. Figure 2 shows thetesting accuracy of RELM, KB-IELM and OKRELM.
From the results in Fig. 2 we can see that, performanceof RELM varies smoothly in the parameter space. KBIELM and OKRELM are consistent with RELM in someplaces while inconsistent with RELM in the other places.
Therefore, the optimal value of (C, g) is chosen to be (­22,­24) corresponding to the highest and consistent testing
accuracy. In the following section, all experiments are runwith the optimal values for the penalty parameter C andkernel parameter g.

13

4.3 Experimental results and analysis
4.3.1 Robustness comparison with different initialand online chunk size
In order to evaluate the robustness of our proposed model,
firstly we introduce two important concepts: initial trunk
size and online trunk size. Initial trunk size refers to thenumber of training instances contained in the initial chunkwhile online trunk size means the number of training
instances contained in each online chunk. In the experiments, we train KB-IELM and OKRELM with the initial
chunk size taking values from {100, 200, 300,…, 2000}
and the online chunk size taking values from {50, 100,
150,…, 1000}. Training and testing sets are generatedusing the RRSS technique as in Sect. 4.2. The whole process is repeated five times and results are averaged andshown in Fig. 3.
From the results in Fig. 3 we can see that: Given arandom initial chunk size, the accuracies of both KBIELM and OKRELM firstly grow with the increasing
online chunk size, then converge to a high performanceand remain stable at last. If we fix the online chunk size,
the increase trend is not straightforward when the initial chunk size grows. Therefore, compared with the initial chunk size, the online chunk size has a much stronger
influence on the final performance of both classifiers. To
be more specific, KB-IELM needs an online chunk size oflarger than 700 to achieve an accuracy of about 90%, while
OKRELM only needs 250 (no matter whether misclassified
or not). What’s more, OKRELM may require less than 250
instances per chunk according to results in Sect. 4.3.3. Inother words, OKRELM is less sensitive and more robust
than KB-IELM when used to construct a generic AR
model. Once the online chunk size is satisfied, both KBIELM and OKRELM can achieve a satisfactory predictive

Int. J. Mach. Learn. & Cyber.
0.9
0.8
1

0.7

Accuracy

0.8
0.6

0.6
0.4

0.5

0.2

0.4

0
-24
-20
-16
-12
-8
-4
0

0.3

4

8
12
16
20
24

log2(C)

8 12

16 20

24

0.2
0.1

4
-4 0
-8
-12
-20-16-24
log2(g)

0

(a)

(a)
0.9
0.8

1

0.7

Accuracy

0.8
0.6

0.6
0.4

0.5

0.2

0.4

0
-24
-20
-16
-12
-8
-4
0

0.3

4

8
12
16
20
24

log2(C)

-4 0

4

8 12

16 20

24

0.2
0.1

-12-8
-20-16-24
log2(g)

0

(b)

(b)
0.9

Fig. 3  Testing accuracy of KB-IELM and OKRELM with different
initial and online chunk sizes. a KB-IELM; b OKRELM

0.8
1

0.7

Accuracy

0.8
0.6

0.6
0.4

0.5

0.2

0.4

0
-24
-20
-16
-12
-8
-4
0

0.3

4

8
12
16
20
24

log2(C)

0 4

8 12

-4
-12-8
-20-16-24
log2(g)

16 20

24

0.2
0.1
0

(c)
Fig. 2  Testing accuracy of RELM, KB-IELM and OKRELM withdifferent parameter pairs. a RELM; b KB-IELM; c OKRELM

performance comparable to the RELM no matter how
many instances are contained in the initial chunk.
4.3.2 Accuracy and time consumption comparison
with RRSS split
To compare the effectiveness and efficiency of KB-IELM
and OKRELM, we record their predictive accuracy on thetesting set as the online chunk size increases. In the meantime, we also keep tracking of their time consumption
during training and testing stages. Based on the results in
Sect. 4.3.1, the initial chunk size is set to 100 and the online
chunk size is set to 700. Training and testing sets are generated using the RRSS technique as in Sect. 4.2. The wholeprocess is repeated five times and results are averaged andshown in Fig. 4.

13

Int. J. Mach. Learn. & Cyber.
15

Train Time( s)

1
0.9
0.8

0.6

5
0

0.5

0.3
0.2
OKRELMKBIELM

0.1
0

0

1

0.2

0.4

Test Time( s)Accuracy

0.7

OKRELMKBIELM

10

0

1

2

3

4

5

6

7

8

Chunk ID

(a)

2

3

4

5

6

7

8

4

5

6

7

8

OKRELMKBIELM

0.15
0.1
0.05
0

0

1

2

3

Chunk ID(b)

Fig. 4  Accuracy, training time and testing time comparisons of KB-IELM and OKRELM with RRSS split during different phases in the online
stage. a Predictive accuracy on the testing set; b training time and testing time consumptions

The predictive performance of KB-IELM and OKRELM
is extremely low (5.25%, see Fig. 4a) at the beginningowing to the sparse initial training data (100 instances from19 classes). As the incremental data chunks coming, theaccuracy grows continuously and finally achieves a precision similar to RELM (94.53%). It verifies that the performance of online learning models KB-IELM and OKRELM
can converge to the accuracy of the batch model RELM.
The accuracy of OKRELM is a bit lower (3.97%) than thatof KB-IELM, because large amounts of training data fromthe data chunks have been eliminated for OKRELM fromupdating the model compared with KB-IELM. Those data
eliminated might not be unhelpful. However, such an elimination in OKRELM saves 46.49% training time and 74.61%
testing time compared with KB-IELM (see Fig. 4b). It
makes OKRELM a lightweight and effective AR model formini-wearable devices.
4.3.3 Accuracy and time consumption comparison
with LOO split
To view the personalization learning probability, we compare the effectiveness and efficiency of KB-IELM and
OKRELM which are trained initially based on seven users’
data while updated and validated on the 8th user’s data.
The leave one subject out (LOO) cross validation technique[56] is used to generate the training and testing datasets.
For each user’s instances, one-half is used for updating themodel (50 instances per chunk owing to the limitations
instance number of one single user), and the other half isused as the testing set and 100 instances of the other sevenusers are randomly selected as the initial training set. The
experiment is run 20 times for each user and the predictive
performances are averaged and shown in Fig. 5.

13

All in all, the trends of accuracy in Fig. 5 are nearly thesame for different users. Performances of KB-IELM and
OKRELM improve at the beginning with KB-IELM a bit
more accurate than OKRELM. During the last four chunks,
the performance of KB-IELM goes down and becomes
fluctuate while OKRELM becomes gradually convergent
and stable in the predictive accuracy. To better observe andanalyze, the results in Fig. 5 are averaged and shown in
Fig. 6a. Besides, Fig. 6b shows the averaged time consumptions in the training and testing stages.
The predictive performance of OKRELM increases
steadily along with the update process which is similar to
the results in Fig. 4a. The results of OKRELM are very
interesting since the chunk size in the online stage is only
50 (data of about 4.16 min, 50 instances × 5 s), which isless than needed (250, see the discussion in Sect. 4.3.1).
Therefore, it reveals the robust performance of OKRELM
in transforming a generic model into a personalized model.
For KB-IELM, its accuracy increases faster in the firstplace, goes down abruptly and becomes fluctuant in the end.
The reason of the superiority of KB-IELM at the beginningof the online stage has been discussed in Sect. 4.3.2. The
fluctuation phenomenon of KB-IELM again confirms ourconclusion in Sect. 4.3.1 that the performance of KB-IELM
might be unstable when the chunk size is not large. To
be more specific, KB-IELM requires about 700 instances(data of about 58.33 min, 700 instances × 5 s) each chunkto assure the update process going in a positive way (theaccuracy will increase after the update). When chunk size
is not enough (say 50 in our experiment), it is more likely
to decrease for KB-IELM. Considering the jogger example
introduced in the Introduction, KB-IELM updates every
58.33 min to attain a stable performance while OKRELM
can update every 4.16 min. Therefore, OKRELM is moreInt. J. Mach. Learn. & Cyber.
Fig. 5  The predictive accuracyof KB-IELM and OKRELM on
the datasets of different users
with LOO split

User 1

User 2User 3User 4User 5User 6

User 7User 813

Int. J. Mach. Learn. & Cyber.
1

Train Time(s)

0.06

0.9
0.8

0.6

0.02
0

0.5
12

0.4

Test Time(s)Accuracy

0.7

0.3
0.2
OKRELM

0.1
0

OKRELMKBIELM

0.04

KBIELM

0

1

2

3

4

5

6

7

8

9

10

11

0
x 10

1

2

3

4

5

6

7

8

9

10

11

4

5

6

7

8

9

10

11

-3

OKRELMKBIELM

10
8
6

0

1

2

3

Chunk ID

Chunk ID(a)(b)

Fig. 6  Average accuracy, training time and testing time comparisons of KB-IELM and OKRELM with LOO split during different phases in the
online stage. a Predictive accuracy on the testing set; b training time and testing time consumptions

suitable for real-time update. Meanwhile, the time efficiency of OKRELM during the training process (Fig. 6b)
is much more straightforward compared with the results in
Fig. 4b. Specifically, the time consumption in the training
stage of OKRELM is only 7.18% of the time consumption
in the training stage of KB-IELM. OKRELM saves 38.17%
time compared with KB-IELM during the prediction stage.
That is, OKRELM is more suitable to predict user’s ongoing activity in real-time.
To summarize, OKRELM is more stable and efficientthan KB-IELM when used to construct a personalized AR
model.

5 Conclusion
In this paper, we propose OKRELM, an online kernelized
and regularized extreme learning machine for activity recognition using mini-wearable devices. OKRELM is more
efficient than the related online learning models during boththe training and prediction processes, and effective which iscomparable to the batch mode model. Experimental results
on an online UCI activity recognition dataset show the efficiency and effectiveness of the proposed OKRELM.
When a generic classifier is updated towards a personalized model by making use of online data of the target user,
it may experience the class imbalance problem that large
amounts of data in the upcoming chunk are from a few
classes. In the future, we plan to modify the OKRELM tobetter suit the class imbalance problem in wearable activity
recognition.
Acknowledgements The authors are much grateful to Prof. Xingyu
Gao from Institute of Software Chinese Academy of Sciences for his

13

constructive comments and suggestions that have helped to improve
the quality of this paper. This work is supported by Natural Science
Foundation of China under Grant Nos. 61572471 and 61210010, Chinese Academy of Sciences Research Equipment Development Project
under Grant No. YZ201527 and Science and Technology Planning
Project of Guangdong Province under Grant No. 2015B010105001.

References
1. Chen Z, Chen Y, Hu L et al (2014) ContextSense: unobtrusive
discovery of incremental social context using dynamic Bluetoothdata[C]// International Joint Conference on Pervasive and Ubiquitous Computing: Adjunct Publication. ACM, 23–26
2. Hu L, Chen Y, Wang S et al (2013) A nonintrusive and singlepoint infrastructure-mediated sensing approach for water-use
activity recognition[C]//International Conference on embedded
and ubiquitous computing (EUC). IEEE, 2120–2126
3. Wang S, Zhou G, Hu L et al (2015) CARE: chewing activity recognition using noninvasive single axis accelerometer[C]// International Joint Conference on pervasive and ubiquitous computing: Adjunct Publication. ACM, 109–112
4. Chen YQ, Yu HC, Miao CY et al (2015) Using motor patterns
for stroke detection[J]. Science (Advances in Computational Psychophysiology) 350(6256):12–14
5. Wang R, Chen F, Chen Z et al (2014) StudentLife: assessing
mental health, academic performance and behavioral trends ofcollege students using smartphones[C]// International Joint Conference on pervasive and ubiquitous computing. ACM, 3–14
6. https://getpebble.com/steel. Accessed 2 June 2014
7. https://jawbone.com/up. Accessed 2 June 2014
8. http://www.bodymedia.com/Support-Help/BodyMedia-FITBW. Accessed 2 June 2014
9. Zhao Q, Hu B, Shi Y et al (2014) Automatic identification andremoval of ocular artifacts in EEG—improved adaptive predictor filtering for portable applications[J]. IEEE Trans NanobioScience 13(2):109–117
10. Hu B, Majoe D, Ratcliffe M et al (2011) EEG-based cognitive interfaces for ubiquitous applications: developments andchallenges[J]. IEEE Intell Syst 26(5):46–53

Int. J. Mach. Learn. & Cyber.
11. Bao L, Intille SS (2004) Activity recognition from user-annotated acceleration data[C]//International Conference on pervasive computing. Springer, Berlin Heidelberg, 1–17
12. Berlin E, Van Laerhoven K (2012) Detecting leisure activities
with dense motif discovery[C]//International Conference onubiquitous computing. ACM, 250–259
13. Hu L (2014) A lightweight and low-power activity recognition
system for mini-wearable devices[C]//International Conference on pervasive computing and communications Workshops(PERCOM Workshops). IEEE, 166–167
14. Pärkkä J, Cluitmans L, Ermes M (2010) Personalization algorithm for real-time activity recognition using PDA, wirelessmotion bands, and binary decision tree[J]. IEEE Trans Inf
Technol Biomed 14(5):1211–1215
15. Qian H, Mao Y, Xiang W et al (2010) Recognition of humanactivities using SVM multi-class classifier[J]. Pattern Recognit
Lett 31(2):100–111
16. Hu L, Lu S, Wang X (2013) A new and informative active
learning approach for support vector machine[J]. Inf Sci
244:142–160
17. Hu L, Chen Y, Wang S et al (2014) b-COELM: A fast, lightweight and accurate activity recognition model for mini-wearable devices[J]. Pervasive Mob Comput 15:200–214
18. Zeng Z, Ji Q (2010) Knowledge based activity recognition withdynamic Bayesian network[C]//European Conference on computer vision. Springer Berlin Heidelberg, 532–546
19. Gaikwad K (2012) HMM classifier for human activity
recognition[J]. Comput Sci Eng 2(4):27
20. Song Y, Lu Z, Leung CW et al (2013) Collaborative boosting foractivity classification in microblogs[C]// International Conference on knowledge discovery and data mining. ACM, 482–490
21. Gu B, Sheng VS (2016) A robust regularization path algorithmfor ν-support vector classification. IEEE Trans Neural Netw
Learn Syst 99. doi:10.1109/TNNLS.2016.2527796
22. Gu B, Sun X, Sheng VS (2016) Structural minimax probability
machine[J].IEEE Trans Neural Netw Learn Syst 99. doi:10.1109/
TNNLS.2016.2544779
23. Gu B, Sheng VS, Wang Z et al (2015) Incremental learning forν-support vector regression[J]. Neural Netw 67:140–150
24. Gu B, Sheng VS, Tay KY et al (2015) Incremental support vector learning for ordinal regression[J]. IEEE Trans Neural Netw
Learn Syst 26(7):1403–1416
25. Gu B, Sheng V S, Li S (2015) Bi-parameter space partition forcost-sensitive SVM[C]//IJCAI 3532–3539.
26. Zhang Y, Sun X, Wang B (2016) Efficient algorithm for k-barrier
coverage based on integer linear programming[J]. China Commun 13(7):16–23
27. Wen X, Shao L, Xue Y et al (2015) A rapid learning algorithm
for vehicle classification[J]. Inf Sci 295:395–406
28. Kong Y, Zhang M, Ye D (2017) A belief propagationbased method for task allocation in open and dynamic cloudenvironments[J]. Knowl Based Syst 115:123–132
29. Zheng Y, Jeon B, Xu D et al (2015) Image segmentation by generalized hierarchical fuzzy C-means algorithm[J]. J Intell Fuzzy
Syst 28(2):961–973
30. Fu Z, Wu X, Guan C et al (2016) Toward efficient multikeyword fuzzy search over encrypted outsourced data withaccuracy improvement[J]. IEEE Trans Inf Forensics Secur
11(12):2706–2716
31. Gao X, Hoi S C H, Zhang Y et al (2014) SOML: sparse online
metric learning with application to image retrieval. In: Twentyeighth AAAI conference on artificial intelligence. AAAI
Publications

32. Chen Z, Chen Y, Gao X et al (2015) Unobtrusive sensing
incremental social contexts using fuzzy class incremental
learning[C]// International Conference on data mining (ICDM).
IEEE, 71–80
33. Huang GB, Zhu QY, Siew CK (2006) Extreme learning machine:
theory and applications[J]. Neurocomputing 70(1):489–501
34. Huang GB, Zhu QY, Siew CK (2004) Extreme learning machine:a new learning scheme of feedforward neural networks[C]//International Joint Conference on Neural Networks. IEEE
2:985–990
35. Huang GB, Chen L, Siew CK (2006) Universal approximation using incremental constructive feedforward networks
with random hidden nodes[J]. IEEE Trans Neural Networks
17(4):879–892
36. Schmidt WF, Kraaijveld MA, Duin R P W (1992) Feedforward
neural networks with random weights[C]// International Conference on Pattern Recognition. IEEE, 1–4
37. Huang G, Huang GB, Song S et al (2015) Trends in extreme
learning machines: a review[J]. Neural Netw 61:32–48
38. Huang GB, Zhou H, Ding X et al (2012) Extreme learning
machine for regression and multiclass classification[J]. IEEE
Trans Syst Man Cybern Part B (Cybernetics) 42(2):513–529
39. An S, Liu W, Venkatesh S (2007) Face recognition using kernel ridge regression[C]//International Conference on Computer
Vision and Pattern Recognition. IEEE, 1–7
40. Saunders C, Gammerman A, Vovk V (1998) Ridge regression
learning algorithm in dual variables[C]//ICML 98:515–521
41. Liu H, Qin J, Sun F et al (2016) Extreme kernel sparse learning for tactile object recognition[J]. IEEE Trans Cybern 99.
doi:10.1109/TCYB.2016.2614809
42. Hu L, Chen Y, Wang S et al (2016) Less Annotation on Personalized Activity Recognition Using Context Data[C]//International
Conference on Ubiquitous Intelligence and Computing(UIC)
327–332.
43. Liu H, Liu Y, Sun F (2015) Robust exemplar extraction using
structured sparse coding[J]. IEEE Trans Neural Netw Learn Syst
26(8):1816–1821
44. Liu H, Guo D, Sun F (2016) Object recognition using tactile
measurements: kernel sparse coding methods[J]. IEEE Trans
Instrum Meas 65(3):656–665
45. Liu H, Yu Y, Sun F et al (2016) Visual-tactile fusion for object
recognition[J]. IEEE Trans Autom Sci Eng
46. Liang NY, Huang GB, Saratchandran P et al (2006) A fast andaccurate online sequential learning algorithm for feedforward
networks[J]. IEEE Trans Neural Netw 17(6):1411–1423
47. Wang X, Han M (2014) Online sequential extreme learning
machine with kernels for nonstationary time series prediction[J].
Neurocomputing 145:90–97
48. Zhou X, Liu Z, Zhu C (2014) Online regularized and kernelized
extreme learning machines with forgetting mechanism[J]. Math
Probl Eng 2014:938548. doi:10.1155/2014/938548
49. Zhou XR, Wang CS (2016) Cholesky factorization based online
regularized and kernelized extreme learning machines with forgetting mechanism[J]. Neurocomputing 174:1147–1155
50. Scardapane S, Comminiello D, Scarpiniti M et al (2015) Online
sequential extreme learning machine with kernels[J]. IEEE Trans
Neural Netw Learn Syst 26(9):2214–2220
51. Deng WY, Zheng QH, Wang ZM (2014) Cross-person activity
recognition using reduced kernel extreme learning machine[J].
Neural Netw 53:1–7
52. Guo L, Hao JH, Liu M (2014) An incremental extreme learning
machine for online sequential learning problems[J]. Neurocomputing 128:50–58

13

Int. J. Mach. Learn. & Cyber.
53. Hager WW (1989) Updating the inverse of a matrix[J]. SIAM
Rev 31(2):221–239
54. Henderson HV, Searle SR (1981) On deriving the inverse of asum of matrices[J]. SIAM Rev 23(1):53–60
55. Barshan B, Yüksek MC (2014) Recognizing daily and sports
activities in two open source machine learning environments
using body-worn sensor units[J]. Comput J 57(11):1649–1667

13

56. Altun K, Barshan B (2010) Human activity recognition usinginertial/magnetic sensor units[C]//International Workshop on
Human Behavior Understanding. Springer Berlin Heidelberg,
38–51