INTERNATIONAL JOURNAL OF COMPUTERS COMMUNICATIONS & CONTROL ISSN 1841-9836, 13(4), 566-573, August 2018. Nonparametric Regression-based Step-length Estimation for Arm-swing Walking using a Smartphone P.H. Truong, N.D. Nguyen, N.H. Ho, G.-M. Jeong Phuc Huu Truong, Nhan Duc Nguyen, Ngoc-Huynh Ho, Gu-Min Jeong* School of Electrical Engineering, Kookmin University, Jeongneung-dong, Seongbuk-gu, 02707 Korea. phtruong@kookmin.ac.kr, nhannd@kookmin.ac.kr, ngochuynh.0303@kookmin.ac.kr *Corresponding author: gm1004@kookmin.ac.kr Abstract: In this paper, we propose an adaptive step-estimation method to esti- mate the distance traveled for arm-swinging activities at three level-walking speeds, i.e., low, normal, and high speed. The proposed method is constructed based on a polynomial function of the pedestrian speed and variance of walking acceleration. We firstly apply a low-pass filter with 10 Hz cut-off frequency for acceleration data. Then, we analyze the acceleration data to find the number of steps in each sample. Finally, the traveled distance is calculated by summing all step lengths which are estimated by the proposed method during walking. Applying the proposed method, we can estimate the walking distance with an accuracy rate of 95.35% in a normal walking speed. The accuracy rates of low and high walking speeds are 94.63% and 94.97%, respectively. Furthermore, the proposed method outperforms conventional methods in terms of accuracy and standard deviation at low, normal, and high speeds. Keywords: Walking distance estimation, Pedestrian Dead Reckoning (PDR), non- parametric regression, arm-swinging. 1 Introduction Recently, Pedestrian Dead Reckoning (PDR), which uses sensor information to estimate the location and orientation of a pedestrian in a global positioning system-denied scenarios [2, 6, 11,15], has received considerable attention from researchers. Moreover, PDR technology brings many advantages on energy consumption, weight, cost compared with the inertial navigation system for indoor navigation. This leads to numerous researches on the PDR field over the last few years. PDR algorithms commonly compute the walking distance by detecting users’ steps and es- timating the step lengths. Due to the location of mounted sensors, step detection and analysis can be done in many different ways. Fixing sensors on the user’s foot, stance phases of the foot and the step detection can be determined [15, 17]. Zero Velocity Update (ZUPT) method is commonly used in this foot mounting configuration to bound the error accumulation [7,13,15]. In the second configuration, researchers fixed the inertial sensor on users’ belts [1], or kept sen- sors in a constant pose [8]. The inertial force experienced by the sensor is directly linked to the motion of the human body’s Center-of-Mass (COM) and, subsequently, to user’s movement [16]. Therefore, in arm-swinging activities, where an inertial force of the sensor is not linked to the human’s motion, an extra acceleration affects significantly the accuracy of walking distance es- timation. Suh et al. [14] proposed a peak detection algorithm using five data points to find the number of walking steps. This algorithm utilizes the constraints between the times and consecutive peak values to detect the steps. Tian et al. [16] presented a step frequency-based Copyright ©2018 CC BY-NC Nonparametric Regression-based Step-length Estimation for Arm-swing Walking using a Smartphone 567 and individual-height-based distance estimation for pedestrian swinging arms. However, their method only focused on walking at the normal speed. In this paper, we propose a distance estimation method for arm-swinging cases where a pedestrian holds a smartphone in hand and naturally walks at three speed levels. In general, data from smartphone are collected in the sensor coordinate system; thus, we firstly need to transform experimental data into the world coordinate system for synchronizing recorded data with the pedestrian movements. A low-pass filter (LPF) with 10 Hz cut-off frequency is applied to remove noise from the raw data. Then, we analyze arm-swing-related gait cycles and define step phases in human walking. Finally, we estimate the length of each step using an adaptive conversion as a polynomial function of the walking speed. The polynomial function is obtained by using a nonparametric regression called locally weighted polynomial regression [5,10]. In addition, this step-length estimation is an improvement of method [18]. The proposed method estimates the walking distance with an accuracy rate of 96.05%, 94.79%, and 94.20% in the normal, low, and high walking speeds, respectively. To demonstrate the performance of the proposed method, we compare experimental results of our method with two reference methods [16,18]. 2 Problem formulation During walking, pedestrians hold smartphones in their hands and swing their arms forward or backward. This action varies the acceleration collected in smartphones, and thus, affects the estimation results of walking distance. We propose a distance estimation method for arm- swinging pedestrians in three speed levels. Figure 1 illustrates the walking condition of an arm-swinging pedestrian with three levels of speed. The rightmost sub-figure presents not only the phone-holding posture but also the smartphone orientation. Low walking Normal walking Fast walking XY Z Holding mode Figure 1: Walking speed levels and smartphone holding posture. Sensor inertial data Preprocessing Coordinate transformation Step detection Step-based feature extraction Nonparametric regressor Figure 2: Block diagram of walking distance estimation Figure 2 illustrates our proposed method for estimating the traveling distance. After col- lecting inertial data from the smartphone, we apply a low-pass filter to acceleration signals to isolate the force of gravity and remove the noise created during movement. Then, we transform the accelerations from smartphone’s coordinates to the world coordinates using Euler’s rotation theorem. By analyzing the arm-swinging phase, we find the number of steps in each trial. A feature is extracted as the magnitude of the average velocities on three dimensional axes in each step. A nonparametric regressor uses the extracted feature and ground truth to estimate the walking distance. 568 P.H. Truong, N.D. Nguyen, N.H. Ho, G.-M. Jeong 3 Data preprocessing Using Euler’s rotation theorem [12], we transform the raw data of the accelerometer from the smartphone’s frame into the world frame. Generally, a step frequency is below 10 Hz for human walking [3]. Therefore, we design a Kaiser window-based LPF to remove noise from raw signals. The Kaiser window is defined as follows: w (n) =   I0 ( β √ 1 − ( n−N/2 N/2 )2) I0 (β) , 0 ≤ n ≤ N 0 otherwise, (1) where, I0 is the zeroth-order modified Bessel function; N is the length of the sequence without the first element; and β is the Kaiser window parameter that affects the sidelobe attenuation of Fourier transform of the window. To obtain Kaiser window with a sidelobe attenuation of α dB, β is determined using the following formula: β =   0.1102 (α− 8.7) , α > 50 5.5842(α− 21)0.4 + 0.07886 (α− 21) , 50 ≥ α ≥ 21 0, α < 21. (2) Figure 3 shows a demonstration of magnitude response of an x-axis acceleration of the FIR filter-based Kaiser window. 200 400 600 800 1000 1200 1400 1600 Time (s) -6 -4 -2 0 2 4 6 A c c e le ra ti o n ( m /s 2 ) Raw signal Filtered signal Figure 3: Magnitude response of low-pass FIR filter 4 Arm-swing analysis In human walking, an arm-swinging cycle is divided into two phases: forward-swing and backward-swing, as shown in Figure 4. The forward-swing phase starts when the hand holding the smartphone is at the highest position behind the waist with maximum acceleration (black "X" symbol) and the same-side foot touches the ground. Then, the hand moves forward to the front of the body and the acceleration drops to a minimum (pink cycle) when the body is in a stance phase. Eventually, the hand stops at the highest forward position and the acceleration reaches the highest position (other black "X" symbol) while the opposite-side foot hits the ground. On the other hand, the backward-swing phase starts when the observed hand starts moving backward from the front of the waist while the acceleration decreases from the maximum value and the Nonparametric Regression-based Step-length Estimation for Arm-swing Walking using a Smartphone 569 opposite-side foot touches the ground. Acceleration in the backward-swing phase decreases to the smallest value (other pink cycle) in the stance phase, and then increases to the highest value (other black "X" symbol) when the hand is at the back of the user’s body. Meanwhile, a same-side foot hits the ground. Therefore, there are two steps in a complete arm-swinging cycle. 660680700720 740760780 -4 -3 -2 -1 0 1 2 Highest point backward Highest point backward Stance point forward Stance point backward Highest point forward Forward SwingBackward Swing A c c e le ra ti o n ( m / s 2 ) -2 -3 -4 -1 0 1 2 Time (s) 6.66.87.07.27.47.67.8 Figure 4: Arm-swing cycle analysis 5 Adaptive step-length estimation A distance estimation method for pedestrian walking based on vertical acceleration was pro- posed by Weinberg [18]. His well-known formula is expressed as follows: Lw ≈ Kw × 4 √ Amax −Amin, (3) where, Lw is the step length; Kw is a constant; and Amax, Amin are the highest and smallest vertical acceleration values in a single step, respectively. Based on the Weinberg’s formula, we propose a K-factor adapted along steps as a polynomial function of step velocity. The adaptive K-factor for each step is considered as a general regression model: K = f(V,β) + e, i = 1, 2, ...,n, (4) where V =   1 v1 · · · v1p 1 v2 · · · v2p ... ... ... ... 1 vn · · · vnp   , (5) K = (K1,K2, ...,Kn) T , (6) β = (β0,β1, ...,βp) T , (7) 570 P.H. Truong, N.D. Nguyen, N.H. Ho, G.-M. Jeong e = (e1,e2, ...,en) T . (8) It should be noted that v is the magnitude of the average velocities on x,y, and z-axes in each step; e and n are the noise or measurement error and the number of observations, respectively. We assume the noise e is uncorrelated, mean zeros, and random variables. Then, the locally weighted polynomial regression is obtained through the solution of the weighted least squares problem: β̂ = argmin β (K −V β)TW(K −V β), (9) where, W is a diagonal matrix with the Gaussian weights which can achieve a more accurate local approximation model [4]. The solution respecting to the coefficient β is β̂ = (V TWV )−1(V TWK). (10) Additionally, the K-factor is obtained as Ki = β0 + viβ1 + ... + vi pβp. (11) The proposed adaptive step-length estimation equation is Lstepi = (β0 + viβ1 + ... + vi pβp) × 4 √ Amax −Amin. (12) The walking distance within each trial is calculated by summing the distance traveled of all the steps. D = N∑ i=1 Lstep(i), (13) where, N is the number of walking steps in each trial. 6 Experimental results In our experiments, three participants were required to walk forward 15 m, and swing their hands in their casual manner. We collected 300 samples of the acceleration and gyroscope signals at the sampling rate of 50Hz. To validate the performance of a proposed method and selecting the degree of a polynomial function, we applied a K-fold Cross-Validation (K = 6) on the dataset. We divided the dataset into 6 roughly equal-sized parts. We, then, took alternately 5 parts for the training set and used the remaining part as the test set. Figure 5 shows the mean squared errors versus degrees of freedom [9] of the training set for different degrees of the polynomial function (K = 2, 3, ..., 6). We selected the degree of the polynomial equal to 6 to minimize both errors of the training set and test set. We compared the estimation results of our proposed method with Tian et al. [16] and Wein- berg et al. [18] methods. Figure 6 shows the accuracy rates of three methods versus three speed levels, i.e., low, normal, and high speed. Note that the speed levels are obtained based on our previous approach [8]. We defined the speed levels in the experimental samples based on a nor- mal distribution of average walking velocities v and velocity deviation σ. Thus, the ranges of the low, normal, and high speeds are v ≤ v −σ, v −σ < v < v + σ, and v ≥ v + σ, respectively. Table 1 describes the average results of error rates and standard deviations (Std.) of three methods. The proposed method achieved a higher accuracy and a lower standard deviation in compar- ison with the two reference methods. In particular, the proposed method obtained the average Nonparametric Regression-based Step-length Estimation for Arm-swing Walking using a Smartphone 571 0 10 20 30 40 50 60 70 80 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2 2.05 ×10 -3 Global, degree = 2 Local, degree = 2 Global, degree = 3 Local, degree = 3 Global, degree = 4 Local, degree = 4 Global, degree = 5 Local, degree = 5 Global, degree = 6 Local, degree = 6 Degrees of freedom M S E Figure 5: Mean squared error (MSE) versus polynomial degree 0 10 20 30 40 50 60 70 80 90 100 Weinberg et al. Tian et al. Proposed method Low Normal High Speed levels A c c u ra c y Figure 6: Estimation accuracy of the three methods Table 1: Comparison of estimation results of the proposed method with reference methods Speed level Low Normal High Error (%) Std (m) Error (%) Std (m) Error (%) Std (m) Weinberg [18] 25.24 0.74 17.10 0.89 8.92 0.67 Tian [16] 12.32 1.02 5.44 1.16 11.18 0.51 Proposed method Training 3.87 0.56 4.02 0.54 4.09 0.65 Testing 5.37 0.54 4.65 0.68 5.03 0.52 error rate and average standard deviation of 5.01% and 0.56 m in the testing phase, respec- 572 P.H. Truong, N.D. Nguyen, N.H. Ho, G.-M. Jeong tively, which significantly surpassed the reference methods’ results. Between the two reference methods, the method proposed by Tian et al. shows lower error rates for the slow and normal walking speeds (12.32% and 5.44%, respectively), but suffers a higher error for the high speed level (11.18%). On the contrary, the average standard deviation of Weinberg et al.’s method was better than Tian et al.’s method. Generally, the application of these two methods into walking distance estimation for the arm-swing activities is a case-by-case issue. Contrarily, the proposed method was well-performed for all three cases of walking speeds. 7 Conclusion In this paper, we proposed an adaptive distance estimation method for arm-swinging activities at the three levels of speed, i.e., low, normal, and high speed. We analyzed the phases of the arm-swinging activities to determine the number of steps in each sample. The degree of the polynomial function was selected by analyzing the mean squared error versus the degrees of freedom of each polynomial value using the cross-validation technique. The results revealed that the proposed method estimated the distance traveled better than the conventional methods in terms of the accuracy and standard deviation of the results. Acknowledgment This research was supported by the Basic Science Research Program through the National Re- search Foundation of Korea (NRF) funded by the Ministry of Education (NRF- 2015R1D1A1A01 060917), the Korean Government (MSIP)(NRF-2016R1A5A1012966), and Global Scholarship Program for Foreign Graduate Student at Kookmin University in Korea. Bibliography [1] Alvarez, D.; Gonzalez, R. C.; Lopez, A.; Alvarez, J. C. (2006); Comparison of step length estimators from wearable accelerometer devices, IEEE Engineering in Medicine and Biology Society, 5964-5967, 2006. [2] Capurso, N.; Song, T.; Cheng, W.; Yu, J.; Cheng, X. (2016); An Android-based mechanism for energy efficient localization depending on indoor/outdoor context, IEEE Internet of Things Journal, 4(2), 299-307, 2016. [3] Chen, K.Y.; Bassett, D.R. (2005); The technology of accelerometry-based activity monitors: current and future, Medicine and science in sports and exercise, 37(11), S490-S500, 2005. [4] Cleveland, W. S.; Loader, C. (1996); Smoothing by local regression: Principles and methods, Physica-Verlag HD, 10-49, 1996. [5] Cleveland, W. S.; Devlin, S. J. (1988); Locally weighted regression: An approach to regres- sion analysis by local fitting, J. Am. Stat. Assoc., 83(403), 596-610, 1988. [6] Donoso, Y.; Montoya, G. A.; Solano, F. (2015); An Energy-Efficient and Routing Approach for Position Estimation using Kalman Filter Techniques in Mobile WSNs, International Journal of Computers Communications & Control, 10(4), 500-507, 2015. [7] Foxlin, E. (2005); Pedestrian tracking with shoe-mounted inertial sensors, IEEE Comput. Graph. Appl, 25, 38-46, 2005. Nonparametric Regression-based Step-length Estimation for Arm-swing Walking using a Smartphone 573 [8] Ho, N.-H.; Truong, P. H.; Jeong, G.-M. (2016); Step-detection and adaptive step-length estimation for pedestrian dead-reckoning at various walking speeds using a smartphone, Sensors, 16(9), 14-23, 2016. [9] Jekabsons, G. (2016); Locally weighted polynomials toolbox for Matlab/Octave, 2016. [10] Lall, U.; Moon, Y.-I.; Kwon, H.-H.; Bosworth, K. (2006); Locally weighted polynomial regression: Parameter choice and application to forecasts of the Great Salt Lake, Water Resour. Res., 42, W05422, 2006. [11] Liu, Y.; Chen, Y.; Shi, L.; Tian, Z.; Zhou, M.; Li, L. (2015); Accelerometer based joint step detection and adaptive step length estimation algorithm using handheld devices, Journal of Communications, 10(7), 520-525, 2015. [12] Palais, B.; Palais, R.; Rodi, S. (2009); A disorienting look at Euler’s theorem on the axis of a rotation, American Mathematical Monthly, 116(10), 892-909, 2009. [13] Skog, I.; Handel, P.; Nilsson, J.-O.; Rantakokko, J. (2010); Zero-velocity detection−An algorithm evaluation, IEEE Trans. Biomed. Eng, 57, 2657-2665, 2010. [14] Suh, Y. S.; Nemati, E.; Sarrafzadeh, M. (2016); Kalman-filter-based walking distance es- timation for a smart-watch, IEEE First Conference on Connected Health: Applications, Systems and Engineering Technologies, 150-156, 2016. [15] Susi, M.; Renaudin, V.; Lachapelle, G. (2013); Motion mode recognition and step detection algorithms for mobile phone users, Sensors, 13, 1539-1562, 2013. [16] Tian, Q.; Salcic, Z.; Wang, K.; Pan, Y. (2016); A multi-mode dead reckoning system for pedestrian tracking using smartphones, IEEE Sensors Journal, 16(7), 2079-2093, 2016. [17] Truong, P. H.; Lee, J.; Kwon, A. R.; Jeong, G.-M. (2016); Stride counting in human walking and walking distance estimation using insole sensors, Sensors, 16(6), 8-23, 2016. [18] Weinberg, H. (2002); Using the ADXL202 in pedometer and personal navigation applica- tions, Analog Devices, 2002.