1. Introduction
Applications that attempt to track pedestrian motion level (walking distance) for health purposes require an accurate step detection and stride length estimation (SLE) technique [
1]. Walking distance is used to assess the physical activity level of the user, which helps provide feedback and motivate a more active lifestyle [
2,
3] Another type of application based on walking distance is navigation applications. Among various indoor localization methods, pedestrian dead reckoning (PDR) [
4] has become a mainstream and practical method, because PDR does not require any infrastructure. In addition to the general applications, involving asset and personnel tracking, health monitoring, precision advertising, and location-specific push notifications, PDR is available for emergency scenarios, such as anti-terrorism action, emergency rescue, and exploration missions. Furthermore, smartphone-based PDR mainly benefits from the extensive use of smartphones—pedestrians always carry smartphones that have integrated inertial sensors. Stride length estimation is a key component of PDR, the accuracy of which will directly affect the performance of PDR systems. Therefore, in addition to providing more accurate motion level estimation, precise stride length estimation based on built-in smartphone inertial sensors enhances positioning accuracy of PDR. Most visible light positioning [
5,
6], Wi-Fi positioning [
7,
8,
9], and magnetic positioning [
10,
11,
12] critically depend on PDR. Hence, motion level estimation based on smartphones contributes to assisting and supporting patients undergoing health rehabilitation and treatment, activity monitoring of daily living, navigation, and numerous other applications [
13].
The methods for estimating pedestrian step length are summarized as two categories: the first is direct methods, based on the integration of acceleration; the second is indirect methods that leverage a model or assumption to compute step length. The double integration of the acceleration component in the forward direction is the best method to compute the stride length of pedestrians because it does not rely on any model or assumption, and does not require training phases or individual information (leg length, height, weight) [
14]. Kourogi et al. [
15] leveraged the correlation between vertical acceleration and walking velocity to estimate walking speed, and calculated stride length by multiplying walking speed with step interval. However, the non-negligible bias and noise of the accelerometers and gyroscopes resulted in the distance error growing boundlessly and cubically in time [
14]. Moreover, it is difficult to obtain the acceleration component in the forward direction from the sensor’s measurements, as well as constantly maintaining the sensor heading parallel to the pedestrian’s walking direction [
16]. Additionally, low-cost smartphone sensors are not reliable and accurate enough to estimate the stride length of a pedestrian by double integrating the acceleration [
17]. Develo** a step length estimation algorithm using MEMS (micro-electro-mechanical systems) sensors is recognized as a difficult problem.
Considerable research based on models or assumptions has been conducted to improve the accuracy of SLE, and summarized as empirical relationships [
18,
19], biomechanical models [
18,
20,
21], linear models [
22], nonlinear models [
23,
24,
25], regression-based [
22,
26], and neural networks [
27,
28,
29,
30]. One of the most renowned SLE algorithms was presented by Weinberg [
23]. To estimate the walk distance, he leveraged the range of the vertical acceleration values during each step, according to Equation (1).
where
and
denote the maximum and minimum acceleration values on the Z-axis in each stride, respectively.
k represents the calibration coefficient, which is obtained from the ratio of the actual distance and the estimated distance.
As shown in Equation (2), Kim et al. [
24] developed an empirical method, based on the average of the acceleration magnitude in each stride during walking, to calculate movement distance.
where
represents the measured acceleration value of the
sample in each step, and
N represents the number of samples corresponding to each step.
k is the calibration coefficient.
To estimate the travel distance of a pedestrian accurately, Ladetto et al. [
22] leveraged the linear relationship between step length and frequency and the local variance of acceleration to calculate the motion distance with the following equation:
where f is the step frequency, which represents the reciprocal of one stride interval, v is the acceleration variance during the interval of one step,
α and
β denote the weighting factors of step frequency and acceleration variance, respectively, and
γ represents a constant that is used to fit the relationship between the actual distance and the estimated distance.
Kang et al. [
31] simultaneously measured the inertial sensor and global positioning system (GPS) position while walking outdoors with a reliable GPS fix, and regarded the velocity from the GPS as labels to train a hybrid multiscale convolutional and recurrent neural network model. After that, Kang leveraged the prediction velocity and moving time to estimate the traveled distance. However, it is challenging to obtain accurate labels, since GPS contains a positional error. Zhu et al. [
32] measured the duration of the swing phase in each gait cycle by accelerometer and gyroscope, and then combined the acceleration information during the swing phase to obtain the step length. ** are not within the scope of this article. To reduce redundancy and maximize compatibility, all the data were published in JSON (JavaScript Object Notation) format. As shown in
Figure 5, each stride holds nine degrees-of-freedom sensor data and the corresponding stride number, smartphone mode, stride length, and total walking distance. More detailed info about the dataset can be found in GitHub (
https://github.com/wq1989/WalkingDistanceEstimation).
2.2. Pre-Processing and Walk Detection
The accelerometer data provided by the Android service were fairly noisy. High-frequency oscillations from the device and ambient environment seriously skew the clean oscillations of human motion. Normally, the step frequency was lower than 3 Hz (3 steps per second) [
40]. To minimize the impact of the smartphone shaking and sensor noise, and improve the robustness of smartphone mode recognition and stride length estimation, we utilized a 1st order Butterworth filter [
41] with a cutoff frequency = 3 Hz to remove the high frequency oscillations of the time-series sensors feature signal, and extract useful information from the low-cost sensor signals.
Figure 6 shows the signal before and after the Butterworth filter. After using a Butterworth filter, the signal was smoother, and the insignificant parts of the signal were eliminated (see the red curve).
As shown in
Figure 7, unexpectedly rotating or shaking a smartphone may arouse marked fluctuation in accelerometer and gyroscope readings, but no step event. Merely considering accelerometer and gyroscope readings for walk detection, the abnormal movements (unexpectedly rotating or shaking the smartphone) may lead to unreliable step detection results. We combined the accelerometer and gyroscope with a magnetometer to reduce the influence of random motion (shaking or rotating smartphones). This is based on the assumption that the magnitude of a magnetic reading changes significantly when the user is walking indoors, due to the magnetic field diversity at different locations. We denoted the magnitude of the gyroscope, acceleration and magnetic field at time
t as
,
and
, respectively. We introduced a sliding window of
N observed values to eliminate exception data and consider the average magnitude of acceleration
, the standard deviation of the gyroscope
, and the standard deviation of magnetic field magnitude
for walk detection, as in Equations (4)–(6).
If some or all of
,
and
were below certain thresholds, then the user was classified as static (not walking). Otherwise, the user was identified as moving. To effectively reduce the power consumption, walking detection was used to trigger the following walking distance estimation method.
4. Discussion and Conclusions
Concerning the inaccuracy of the traditional nonlinear method, we presented a walking distance estimation method consists of a smartphone mode recognition and stride length estimation based on the regression model using the inertial sensors of the smartphone. We proposed a smartphone mode recognition algorithm using a stacking ensemble classifier to effectively distinguish different smartphone modes, achieving an average recognition accuracy of 98.82%. The proposed walking distance estimation method obtained a superior performance, with a single stride length error rate of 3.30% and a walking distance error rate of 2.62%. The proposed method outperformed the commonly used nonlinear step length estimation method (Kim [
24], Weinberg [
23], Ladetto [
22]) in both single stride length and walking distance estimation. In comparison to Tapeline, this method possessed the advantages of smaller computational overhead, faster training speed, and fewer training samples. In addition to improving the performance of pedestrian dead reckoning, this technique can be used to assess the physical activity level of the user, providing feedback and motivating a more active lifestyle.
However, there are still some limitations that may be important to address in our future work. For example, only five smartphone modes (handheld, swing, pocket, arm-hand, and calling) were analyzed. More smartphone modes, such as those involving the smartphone in belts and bags, need to be further studied using similar methodologies. Additionally, we focused on the normal walk status, while other pedestrian motion states such as walking backward, lateral walking, running, and jum** will be studied in the future to construct a more viable walking distance estimation. Moreover, humans are flexible structures, it is difficult to ensure that the movement of mobile phones equals the movement of pedestrians. Extra actions (standing still, playing games, reading) result in inaccurate stride length estimation. Finally, the trained model may be not suitable for non-healthy adults (e.g., Parkinson’s patients), children, and elderly. In the future, we will investigate how to obtain training data by crowdsourcing automatically, then train a personalized SLE model in the form of online learning to mitigate user and device heterogeneity.