improving accuracy of inertial measurement units using...

5
Improving Accuracy of Inertial Measurement Units using Support Vector Regression Saran Ahuja, Wisit Jirattigalachote, and Art Tosborvorn Abstract— Inertial measurement unit (IMU) is a sensor that measures acceleration and angular velocity rate. It has become increasingly popular due to its small size and low cost comparing to typical marker-based motion capture system. Nonetheless, IMUs face consid- erable challenges, in particular noticeable inaccuracy from accumulated integration errors. In this project, we attempted to improve accuracy of IMUs in measuring clinical knee angles using supervised machine learning, specifically support vector regression. By employing high- accuracy data from marker-based motion capture system as training samples, we were able to see improvement in the performance of the IMUs estimation of clinical knee angles in walking motion. This result is promising and encourages further works that might extend the model to include a more general set of movements. I. I NTRODUCTION Since its introduction in 1990, motion capture is used not only in the entertainment business such as films and games, but it is also used extensively in sports, medicine, and military. Traditionally, motion capture is done using images captured from cameras to triangulate positions of each reflective marker in the 3-dimensional space. While this marker-based system performs extremely well in terms of positional accuracy and continue to hold its status as the industrial standard, there is a number of undesirable features, including high cost, setup complexity, and space limitation. Recently, an alternative method has gained popu- larity. Inertial motion capture uses sensors—inertial measurement units, IMUs—attached to different parts of the body, much like reflective markers used in the optical system, to measure acceleration and angular velocity. This raw data may then be used to calculate parameters of interest, such as joint angles and other positional data. Due to its small form factor, minimal setup requirements, and low cost, inertial motion cap- ture has come to be an appealing alternative to the marker-based system. In addition, since inertial motion capture does not require camera setup, it is a viable solution for capturing outdoor motions like skiing or mountain biking that otherwise may never be achieved through traditional marker-based motion capture. As good as it may sound, inertial motion capture has one big disadvantage. Unlike the marker-based system, inertial motion capture lacks absolute positional data and relies heavily on integrating acceleration as well as angular velocity vectors in order to compute its absolute position. Taking into account sensor errors and motion approximation, the errors from this integration procedure quickly add up, and the result becomes more inaccurate as time passes. In this project, we attempted to improve the accuracy of inertial motion capture using supervised machine learning. Using both systems to simultaneously capture a subject’s motion, we trained the inertial motion capture model to more accurately estimate the valuable clinical knee angles of the subject during a walking motion. II. SYSTEM & DATA PROCESSING A. Inertial Measurement Unit (IMU) In this project, we used a system of low cost wireless inertial measurement units. The system is shown in Fig. 1. The system consisted of two IMUs with the capabil- ity of expanding up to 128 units. Each IMU has a 3- axis accelerometer with ±8g range, a 3-axis gyroscope with 1600 deg/s range, and a 3-axis magnetometer with ±4 Gauss range, all in 16-bit resolution. The data was sampled at 100 Hz and transferred to mobile phone for processing and data storage via Bluetooth connection. B. Marker-based Motion Capture System The marker-based motion capture system is widely accepted as the industry’s ‘gold standard.’ In our ex- periment, the reference system was the Vicon motion capture system with 8 cameras setup, running at 60 frames per second with sub-mm accuracy. C. Experimental Protocol We collected two standard static trials in order to estimate the rotation matrices from each IMU’s body

Upload: others

Post on 20-Jun-2020

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Improving Accuracy of Inertial Measurement Units using ...cs229.stanford.edu/proj2011/AhujaJirattigalachoteTosborvorn-ImprovingAccuracyOf...Improving Accuracy of Inertial Measurement

Improving Accuracy of Inertial Measurement Unitsusing Support Vector Regression

Saran Ahuja, Wisit Jirattigalachote, and Art Tosborvorn

Abstract— Inertial measurement unit (IMU) is a sensorthat measures acceleration and angular velocity rate.It has become increasingly popular due to its smallsize and low cost comparing to typical marker-basedmotion capture system. Nonetheless, IMUs face consid-erable challenges, in particular noticeable inaccuracyfrom accumulated integration errors. In this project, weattempted to improve accuracy of IMUs in measuringclinical knee angles using supervised machine learning,specifically support vector regression. By employing high-accuracy data from marker-based motion capture systemas training samples, we were able to see improvement inthe performance of the IMUs estimation of clinical kneeangles in walking motion. This result is promising andencourages further works that might extend the modelto include a more general set of movements.

I. INTRODUCTION

Since its introduction in 1990, motion capture isused not only in the entertainment business such asfilms and games, but it is also used extensively insports, medicine, and military. Traditionally, motioncapture is done using images captured from camerasto triangulate positions of each reflective marker in the3-dimensional space. While this marker-based systemperforms extremely well in terms of positional accuracyand continue to hold its status as the industrial standard,there is a number of undesirable features, includinghigh cost, setup complexity, and space limitation.

Recently, an alternative method has gained popu-larity. Inertial motion capture uses sensors—inertialmeasurement units, IMUs—attached to different partsof the body, much like reflective markers used in theoptical system, to measure acceleration and angularvelocity. This raw data may then be used to calculateparameters of interest, such as joint angles and otherpositional data. Due to its small form factor, minimalsetup requirements, and low cost, inertial motion cap-ture has come to be an appealing alternative to themarker-based system. In addition, since inertial motioncapture does not require camera setup, it is a viablesolution for capturing outdoor motions like skiing or

mountain biking that otherwise may never be achievedthrough traditional marker-based motion capture.

As good as it may sound, inertial motion capture hasone big disadvantage. Unlike the marker-based system,inertial motion capture lacks absolute positional dataand relies heavily on integrating acceleration as wellas angular velocity vectors in order to compute itsabsolute position. Taking into account sensor errors andmotion approximation, the errors from this integrationprocedure quickly add up, and the result becomes moreinaccurate as time passes.

In this project, we attempted to improve the accuracyof inertial motion capture using supervised machinelearning. Using both systems to simultaneously capturea subject’s motion, we trained the inertial motioncapture model to more accurately estimate the valuableclinical knee angles of the subject during a walkingmotion.

II. SYSTEM & DATA PROCESSING

A. Inertial Measurement Unit (IMU)

In this project, we used a system of low cost wirelessinertial measurement units. The system is shown in Fig.1. The system consisted of two IMUs with the capabil-ity of expanding up to 128 units. Each IMU has a 3-axis accelerometer with ±8g range, a 3-axis gyroscopewith 1600 deg/s range, and a 3-axis magnetometer with±4 Gauss range, all in 16-bit resolution. The data wassampled at 100 Hz and transferred to mobile phone forprocessing and data storage via Bluetooth connection.

B. Marker-based Motion Capture System

The marker-based motion capture system is widelyaccepted as the industry’s ‘gold standard.’ In our ex-periment, the reference system was the Vicon motioncapture system with 8 cameras setup, running at 60frames per second with sub-mm accuracy.

C. Experimental Protocol

We collected two standard static trials in order toestimate the rotation matrices from each IMU’s body

Page 2: Improving Accuracy of Inertial Measurement Units using ...cs229.stanford.edu/proj2011/AhujaJirattigalachoteTosborvorn-ImprovingAccuracyOf...Improving Accuracy of Inertial Measurement

Fig. 1. Inertial measurement unit (IMU) system with Bluetoothcapability.

frame to the reference frame. After the initial setup, wecollected data of 42 normal walking trials on a treadmillat 1.00 m/s. For each trial, we collected the data usingboth IMUs and Vicon systems simultaneously. At thebeginning of each trial, the subject jumped and stoodstill for a few seconds in order for us to be able tosynchronize the timing of both systems. Of the 42 trials,three trials were dropped due to the corrupted data fromthe IMUs, leaving us with 39 trials.

D. Clinical Knee Angle Estimation

Some of the key of parameters of a walking motionare the clinical knee angles. These parameters are veryhelpful for a physician to analyze knee-related injuriesin patients. The clinical knee angle measurementsconsist of three parameters: flexion/extension, adduc-tion/abduction, and internal/external rotation angles.

Before processing any data, we synchronized thedata from both IMU and Vicon together using thejumping event at the beginning of the trial. We thenonly used the data after jumping for training andreporting results.

From the IMUs data, we performed a quaternion-based strap-down integration method [1], [2], [3] inorder to estimate the rotation matrices. Our raw dataconsisted of gyroscopic rates, denoted by ω(t), andacceleration with respect to the body frame B. Weneed to find a rotational matrix that transformed anIMU body frame into the world reference frameW . Wewill denote this rotation matrix by R(t). A convenientway to keep track of R(t) is to use the quaternionrepresentation q̃ = [q0, λ̃λ̃

T ], where q0 is a scalar andλ̃ is a 3×1 vector. Given the quaternion representation,

the rotation matrix can be computed as follow:

R(q̃) = (q20 − λ̃T λ̃)I + 2λ̃λ̃T − 2q0[λ̃×], (1)

where I is the identity matrix and [λ̃×] is standardvector cross product. Then the following differentialmotion describes the dynamic of body angular motion:

dq̃(t)

dt= Aω(t)q̃, (2)

where

Aω(t) =1

2

0 −ωz ωy ωx

ωz 0 −ωx ωy

−ωy ωx 0 ωz

−ωx −ωy ωz 0

and ω(t) = [ωx, ωy, ωz], the angular velocity of B. Let∆t denote the system’s sampling interval and assumethat q̃(t) is constant for t ∈ [k∆t, (k+1)∆t]. Then wecan solve equation (2) explicitly and get a discrete-timequaternion

q̃k+1 = eAk∆tq̃k,

where q̃k is the quaternion at time k∆t and Ak =Aω(k∆t). q̃0 is computed so that the rotation matrixis consistent with our initial static position. Once thediscrete system above is solved, the rotation matrix isupdated using equation (1).

After we found the rotation matrix representing therotation from IMUs’ body frame to the world frame, weused a joint coordinate system (JCS) as recommendedby ISB and defined by Grood and Suntay [4], [5] tocalculate the clinical knee angles.

Fig. 2. Experimental Setup: A subject is wearing both IMUs andreflective markers.

Page 3: Improving Accuracy of Inertial Measurement Units using ...cs229.stanford.edu/proj2011/AhujaJirattigalachoteTosborvorn-ImprovingAccuracyOf...Improving Accuracy of Inertial Measurement

III. METHODOLOGY

As mentioned earlier, inertial motion capture suffersfrom buildup of errors. In this section, we describethe use of supervised machine learning procedure, inparticular support vector regression, to improve theestimation from measurement of IMUs.

After processing the data as described in the previoussection, the clinical knee angles estimation θIMU(t) arecomputed. Using relatively accurate position data frommarker-based system, we were able to compute theseangles with great accuracy. This set of data served asthe target value. We then train the model using ν-SVRwith the pairs (θIMU(t), θMarker(t)).

A. Model

Accepted as the ‘gold standard’ for position captur-ing, θMarker(t) is treated as ‘actual’ knee joint angle andwe have the following model:

θIMUt = θMarker

t + εt,

where εt is the error from the measurement (sensornoise) and integration. Since our main application isto measure knee joint angle related to a specific bodymovement (walking, running, etc.), one might expectthe error to be correlated with the angle θMarker(t). Let

εt = φ(θMarkert ) + ε̃t,

so that

θIMUt = θMarker

t + φ(θMarkert ) + ε̃t = φ̃(θMarker

t ) + ε̃t.

Inverting this relationship, we have

θMarkert = ψ(θIMU

t ) + ε̃t,

which gives a setting where the support vector regres-sion can be applied. This derivation is not meant tobe rigorous, but rather to motivate our use of supportvector regression.

B. Learning Method

From each trials, we collected and processed ourdata to get a sample path of angles measurementfrom both IMUs and marker-based motion capture asa function of time. The processed data consisted oftriplets (t, θIMU

t,i , θMarkert,i ), where t = 1, 2, . . . , T , and

i = 1, 2, . . . , N . T is the number of time steps andN is the number of trials (39 in our experiment). Ourtraining size is N · T where (t, θIMU

t,i ) gives us inputsamples to be trained with target θMarker

t,i .We applied ν-SVR with various kernels to the train-

ing set and compared the performance among different

TABLE IROOT MEAN SQUARE ERROR

Clinical Knee Angle Linear Polynomial RBFFlexion/Extension 6.1215 6.1169 6.1278Abduction/Adduction 0.6324 0.6328 0.6329Internal/External Rotation 2.3546 2.3555 2.3545

kernels. To evaluate the generalization capability of themodel, we used leave-five-out cross validation methodwith root mean square error as a criteria. More con-cretely, we performed 8 trainings and trained the modelusing 34 walks and cross validated with 5 walks (exceptfor the last training in which we used 35 walks to trainand 4 walks to cross validate). The learning procedurecan be summarized as follows:

• Normalize the training sample to have range [0,1].Let θm, θM be the minimum and maximum of oursample angles, then

xt,i =

(t

T,θIMUt,i − θmθM − θm

), yt,i =

θMarkert,i − θmθM − θm

.

• Apply ν−SVR with regularization parameter C =1 to the normalized training set {(xt,i, yt,i)}, i =1, 2, . . . , N, t = 1, 2, . . . , T}. We use libsvmtoolbox [6] which provides all necessary Matlabfunctions.

• Compute leave-five-out cross validation error us-ing root mean square error as a metric.

IV. RESULTS

For kernel selection in our support vector regressionmethod, we tried linear, polynomial, and radio-basisfunction (RBF) kernels. The results showed no signifi-cant advantage of one kernel over others across all threeangle measurements, as can be seen in Table I. For kneeflexion/extension angle, we found the RMS error to beapproximately 6.12 degrees. Knee adduction/abductionangle had an RMS error around 0.63 degrees, and forthe knee internal/external rotation angle, the RMS errorwas 2.35 degrees.

By using our model from SVR, we found a signif-icant improvement in all three knee angles estimationfrom IMUs. As seen in a sample walking trial in Fig.3, the IMUmodel (i.e. IMU data processed with SVR)was closer to the Vicon reference system, on averageof more than 50%. In addition, our estimated modelreduced the RMS errors over time across all trials atleast in half, as seen in Fig. 4.

Page 4: Improving Accuracy of Inertial Measurement Units using ...cs229.stanford.edu/proj2011/AhujaJirattigalachoteTosborvorn-ImprovingAccuracyOf...Improving Accuracy of Inertial Measurement

0 1 2 3 4 5 6

0

20

40

60

80flexion/extension

time (s)

angl

e (d

egre

es)

ViconIMUrawIMUmodel

0 1 2 3 4 5 6

2

4

6

8

adduction/abduction

time (s)

angl

e (d

egre

es)

ViconIMUrawIMUmodel

0 1 2 3 4 5 610

5

0

5

10

15internal/external rotation

time (s)

angl

e (d

egre

es)

ViconIMUrawIMUmodel

Fig. 3. Estimations of three clinical knee angles using data fromIMUs improve by more than 50% using SVR, as we can seeIMUmodel is close to the reference system (Vicon).

V. DISCUSSION

Each kernel (linear, polynomial, and RBF) showedcomparable performance across all three types of kneeangles, as seen in Table I. This is possibly due to thestructure of the error that was not specific to any kindof kernel. These relatively low cross validation errorsallowed the model to fit the actual angle nicely withoutover fitting the data. Also note that the magnitudes ofthese errors are relatively good comparing to what havebeen found in a few other similar studies [7], [8], [9],[10]. Our model estimation has an advantage of verylittle computation time requirement (around 15 secondsfor a sample of 34 trials, polynomial kernel). However,our model only considered a specific normal walkingcondition on a treadmill. Thus further experimentsinvolving various motions and speed will be requiredto improve the generalization of the model.

Support vector regression was able to reduce theerror in the knee angle estimation significantly, as seenin Fig. 3. One observation from the data is that theerror increased in time due to accumulation of errorfrom each time step discretization. By adding timesince last static position parameter into our model, wewere able to reduce accumulating errors significantly.Nevertheless, SVR is still unable to completely remove

0 1 2 3 4 5 60

5

10

15flexion/extension

time (s)

angl

e (d

egre

es)

IMUrawIMUmodel

0 1 2 3 4 5 60

0.5

1

1.5

2adduction/abduction

time (s)

angl

e (d

egre

es)

IMUrawIMUmodel

0 1 2 3 4 5 60

2

4

6

internal/external rotation

time (s)

angl

e (d

egre

es)

IMUrawIMUmodel

Fig. 4. Root-mean-squared errors due to time effect from IMUs arereduced by more than 40% on average.

non-systematic errors such as hardware sensor noises.With regards to the nature of the subject’s movement,

we notice that when the subject’s foot hit the ground,the IMU registered significant noise in acceleration.This would suggest that we might observe periodicspikes in errors from the IMU. However, Fig. 4 showedthat the root-mean-squared error from the IMUs doesnot appear to be periodic as expected. This was due inpart by the not completely synchronized step cyclesfrom our pre-processed data. Therefore these spikeswere averaged out over 39 trials. The residuals, on theother hand, exhibits higher degree of periodicity. Thismight be due to SVR, which takes into account of thetime parameter, was able to notice the cyclical trend.

VI. CONCLUSION

In this paper, we explored support vector regressionmethod to help improve knee angle estimation frommultiple inertial measurement units. We used a goldstandard marker-based motion capture system as ourlearning examples. We then utilized cross validationmethod to find an appropriate kernel to train themodel. The results demonstrated a vast improvementof clinical knee angles estimation over the typicalIMUs measurement. This would allow us to capture theessence of knee motion in a near-real-time calculation,suitable for activities that require outdoor setting and

Page 5: Improving Accuracy of Inertial Measurement Units using ...cs229.stanford.edu/proj2011/AhujaJirattigalachoteTosborvorn-ImprovingAccuracyOf...Improving Accuracy of Inertial Measurement

instant feedback. Future work would require testing andlearning of multiple motions and joint angles in orderto improve the generalization of the model.

REFERENCES

[1] A. M. Sabatini, “Quaternion-based strap-down integrationmethod for applications of inertial sensing to gait analysis.”Medical and Biological Engineering and Computing, vol. 43,no. 1, pp. 94–101, 2005.

[2] J. Favre, B. M. Jolles, O. Siegrist, and K. Aminian,“Quaternion-based fusion of gyroscopes and accelerometers toimprove 3D angle measurement,” Electronics Letters, vol. 42,no. 11, pp. 612–614, 2006.

[3] J. C. K. Chou, “Quaternion kinematic and dynamic differentialequations,” Robotics and Automation, IEEE Transactions on,vol. 8, no. 1, pp. 53–64, Feb. 1992.

[4] G. Wu, S. Siegler, P. Allard, C. Kirtley, A. Leardini, D. Rosen-baum, M. Whittle, D. D. D?Lima, L. Cristofolini, H. Witte,and et al., “Isb recommendation on definitions of joint coordi-nate system of various joints for the reporting of human jointmotion–part i: ankle, hip, and spine. international society ofbiomechanics.” Journal of Biomechanics, vol. 35, no. 4, pp.543–548, 2002.

[5] E. S. Grood and W. J. Suntay, “A joint coordinate system forthe clinical description of three-dimensional motions: appli-cation to the knee.” Journal of Biomechanical Engineering,vol. 105, no. 2, pp. 136–44, 1983.

[6] C.-C. Chang and C.-J. Lin, “LIBSVM: A library for supportvector machines,” ACM Transactions on Intelligent Systemsand Technology, vol. 2, pp. 27:1–27:27, 2011.

[7] J. Favre, R. Aissaoui, B. M. Jolles, O. Siegrist, J. A. de Guise,and K. Aminian, “3D joint rotation measurement using MEMsinertial sensors: Application to the knee joint,” in Ninth Inter-national Symposium on the 3D Analysis of Human Movement.International Society of Biomechanics (ISB) Technical Groupon the 3-D Analysis of Human Movement, June 2006.

[8] R. Takeda, S. Tadano, M. Todoh, M. Morikawa, M. Nakayasu,and S. Yoshinari, “Gait analysis using gravitational accelera-tion measured by wearable sensors.” Journal of Biomechanics,vol. 42, no. 3, pp. 223–233, 2009.

[9] G. Cooper, I. Sheret, L. McMillian, K. Siliverdis, N. Sha,D. Hodgins, L. Kenney, and D. Howard, “Inertial sensor-based knee flexion/extension angle estimation,” Journal ofBiomechanics, Sept. 2009.

[10] K. J. ODonovan, R. Kamnik, D. T. OKeeffe, and G. M. Lyons,“An inertial and magnetic sensor based technique for jointangle measurement,” Journal of Biomechanics, vol. 40, no. 12,pp. 2604 – 2611, 2007. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0021929007000103